File Exchange

image thumbnail

Logistic Regression for Classification

version (6.3 KB) by Mo Chen
Logistic regression for both binary and multiclass classification


Updated 08 Mar 2016

View License

This package provides logistic regression functions for both binary and multiclass classification problems.
This package is now a part of the PRML toolbox (

Cite As

Mo Chen (2021). Logistic Regression for Classification (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

Renwick Beattie

Same error mentioned below, simple to fix (input t was not in correct orientation) - this should have been captured by input parsing at the start of the function. No NaN handling. No computation of standard errors, probabilities calculated do not match reality.

Arshia Sehgal

Ran Sun

Kathryn Hollowood

I'm having the same problem as Quoc Pham and Muhammad Tariq Sadiq. Any advice on this?

Leah Shi

Quoc Pham

I got the same problem like Muhammad Tariq Sadiq, please advise!

Muhammad Tariq Sadiq

Dear Sir, I am using following commands of your MATLAB codes

ytest = logitBinPred(model,features);

where features have length of 72*10 double and y have 72*1 double and representing class label.

When i execute the above code, I got following error

Error using -
Matrix dimensions must agree.

Error in logitBin (line 32)
g = X*(y-t)'+lambda.*w; % 4.96

Kindly suggest me how to remove it

rolan worse

t: 1 x n label (1~k)????

Jorrit Montijn

Great work! This saved me several hours, writing the code from Bishop myself.


MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!