пятница, 16 августа 2019 г.

Logistic regression in matlab - Stack Overflow

Logistic question and answer. i would like to implement logistic regression in matlab, i have following few code for this. logistic regression is following : first we are calculating logit which is equal to. then we are calculating probability which is equal to p=e^L/(1+e^L) and finally we are calculating. i decided to write all those stuff in one line, but when i am running code , it gives me following error. how can i fix this problem? thanks in advance. In order to implement a logistic regression model, I usually call the glmfit function, which is the simpler way to go. The syntax is: b is a vector that contains the coefficients for the linear portion of the logistic regression (the first element is the constant term alpha of the regression). x contains the predictors data, with one row for each observation and one column for each variable. y contains the target variable, usually a vector of boolean (0 or 1) values representing the outcome. Once you obtain the coefficients, you have to apply the linear part of the regression to your predictors: To finish, you must apply the logistic function to the output of the linear part: If you need more tinkering on your data or on your output, and you require more flexibility and control over your model, I suggest you to look at this implementation:

Комментариев нет:

Отправить комментарий