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]: Multi-Class Classification #640

Open
SyedUmairHassanKazmi opened this issue Jun 4, 2024 · 4 comments
Open

[Feature]: Multi-Class Classification #640

SyedUmairHassanKazmi opened this issue Jun 4, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@SyedUmairHassanKazmi
Copy link

Feature Request

How can we use this library to get an equation for multiclass classification ?

@SyedUmairHassanKazmi SyedUmairHassanKazmi added the enhancement New feature or request label Jun 4, 2024
@xylhal
Copy link

xylhal commented Jun 6, 2024

I'm also looking into this. Is it possible to define cross entropy as a custom loss function?

@MilesCranmer
Copy link
Owner

Right now the labels have to be scalars, so only binary classification and regression is possible. But I have an intern working with me this summer on adding vector capabilities to PySR so in principle it should be eventually doable.

In principle there's nothing standing in the way of this as the backend allows vectors/tensors/whatever other type you want: https://github.com/SymbolicML/DynamicExpressions.jl?tab=readme-ov-file#tensors. Just need to get it all integrated.

@MilesCranmer
Copy link
Owner

Actually I guess you could get it working as a custom loss function: https://astroautomata.com/PySR/examples/#9-custom-objectives

Maybe you could split a single tree into multiple expressions. And each of those expressions could act as a single logit – then compute the multi-class classification on top!

@xylhal
Copy link

xylhal commented Jun 6, 2024

Right now the labels have to be scalars, so only binary classification and regression is possible. But I have an intern working with me this summer on adding vector capabilities to PySR so in principle it should be eventually doable.

In principle there's nothing standing in the way of this as the backend allows vectors/tensors/whatever other type you want: https://github.com/SymbolicML/DynamicExpressions.jl?tab=readme-ov-file#tensors. Just need to get it all integrated.

Interesting, what do you mean by vector capabilities and how will you envision the outputs to be different? What I had in mind was the output equation mimicking a classification process, where the labels are scalar integers. That probably counter intuitive to the definition of regression, but I'm wondering if generating an equation that ultimately computes an integer is possible? Maybe naively a bunch of indicator functions of each variable? If so, would just using a custom loss function help?

Actually I guess you could get it working as a custom loss function: https://astroautomata.com/PySR/examples/#9-custom-objectives

Maybe you could split a single tree into multiple expressions. And each of those expressions could act as a single logit – then compute the multi-class classification on top!

Still pretty new to this, will take a deeper dive into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants