TypeError: cannot perform reduce with flexible type OR AttributeError: 'Predictor' object has no attribute 'grid_search_pipelines'
See original GitHub issueVery cool package!
I am trying out auto_ml with this dataset on SMS spam. I added a header row to the file to give it column names and then do the following:
import pandas as p
import dill
from sklearn.model_selection import train_test_split
from auto_ml import Predictor
df = p.read_table('/home/data/auto_ml/sms.txt')
df_train, df_test = train_test_split(df, test_size=0.5, random_state=42)
column_descriptions = {
'spam': 'output'
, 'text': 'nlp'
}
ml_predictor = Predictor(type_of_estimator='classifier', column_descriptions=column_descriptions)
ml_predictor.train(df_train)
You can see it sort of works because it is telling me about feature importance but then gives :
… nlp_text_txt: 0.0373 nlp_text_free: 0.0441 Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/usr/local/lib/python2.7/dist-packages/auto_ml/predictor.py”, line 597, in train if len(self.grid_search_pipelines) > 1: AttributeError: ‘Predictor’ object has no attribute ‘grid_search_pipelines’
Originally I was trying:
ml_predictor.train(df_train,ml_for_analytics=True)
and got:
test_score = ml_predictor.score(df_test, df_test.spam) Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/usr/local/lib/python2.7/dist-packages/auto_ml/predictor.py”, line 1014, in score score, probas = self._scorer.score(self.trained_pipeline, X_test, y_test, advanced_scoring=advanced_scoring) File “/usr/local/lib/python2.7/dist-packages/auto_ml/utils_scoring.py”, line 268, in score score = self.scoring_func(y, predictions) File “/usr/local/lib/python2.7/dist-packages/sklearn/metrics/classification.py”, line 1884, in brier_score_loss pos_label = y_true.max() File “/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py”, line 26, in _amax return umr_maximum(a, axis, None, out, keepdims) TypeError: cannot perform reduce with flexible type
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
No need to apologize, the idea is a cool one and you’re doing the community a great service by looking into issues so quick.
I was using:
and upgrading auto_ml fixed it! I will continue experimenting…
yay!