How to construct a binary logistic classifier?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!