How to construct a binary logistic classifier?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!