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

Gama Minimal example not working #152

Closed
prabhant opened this issue Mar 29, 2022 · 3 comments
Closed

Gama Minimal example not working #152

prabhant opened this issue Mar 29, 2022 · 3 comments

Comments

@prabhant
Copy link

The example for gama is not working : https://openml-labs.github.io/gama/master/user_guide/index.html#examples
MWE on colab

!pip install gama
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.metrics import log_loss, accuracy_score
from gama import GamaClassifier

if __name__ == "__main__":
    X, y = load_breast_cancer(return_X_y=True)
    X_train, X_test, y_train, y_test = train_test_split(
        X, y, stratify=y, random_state=0
    )

    automl = GamaClassifier(max_total_time=180, store="nothing", n_jobs=1)
    print("Starting `fit` which will take roughly 3 minutes.")
    automl.fit(X_train, y_train)

    label_predictions = automl.predict(X_test)
    probability_predictions = automl.predict_proba(X_test)

    print("accuracy:", accuracy_score(y_test, label_predictions))
    print("log loss:", log_loss(y_test, probability_predictions))

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
yellowbrick 1.4 requires scikit-learn>=1.0.0, but you have scikit-learn 0.24.2 which is incompatible.
google-colab 1.0.0 requires pandas>=1.1.0; python_version >= "3.0", but you have pandas 1.0.5 which is incompatible.
Successfully installed black-19.10b0 category-encoders-2.4.0 gama-21.0.1 liac-arff-2.5.0 pandas-1.0.5 pathspec-0.9.0 scikit-learn-0.24.2 stopit-1.1.2 toml-0.10.2 typed-ast-1.5.2
/usr/local/lib/python3.7/dist-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing as tm
Starting `fit` which will take roughly 3 minutes.
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[<ipython-input-1-22d5f67a2b5d>](https://localhost:8080/#) in <module>()
     13     automl = GamaClassifier(max_total_time=180, store="nothing", n_jobs=1)
     14     print("Starting `fit` which will take roughly 3 minutes.")
---> 15     automl.fit(X_train, y_train)
     16 
     17     label_predictions = automl.predict(X_test)

5 frames
[/usr/local/lib/python3.7/dist-packages/category_encoders/one_hot.py](https://localhost:8080/#) in fit(self, X, y, **kwargs)
    155             'value': 'value',
    156             'indicator': 'return_nan',
--> 157         }[self.handle_missing]
    158 
    159         self.ordinal_encoder = OrdinalEncoder(

KeyError: 'ignore'
@chclam
Copy link
Contributor

chclam commented Mar 29, 2022

Hi, this issue has been raised and addressed in a recent fix: #148, see commit: 74e0407. Please pull the recent changes from this Github repo :)

@prabhant
Copy link
Author

Thanks, I was fetching the develop branch, maybe merge these changes with develop branch as well :)

@PGijsbers
Copy link
Member

My bad, the development branch is no longer in use. master is now the default branch, and releases get dedicated branches. But I did not manage to update the docs yet :(

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

3 participants