hello may I ask how to perform backward feature selection from matlab

조회 수: 2 (최근 30일)
Muhd
Muhd 2023년 6월 5일
편집: Swaraj 2023년 6월 26일
my dataset is basically on the statistical features i.e mean, median etc from a vibration signal and I only got 4 observation that I made which are the fault diameter
Diameter = [0.007 0.014 0.021 0.028]
and my target variables for features selection are
Data = [0.033019 0.243439 0.059263 0.245666 1.139656 -0.20858 0.326542 4.639047 19.23064 7.440109 34.51501;0.032947 0.116438 0.013558 0.121009 0.69156 -0.01656 0.808631 5.714945 51.00824 3.672869 20.99024;0.031289 0.227709 0.051851 0.229847 1.137602 -0.00279 0.538198 4.949382 21.93974 7.346022 36.35857;0.007701 0.838364 0.702854 0.838396 4.785144 0.10306 0.396814 5.7075 6.808162 108.868 621.3644]
therefore what i want to do is to determine which features is the best for my observation which what statistical features gives the best indication

답변 (1개)

Swaraj
Swaraj 2023년 6월 26일
편집: Swaraj 2023년 6월 26일
Hi Muhd,
I understand that you want to perform backard feature selection in MATLAB.
To perform the backward feature selection, you can make use of “sequentialfs” function.
You can go through the below example from the documentation.
rng("default") % For reproducibility
opts = statset("Display","iter");
tf = sequentialfs(@myfun,ingredients,heat, ...
"Direction","backward","Options",opts);
Helper function:
function criterion = myfun(XTrain,yTrain,XTest,yTest)
mdl = fitrlinear(XTrain,yTrain);
predictedYTest = predict(mdl,XTest);
e = yTest - predictedYTest;
criterion = e'*e;
end
Hope it Helps!!

카테고리

Help CenterFile Exchange에서 Design Condition Indicators Interactively에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by