You can predict the the class of individual datapoints.
The important point to remember here is to keep in mind the way you pass the new datapoint to the model for prediction. Again as mentioned in the documentation link, the new sent of poinst should have same feature names, datatypes and also need to be passed in the same format as it was passed during training the model.
For example, if the dataset is loaded for a CSV file and imported into a table for traning the model, then individual datapoints are also to be put into table and passed in the same format. Below is an example of iris data and how it can be done using table to show predictions for individual datapoint:
sepallength = [5.1];
sepalwidth = [3.5];
petallength = [1.4];
petalwidth = [0.2];
T = table(sepallength,sepalwidth,petallength,petalwidth);
prediction = trainedModel.predictFcn(T);
You can also loop through the dataset and pass individual datapoints for prediction as per the required format for the model.
I hope this works for you.
0 Comments
Sign in to comment.