Using barh to plot top 10 values in Feature Selection

6 ビュー (過去 30 日間)
Nina Perf
Nina Perf 2021 年 9 月 6 日
編集済み: Nina Perf 2021 年 9 月 6 日
Hello,
I did Feature Selection of 700 features.
I want to bar plot only the top 5 (with highest predictor rank).
Can you please help?
Thank you in advance.
[idx,scores] = fscmrmr(t_FeaturesData(:,2:700),t.score);
barh(scores(idx))
xlabel('Predictor rank')
ylabel('Predictor importance score')

採用された回答

Star Strider
Star Strider 2021 年 9 月 6 日
I have no idea what the data are, however the maxk function could do what you want.
.
  2 件のコメント
Nina Perf
Nina Perf 2021 年 9 月 6 日
[idx,scores] = fscmrmr(t_FeaturesData(:,2:700),t.score);
barh(scores(idx))
xlabel('Predictor rank')
ylabel('Predictor importance score')
Thank you so much for the feedback.
Do you know how to use with this? I want to plot a similar barh.
Star Strider
Star Strider 2021 年 9 月 6 日
My pleasure!
I did not see that part of the post earlier.
Looking through the documentation for the fscmrmr funciton (that I have no experience with), it would seem that the 5 most important predictors are given by the first 5 elements of idx, as described in the example in the documentation section Rank Predictors by Importance . That would appear to do exactly what you describe. If it does not, use maxk on the relevant variable, that most likely being ‘score’.
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by