How to feed a feature matrix for each class in multiclass classification?

조회 수: 2 (최근 30일)
NASRIN AKTER
NASRIN AKTER 2021년 10월 13일
답변: Prince Kumar 2022년 1월 21일
Hello
I am using 'emd' for feature extraction. In my case, I will create 5 IMFs and extract 2 features from each so it would be a 5x2 matrix for each class label. How do I feed that to a multiclass classifier?

답변 (1개)

Prince Kumar
Prince Kumar 2022년 1월 21일
Hi,
You can feed the input matrix like you do it binary classifier or any classifier.
Please refer the following code for better understanding:
load fisheriris
Mdl = fitctree(meas,species)
Mdl =
ClassificationTree ResponseName: 'Y' CategoricalPredictors: [] ClassNames: {'setosa' 'versicolor' 'virginica'} ScoreTransform: 'none' NumObservations: 150 Properties, Methods
After you load the fisheriris dataset, you get meas (150x4) as input matrix and species(150x1) as target array.
Now you simply call "fitctree" to train a multiclass decision tree.
You can now use "predict" function to do the classification on the trained classifier.
X = [4.85,3.4,1.3,0.22];
label = predict(Mdl,X)
label = 1×1 cell array
{'setosa'}
Hope this helps!

카테고리

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