How to solve a task within Machine Learning Onramp Course?
Afficher commentaires plus anciens
Hello everyone
I hope to get help regarding the following inquiry:
I am doing the Machine Learning Onramp Course. Currently I am in the section: Engineering Features Automate Feature Extraction (Create a Feature Extraction Function).
I am following the next instruction to complete the task:
load sampleletters.mat
letter = b1;
aratio = range(letter.Y)/range(letter.X)
idxmin = islocalmin(letter.X,"MinProminence",0.1);
numXmin = nnz(idxmin)
idxmax = islocalmax(letter.Y,"MinProminence",0.1);
numYmax = nnz(idxmax)
dT = diff(letter.Time);
dXdT = diff(letter.X)./dT;
dYdT = diff(letter.Y)./dT;
avgdX = mean(dXdT,"omitnan")
avgdY = mean(dYdT,"omitnan")
corrXY = corr(letter.X,letter.Y,"rows","complete")
featurenames = ["AspectRatio","NumMinX","NumMaxY","AvgU","AvgV","CorrXY"];
Task 1
Make a table from the features stored in the variables aratio, numXmin, numYmax, avgdX, avgdY, and corrXY by using the table function. Store the result in a variable named feat.
feat = table(aratio,numXmin,numYmax,avgdX,avgdY,corrXY,'VariableNames',featurenames)
Task 2
Recreate the table of features feat, but with the table variable names from the array featurenames.
feat = table(aratio,numXmin,numYmax,avgdX,avgdY,corrXY,'VariableNames',featurenames)
Task 3
At the end of the script, add a local function named extract that takes a single variable, letter, as input and returns a table of features, feat, as output. Copy the code from the beginning of the script, from after letter = b1 to Task 1, and from Task 2 to make the body of the function. Test your function by calling it with b2 as input. Store the result in a variable named featB2.
featB2 = extract(b2)
I got the error
Not enough input arguments.
I will really appreciate your cooperation.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!