モデルの評価の仕方について
4 views (last 30 days)
Show older comments
順序ロジステックモデルを作成し、p値は出るのですが、他の評価方法(自由度調整済み決定係数やAIC)でもモデルの評価を行いたいと考えています。
しかし現段階では他の評価方法ではエラー文が出ます。
ソースコードは以下の通りです。
load imports-85
Y = X(:,15)
X(:,15) = []
mdl = fscnca(X,Y);
figure()
plot(mdl.FeatureWeights,'ro')
grid on
xlabel('Feature index')
ylabel('Feature weight')
% (ここで特徴選択を行う)
X14 = X(:,14)
X25 = X(:,25)
X16 = X(:,16)
X13 = X(:,13)
X12 = X(:,12)
% (特徴選択により選ばれた因子)
Xnew = [ones(size(X14)) X14 X25 X16 X13 X12];
Xnew(:,1)=[];
Ynew = ordinal(Y,{'1','2','3','4'},[],[19,29,39,49,59]);
[B,dev,stats] = mnrfit(Xnew,Ynew,'model','ordinal');
B
[B(1:3)'; repmat(B(4:end),1,3)]
stats.p
その他、不足している情報がございましたらお知らせください。
よろしくお願いいたします。
0 Comments
Answers (0)
See Also
Categories
Find more on 次元削減と特徴抽出 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!