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

AttributeError: module 'blobcity.main.modelSelection' has no attribute 'getKFold' #242

Open
NicolasMICAUX opened this issue Sep 11, 2022 · 2 comments

Comments

@NicolasMICAUX
Copy link

NicolasMICAUX commented Sep 11, 2022

I have really simple code model = bc.train(df=df, target='score', features=['brand', 'category', 'source'])
Fails with following error

[/usr/local/lib/python3.7/dist-packages/blobcity/main/driver.py](https://localhost:8080/#) in train(file, df, target, features, model_types, accuracy_criteria, disable_colinearity, epochs, max_neural_search)
     76 
     77     accuracy_criteria= accuracy_criteria if accuracy_criteria<=1.0 else (accuracy_criteria/100)
---> 78     modelClass = model_search(dataframe=CleanedDF,target=target,DictClass=dict_class,disable_colinearity=disable_colinearity,model_types=model_types,accuracy_criteria=accuracy_criteria,epochs=epochs,max_neural_search=max_neural_search)
     79     modelClass.yamldata=dict_class.getdict()
     80     modelClass.feature_importance_=dict_class.feature_importance if(features==None) else calculate_feature_importance(CleanedDF.drop(target,axis=1),CleanedDF[target],dict_class)

[/usr/local/lib/python3.7/dist-packages/blobcity/main/modelSelection.py](https://localhost:8080/#) in model_search(dataframe, target, DictClass, disable_colinearity, model_types, accuracy_criteria, epochs, max_neural_search)
    289 
    290     elif model_types=='all':
--> 291         modelResult=classic_model(ptype,dataframe,target,X,Y,DictClass,modelsList,accuracy_criteria,4)
    292         if modelResult[2]<accuracy_criteria:
    293             gpu_num=tf.config.list_physical_devices('GPU')

[/usr/local/lib/python3.7/dist-packages/blobcity/main/modelSelection.py](https://localhost:8080/#) in classic_model(ptype, dataframe, target, X, Y, DictClass, modelsList, accuracy_criteria, stages)
    206         print("Quick Search(Stage 1 of {}) is skipped".format(stages))
    207         best=train_on_full_data(X,Y,modelsList,modelsList,DictClass,stages)
--> 208     modelResult = Tuner.tune_model(dataframe,target,best,modelsList,ptype,accuracy_criteria,DictClass,stages)
    209     return modelResult
    210 

[/usr/local/lib/python3.7/dist-packages/blobcity/config/tuner.py](https://localhost:8080/#) in tune_model(dataframe, target, modelkey, modelList, ptype, accuracy, DictionaryClass, stages)
    203     prog=Progress()
    204     X,Y=dataframe.drop(target,axis=1),dataframe[target]
--> 205     cv=modelSelection.getKFold(X)
    206     get_param_list(modelkey,modelList)
    207     EarlyStopper.criterion=accuracy

AttributeError: module 'blobcity.main.modelSelection' has no attribute 'getKFold'

I use Google Colab, python3.7.13, latest version of all libs installed with :

!pip install git+https://github.com/keras-team/keras-tuner.git
!pip install autokeras
!pip install blobcity

My df consists of 3 categorical features (source, brand, category) used to predict float score

@NicolasMICAUX
Copy link
Author

On my personal CPU, with python3.10 and same libs config, it does not fail at this step.

@Thilakraj1998
Copy link
Contributor

@NicolasMICAUX we tried to reproduce the issue on Colab for multiple similar datasets but didn't encounter the same issue.

for the installation procedure on colab, we did only

!pip install autokeras
!pip install blobcity

can you try only installing these two dependencies?

if the issue still exists, if possible do share your Colab notebook over here.

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

2 participants