auto_ml
auto_ml copied to clipboard
Train gives errors with DeepLearningClassifier, DeepLearningRegressor, LinearRegression and Ridge
I have found that the train method gives "AttributeError: 'int' object has no attribute 'ndim'" with DeepLearningClassifier and DeepLearningRegressor.
LinearRegression and Ridge gives the error "IndexError: invalid index to scalar variable."
I had to test the models individually to see this, when they are included with other models, the error is not shown, the indication is the mean score of -1000000000.0000
The code that recreates the issue is:
# import libraries
import pandas as pd
from pysqldf import SQLDF
from auto_ml import Predictor
from sklearn.model_selection import train_test_split
# load data
heart_df = pd.read_csv(
"https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.cleveland.data",
names = ['age','sex','cp','trestbps','chol','fbs','restecg',
'thalach','exang','oldpeak','slope','ca','thal','num' ])
# use SQL to rename and summarize columns
sqldf = SQLDF(globals())
df = sqldf.execute("SELECT age,sex, cp as chestpaintype,trestbps as restingbp,chol,fbs as fastbsugar,"\
+"restecg, thalach as maxheartrate ,exang, oldpeak,slope, ca as vessels,thal, "\
+"case when num > 0 then 1 else 0 end as heartdisease from heart_df")
# create train and test splits
df_train, df_test = train_test_split(df, test_size=0.3, random_state=42)
# set column descriptions
column_descriptions = {
'sex':'categorical', 'chestpaintype': 'categorical', 'fastbsugar': 'categorical',
'restecg': 'categorical', 'exang': 'categorical', 'slope': 'categorical',
'thal': 'categorical', 'vessels' :'categorical', 'heartdisease':'output' }
#run Predictor with just DeepLearningClassifier to show the issue
ml_predictor = Predictor(type_of_estimator='classifier', column_descriptions=column_descriptions)
ml_predictor.train(df_train,model_names=['DeepLearningClassifier'])
Hi John! Thanks for filing this.
keras or tensorflow (not sure which one) broke their api in a recent release. try pip install keras==2.1.1, and if that doesn't do it pip install tensorflow==1.4.0.
as for the linear models- that one's new. i'll try to look into that soon. ping me here if you're currently blocked on this and i'll try to get to it quicker!
thanks again for the bug report.
Thanks Preston!
getting the same error with DeepLearningClassifier
what package I should install to use DeepLearningClassifier, DeepLearningRegressor?
is it possible to run with very simple packages in use?