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] Gaussian Process Ordinal Regression (GPOR) #2534

Open
j-adamczyk opened this issue Jun 17, 2024 · 0 comments
Open

[Feature Request] Gaussian Process Ordinal Regression (GPOR) #2534

j-adamczyk opened this issue Jun 17, 2024 · 0 comments

Comments

@j-adamczyk
Copy link

🚀 Feature Request

Support for ordinal regression (ordinal classification).

Motivation

Ordinal regression, or classification with ordered classes, naturally arises for a lot of problems where the target label are discrete preferences. This can be starts (X out of 5), ratings (X of out 10), age (ordered integer) etc. It requires a support for ordinal likelihood model to work.

Pitch

I came upon this problem when trying to reimplement the ordinal regression from GPflow (which fully supports it) to GPyTorch: https://gpflow.github.io/GPflow/develop/notebooks/advanced/ordinal_regression.html. The basic tutorial code is:

GPflow code is very simple:

# construct ordinal likelihood - bin_edges is the same as unique(Y) but centered
bin_edges = np.array(np.arange(np.unique(Y).size + 1), dtype=float)
bin_edges = bin_edges - bin_edges.mean()
likelihood = gpflow.likelihoods.Ordinal(bin_edges)

# build a model with this likelihood
m = gpflow.models.VGP(
    data=(X, Y), kernel=gpflow.kernels.Matern32(), likelihood=likelihood
)

# fit the model
opt = gpflow.optimizers.Scipy()
opt.minimize(m.training_loss, m.trainable_variables, options=dict(maxiter=100))

As far as I can tell, this is currently impossible to reimplement in GPyTorch, as it has no Ordinal likelihood analogue. But this should be really the only addition needed to make this work.

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

No branches or pull requests

1 participant