How to use logistic regression toolbox

8 次查看(过去 30 天)
lech king
lech king 2020-11-1
回答: Anay 2025-8-28,7:37
Hello
I thought there was a toolbox logistic regression in MATLAB, but I was confused and could not find it.
In a simple example, I wanted to enter the score of 100 students in two different subjects and determine if this student was rejected or not.
And the system can determine whether or not student 101 has been rejected
Is there a toolbox for this? Or coding should be done
Thanks for your guidance

回答(1 个)

Anay
Anay 2025-8-28,7:37
Hi lech,
I understand that you want to train a binary classifier using logistic regression.
You can find the “fitclinear” method in the “Machine Learning and Statistics Toolbox”. You can train a logistic regression model using your data by specifying the “Learner” parameter as “logistic”.
Mdl = fitclinear(X,Y,'Learner','logistic');
Make use of the “predict” method:
ypred = predict(Mdl,Xnew);
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by