Skip to content

There's a problem with my program. #7

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

Open
shenao1994 opened this issue Sep 2, 2020 · 3 comments
Open

There's a problem with my program. #7

shenao1994 opened this issue Sep 2, 2020 · 3 comments

Comments

@shenao1994
Copy link

RuntimeError: The size of tensor a (5) must match the size of tensor b (6) at non-singleton dimension 1
I'm working on a six classification task[0, 1, 2, 3, 4, 5].I found that cutpoints = num_ class - 1 in the code。 But in this way, the dimensions of cutpoints and X are not equal. I've seen your example, but I still don't know how to solve it.
thank you!

@EthanRosenthal
Copy link
Owner

I don't really have enough information to help you debug this. All I can say is that there should be one fewer cutpoint than the number of classes that you're predicting. In your case, you have 6 classes, and you should have 5 cutpoints.

@jlevy44
Copy link

jlevy44 commented Nov 8, 2021

@gattia
Copy link

gattia commented Sep 21, 2023

For those that stumble upon this, the error is because your model that you are passing into OrdinalLogisticModel outputs n_classes values - it should output a single scalar value.

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

No branches or pull requests

4 participants