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

feature Request - cover binary classification? #17

Closed
sskarkhanis opened this issue Jul 29, 2016 · 11 comments · Fixed by #141
Closed

feature Request - cover binary classification? #17

sskarkhanis opened this issue Jul 29, 2016 · 11 comments · Fixed by #141
Milestone

Comments

@sskarkhanis
Copy link

Hello Trevor,

great job with gplearn; really enjoy using it data mining problems.

Would it be possible to extend gplearn to cover binary classification at some point?

pretty please ;)

Thank you!

@jonas-eschle
Copy link

Hi,
I was wondering how this feature is going on? Will it be implemented soon? I would be interested to see feature too
Best,
Mayou

@trevorstephens
Copy link
Owner

Hi @mayou36 ... I have this pegged for the next release which I hope to have out soon.

@trevorstephens trevorstephens added this to the 0.2.0 milestone Oct 18, 2016
@trevorstephens trevorstephens modified the milestones: 0.3.0, 0.2.0 Mar 26, 2017
@trevorstephens
Copy link
Owner

Might push classification back a release at this point, would like to get the bugfixes and new features out there sooner. Will see how we go though!

@rspadim
Copy link

rspadim commented Jun 9, 2017

how logistic regression could be created with gp? just a "fixed" logistic/threshold output function "like" neural networks?

@trevorstephens
Copy link
Owner

This class will be in the next release as a first class citizen of gplearn. In the meantime you could create your own custom fitness measure #20 that takes whatever output of the regression to mean some classification (say y < 0 for 0, and y >= 0 for 1) which would change the regressor to be a classifier ... Though you would need to wrap the output to make sense

@spacegoing
Copy link

@trevorstephens I just found your great repo and would like to try implementing this feature. Would please provide some information like references or where should I start? Many thanks!

@trevorstephens
Copy link
Owner

Hi @spacegoing ... A PR would be most welcome! You could start by referring to A Field Guide To Genetic Programming which has a free download available. The Koza book "Genetic Programming" (no free downloads that I'm aware of) has a few examples of classification and one or two use a positive value of the program to mean a positive example and a negative value to be a negative. I don't think there is much if any literature on deriving a probability for the classification, but you could expose the raw decision function for users to toy with.

So my thoughts on this are to make a new classifier class, and then either add some logic to the BaseSymbolic class for when it's doing classification that maps the output of the program to a binary response (around the same place where it does special things for regressors or transformers) or put some logic in the new classifier class itself... and then add some new fitness functions that measure appropriate metrics, etc. Hope that gets you started.

@spacegoing
Copy link

@trevorstephens Tks for your info! I've read the free book but didn't get much help there. I'll try Koza's book now:D

@spacegoing
Copy link

@trevorstephens There are four versions of "Genetic Programming" . Would you pls tell me explicitly which one you refer to?

@trevorstephens
Copy link
Owner

"Genetic Programming: On the Programming of Computers by Means of Natural Selection", Published 1992, ISBN-10: 0262111705, ISBN-13: 978-0262111706

@trevorstephens
Copy link
Owner

It's a massive tome btw 🤣 ... Oh and implementing the estimator is the easy part. You would need to also add good documentation and an example on how to use it. I can help along the way, but just a heads up that it's not simply code for a new estimator. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants