How to construct a binary logistic classifier?

3 ビュー (過去 30 日間)
Stef
Stef 2018 年 7 月 24 日
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 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by