필터 지우기
필터 지우기

How to select the values greater than the mean in an array?

조회 수: 38 (최근 30일)
phdcomputer Eng
phdcomputer Eng 2019년 9월 15일
편집: madhan ravi 2019년 9월 16일
I want to apply feature selection on a dataset (lung.mat)
After loading the data, I computed the mean of distances between each feature with others by jaccard measure. Then I sorted the distances descendingy in B1. And then I selected forexample 25 number of all the features and saved the matrix in databs1.
I want to select the features that have distances values greater than the mean of the array (B1).
close all;
clc
load lung.mat
data=lung;
[n,m]=size(data);
for i=1:m-1
for j=i+1:m
t1(i,j)=fjaccard(data(:,i),data(:,j));
b1=sum(t1)/(m-1);
end
end
[B1,indB1]=sort(b1,'descend');
databs1=data(:,indB1(1:25));
databs1=[databs1,data(:,m)]; %jaccard
save('databs1.mat');
I’ll be gatefull to have your opinions about how to define this in B1, selecting values of B1 which are greater than the mean of the array B1, It means cutting the rest of smaller values than the mean of B1.
Thank you very much.

채택된 답변

madhan ravi
madhan ravi 2019년 9월 15일
B1(B1>mean(B1(:)))
  댓글 수: 2
phdcomputer Eng
phdcomputer Eng 2019년 9월 15일
Thank you very much
I used this line, after running, B1 still has the full number of features(column) equal to full dataset, for example lung.mat has 57 features and B1 by this line still has 57 columns,
I considered that by this line B1 will be cut to the number of features that are greater than the mean of B1.
I'll be very gratefull to have your valuable opinion.
madhan ravi
madhan ravi 2019년 9월 16일
편집: madhan ravi 2019년 9월 16일
As I understand the solution should give you the values above mean. If that’s what you’re not after then I have difficulty in understanding what you want or what you’re after.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by