Entropy

バージョン 1.0.0.0 (1.28 KB) 作成者: Chun Zheng
Helps find the optimal decision tree
ダウンロード: 3.4K
更新 2007/5/16

ライセンスがありません

Chun Zheng

Entropy is used to help create an optimized decision tree. I created an entropy function called getBestEnt so that given the information it has received, it will return the highest information gain and the index of the best feature to use for the decision tree.

Here's an example:
hair=[1 1 2 3 2 2 2 1];
entropyF(class,hair)
ans =
0.5000
eyes=[1 1 1 1 2 1 2 2];
entropyF(class,eyes)
ans =
0.6068
height=[1 2 1 1 1 2 2 1];
entropyF(class,height)
ans =
0.9512
entropy(class)
ans =
0.9544
allFeat=[eyes hair height];
[big ind]=getBestEnt(class, allFeat)
big =
0.9544
ind

1
note: big stands for best information gain
The ind determines the 1nd feature(eyes) as the best feature

引用

Chun Zheng (2024). Entropy (https://www.mathworks.com/matlabcentral/fileexchange/14996-entropy), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R14
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0