How to construct a binary logistic classifier?

3 views (last 30 days)
Stef
Stef on 24 Jul 2018
I have a matrix X containing features and a vector y containing the labels. How can I perform logistic regression and compute the accuracy of the regression as well as Type 1 and Type 2 errors? Furthermore, I want to have 5% of each category which are classified with the highest score.
X_train = [1 2 3; 4 5 6; 3 5 7];
y_train = [0 0 1];
X_test = [6 8 2; 6 3 4; 5 7 1];
y_test = [1 0 1];
[b,dev,stats] = glmfit(X_train, y_train,'binomial','logit');
But this does not work because of the dimension of y_train. And the evaluation of the classifier is missing as well. Can anybody help me please?

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!