Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package not predicting #154

Closed
andamchako opened this issue Aug 21, 2020 · 5 comments
Closed

package not predicting #154

andamchako opened this issue Aug 21, 2020 · 5 comments

Comments

@andamchako
Copy link

andamchako commented Aug 21, 2020

  • Lazy Predict version: lazypredict-0.2.7
  • Python version: 3.8
  • Operating System: Windows 10 64-bit

Description

I'm trying to make predictions but keep getting the same error both locally and on colab

What I Did


AttributeError                            Traceback (most recent call last)
<ipython-input-22-cb325c4d69cb> in <module>
      1 from lazypredict.Supervised import LazyClassifier
      2 clf = LazyClassifier(verbose=0,ignore_warnings=True, custom_metric=None)
----> 3 models,predictions = clf.fit(X_train, X_test, y_train, y_test)
      4 models

~\AppData\Local\Continuum\anaconda3\lib\site-packages\lazypredict\Supervised.py in fit(self, X_train, X_test, y_train, y_test)
    203             X_test = pd.DataFrame(X_test)
    204 
--> 205         numeric_features = X_train.select_dtypes(
    206             include=['int64', 'float64', 'int32', 'float32']).columns
    207         categorical_features = X_train.select_dtypes(

~\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\sparse\base.py in __getattr__(self, attr)
    689             return self.getnnz()
    690         else:
--> 691             raise AttributeError(attr + " not found")
    692 
    693     def transpose(self, axes=None, copy=False):

AttributeError: select_dtypes not found.
@shankarpandala
Copy link
Owner

@andamchako What are the datatypes of you input ?

@Tarrannum
Copy link

I am facing the same issue, the dtypes selected are int64 and float64

@shankarpandala
Copy link
Owner

I am facing the same issue, the dtypes selected are int64 and float64

Can you show any reproducible example ?

@AbhiPawar5
Copy link

Hi @shankarpandala, Thanks for creating such an amazing package!
I have encountered the same issue mentioned above - AttributeError: select_dtypes not found

Environment : Google Colab

  • Python - 3.7.11
  • lazypredict==0.2.9

Objective : Text classification using CountVectorizer and Tfidf, target label - 0 or 1

Sample code :

sentences = df[['cleaned_text']].values
y = df['label'].values


sentences_train, sentences_test, y_train, y_test = train_test_split(sentences, y, 
                                                                    test_size=0.25, random_state=1000)

#BOW
count_vect = CountVectorizer(ngram_range=(1, 1))
count_vect.fit(sentences_train.ravel())

X_train = count_vect.fit_transform(sentences_train.ravel())
X_test  = count_vect.transform(sentences_test.ravel())

import lazypredict
from lazypredict.Supervised import LazyClassifier
clf = LazyClassifier(verbose=0, ignore_warnings=True, custom_metric=None)
models,predictions = clf.fit(X_train, X_test, y_train, y_test)

@jdvala
Copy link

jdvala commented Dec 27, 2021

Hi @AbhiPawar5 I have created a package inspired by lazypredict for text classification. Please check it out, comments and suggestions are welcome
https://github.com/jdvala/lazytext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants