Giter Club home page Giter Club logo

Comments (6)

 avatar commented on May 18, 2024 1

Yes, it works :)
Thank you for your help.

from atom.

tvdboom avatar tvdboom commented on May 18, 2024

What version of atom are you using? That functionality was deprecated in 5.1.0 I believe. I see that the documentation was not updated accordingly, sorry for that. In the latest version the multioutput meta-estimator is assigned by default. Doing atom.multioutput = ... doesn't do anything. So the same results make sense because you are using the same estimator (check it printing atom.rf.estimator). So you can either downgrade to the previous version or you can assign the three estimators directly to the run method (that way you also have all three models in the same atom instance).

atom.run(["RF", MultiOutputClassifier(RandomForestClassifier()), ClassifierChain(RandomForestClassifier())])

from atom.

 avatar commented on May 18, 2024

My version is 5.2.0.
Unfortunately your example don't work for me. When I use your command, I've got:

Training ========================= >>
Models: RF, MOC, CC
Metric: average_precision


Results for RandomForest:
Fit ---------------------------------------------
Train evaluation --> average_precision: 1.0
Test evaluation --> average_precision: 0.6468
Time elapsed: 0.155s
-------------------------------------------------
Total time: 0.155s


Results for MultiOutputClassifier:
Fit ---------------------------------------------

Exception encountered while running the MOC model.
TypeError: MultiOutputClassifier.__init__() got an unexpected keyword argument 'estimator__bootstrap'


Results for ClassifierChain:
Fit ---------------------------------------------

Exception encountered while running the CC model.
TypeError: _BaseChain.__init__() got an unexpected keyword argument 'base_estimator__bootstrap'


Final results ==================== >>
Total time: 0.160s
-------------------------------------
RandomForest --> average_precision: 0.6468 ~
Consecutive runs of model RF. The former model has been overwritten.

from atom.

tvdboom avatar tvdboom commented on May 18, 2024

I made a mistake. You have to specify in the custom model that the class doesn't need a multilabel wrapper.

from sklearn.datasets import make_multilabel_classification
from sklearn.multioutput import ClassifierChain, MultiOutputClassifier
from sklearn.ensemble import RandomForestClassifier
from atom import ATOMClassifier, ATOMModel

X, y = make_multilabel_classification(n_samples=300, n_classes=3, random_state=1)

atom = ATOMClassifier(X, y=y, verbose=2, random_state=1)

chain = ATOMModel(ClassifierChain(RandomForestClassifier()), native_multilabel=True)
multi = ATOMModel(MultiOutputClassifier(RandomForestClassifier()), native_multilabel=True)

atom.run(["rf", chain, multi])

from atom.

 avatar commented on May 18, 2024

Thanks for quick replay. Unfortunately this still don't work. There is no native_multilabel parameter in ATOMModel module.
I've the following error:

TypeError: ATOMModel() got an unexpected keyword argument 'native_multilabel'

from atom.

tvdboom avatar tvdboom commented on May 18, 2024

you are right. that's functionality of the development branch, not yet released. The dev branch also contains a fix for the error you showed before (TypeError: _BaseChain.__init__() got an unexpected keyword argument 'base_estimator__bootstrap').

You can install atom from that branch using pip install git+https://github.com/tvdboom/ATOM.git@development. Then it should work.

from atom.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.