obtain probability prediction for binary logistic regression

조회 수: 1 (최근 30일)
Tim Dong
Tim Dong 2021년 8월 23일
댓글: Ive J 2021년 9월 5일
I am trying to obtain probability predictions for a binary logistic regression model. However, I am getting output only as 0 or 1s.
The spec says:
For a binomial model, the meaning of the output values in ypred depends on the value of the 'BinomialSize' name-value pair argument.
If 'BinomialSize' is 1 (default), then each value in the output ypred is the probability of success.
If 'BinomialSize' is not 1, then each value in the output ypred is the predicted number of successes in the trials.
But this does not appear to be the case.
I need the input to be such that fit( X, y) with X (Y_init) being the features, and y (X) being the class vector. Here are my initial code:
mdl = fitglm(Y_init,X,'Distribution','binomial');
predictProb = predict(mdl, Y_init(500:544,:);
  댓글 수: 5
Tim Dong
Tim Dong 2021년 8월 25일
@the cyclist, I have 544 rows in the entire dataset. Thanks for the suggestion, I can now see that these are indeed predicting probabilities. I am expecting to reduce the number of predictor columns to a lower number of ~10 though.
Ive J
Ive J 2021년 9월 5일
On a different note, your independent variables are highly correlated, you should be extra cautious for multicollinearity.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by