필터 지우기
필터 지우기

How do I confront the outliers from two different methods?

조회 수: 2 (최근 30일)
HelpAStudent
HelpAStudent 2022년 5월 17일
댓글: Mathieu NOE 2022년 5월 17일
Hi! I have used two different methods to remove outliers from a certain data set. Here they are below:
%Grubb's test
figure;
plot(Fetal_table.mean_value_of_short_term_variability) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(Fetal_table.mean_value_of_short_term_variability)
figure;
vec_out = isoutlier(Fetal_table.mean_value_of_short_term_variability,"grubbs");
figure;
plot(Fetal_table.mean_value_of_short_term_variability, "og"); hold on;
Fetal_table(vec_out,:)=[];
%Box plot rule
figure;
plot(Fetal_table.mean_value_of_short_term_variability) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(Fetal_table.mean_value_of_short_term_variability)
figure;
vec_out = isoutlier(Fetal_table.mean_value_of_short_term_variability,"quartile");
figure;
plot(Fetal_table.mean_value_of_short_term_variability, "og"); hold on;
Fetal_table(vec_out,:)=[];
How can I compare if the same outliers have been removed and if different ones have been removed, understand which ones and understand which method is the most effective?
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 5월 17일
hello
what do you mean by "compare" ? want just to plot the selected outliers ? visual check or more advanced computations ? below I simply overlay the data and the outliers - we could also make one single plot with both sets of outliers
also the variable name is quite long and make the code less readable as you repeat it quite often , why not make it simpler like :
data = Fetal_table.mean_value_of_short_term_variability;
%Grubb's test
figure;
plot(data) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(data)
figure;
vec_out = isoutlier(data,"grubbs");
data_out = Fetal_table(vec_out,:);
figure;
plot(data, "og"); hold on; plot(data_out, "or");
% data_out=[]; % optional
%Box plot rule
figure;
plot(data) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(data)
figure;
vec_out = isoutlier(data,"quartile");
data_out = Fetal_table(vec_out,:);
figure;
plot(data, "og"); hold on; plot(data_out, "ok");
% data_out=[]; % optional

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by