trevorstephens / gplearn

Genetic Programming in Python, with a scikit-learn inspired API
http://gplearn.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.59k stars 281 forks source link

SymbolicClassifier doesn't classify tasks with more than 2 classes. #290

Open TheGhoul27 opened 1 year ago

TheGhoul27 commented 1 year ago

Is your feature request related to a problem? Please describe.

I would like to request for a polyclass classifier using SymbolicClassifier. Currently the classifier is only able to classify 2 classes.

Describe the solution you'd like

It would be useful if the polyclass classifier was implemented. As most of the current ML models require us to classify multi class or classes over 2. Current version limits us to use GPLearn for 2 class classification.

Additional context

garar commented 1 year ago

Hi @TheGhoul27 !

Can you use: OneVsRestClassifier, OneVsOneClassifier or MultiOutputClassifier from sklearn as a workaround?

https://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OneVsRestClassifier.html https://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OneVsOneClassifier.html https://scikit-learn.org/stable/modules/generated/sklearn.multioutput.MultiOutputClassifier.html

They can convert binary classifier to handle multiple classes.