How can I train data in Classification Learner App by using function

Hello
I want to train different data sets with the Classification Learner function.
Say i have the lables : [ 1,2,3,4,5] in the first data set and in the other data set : [6,7,8,9,10].
I want to create a generated function to include the proper lables.
When i use the generated function from the first Train ( lables [1,2,3,4,5]) i notice that the possible lables in the generated function are obviously [1,2,3,4,5].
I want to know if there is a way to create a function that use Classification Learner APP - weighted KNN that recive data sets + lables as an input and train by the proper lables giving a trained Model as an ouput.

Respuestas (1)

Itamar Malageac
Itamar Malageac el 4 de Abr. de 2022
Editada: Itamar Malageac el 4 de Abr. de 2022
I want to use a function that does exactly what the app does. Because I want it to be automatically:
1.Create a data set
2.Create labels
3.Train them with a function like : Model=TRAIN_WeightedKNN_fromApp(dataSet,labels)
4. Use the model from (3) on a different dataSet to predict the labels like: NewLabels=Model_predict(New_dataSet)
So I wouldn’t have to enter the APP manually and choose the dataSet and labels from the workspace or the classification type.

Preguntada:

el 4 de Abr. de 2022

Editada:

el 4 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by