필터 지우기
필터 지우기

How to evaluate a logistic regression classifier?

조회 수: 1 (최근 30일)
Aaronne
Aaronne 2013년 3월 22일
Hi Smart Guys,
I wrote following codes to construct a logistic regression classifier. Essentially, it uses the Matlab GeneralizedLinearModel class.
load fisheriris;
features = meas(1:100,1:3);
featureSelcted = features(1:100,1:3);
numFeatures = 100;
%%Define ground truth
groundTruthGroup = species(1:100);
groundTruthLogicalLable = (1:numFeatures)'<50;
LOGClassifierObject = GeneralizedLinearModel.fit(featureSelcted, groundTruthLogicalLable, ...
'linear', 'Distribution', 'binomial', 'link', 'logit');
[LOGLabel, LOGScore] = predict(LOGClassifierObject, featureSelcted);
[FPR, TPR, Thr, AUC, OPTROCPT] = perfcurve(groundTruthGroup(:,1), LOGScore(:,1), 'setosa');
However, I'm stuck with the problem of evaluate this logistic regression based classifier. For example,
1. As it is not LOGClassifierObject is not an object of 'ClassificationDiscriminant', it has no function to get resubstitution error directly. 'classperf' function seems not applicable as well.
2. Also for a normal cross-validation, I haven't figured out how to do it. I am not sure how to connect 'crossval' function with the results of the object of GeneralizedLinearModel class, ie, LOGClassifierObject.
3. Or could anyone recommend a third party library coded in Matlab can perform the right task.
Any ideas please direct me. Thanks very much.
A.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification Trees에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by