Calculate the entropy of a special value in one column

I exactly wanted to know that how I can caculate the entropy of different values in a column
For example assume I have two columns
1.Water pipe type (CICL,DICL) and
2.the class type (y=0:fail,Y=1 non-fail)
I want to know how I can caculate the entropy of for example CICL pipelines based on their class type.
Actually the main set would be for example CICL data by y=0 and y=1 something like R={CICL1 ,CICL2}
How can I calculate the entropy of each of value of a column regards to the value of another column
Regards

답변 (1개)

Youssef  Khmou
Youssef Khmou 2013년 4월 11일
hi, try :
R=randn(100,2); % two columns
e1=entropy(R(:,1)); % CICL
e2=entropy(R(:,2)); % DICL

댓글 수: 2

Thanks for your answer
But CICL and DICL are two value of one column not two different columns and each of these values are belong to a class which is identified in another column.I want to calculate the entropy of each one related to their class
for example if we have 20 CICL.4 of them belong to class 1 and 16 of them belong to class 2.sort of changing the CICL as a new column with valuse of 1 and 2
hi, ok try to delimit the vector:
e1= entropy(CICL(1:4));
e2=entropy(CICL(5:end));
fine?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

질문:

2013년 4월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by