Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Load Data
- load fisheriris;
- %The variable meas contains measurements on the sepal length, sepal width,
- %petal length, and petal width for 150 iris specimens from the
- %following three species :
- labels = unique(species);
- disp(labels);
- %Train a Linear Discriminant Analysis (LDA) Classifier
- mdl = ClassificationDiscriminant.fit(meas,species);
- %Predict Species Using the LDA Model
- predicted_species = predict(mdl,meas);
- %Compute and Visualize the Confusion Matrix
- Conf_Mat = confusionmat(species,predicted_species);
- disp(Conf_Mat);
- %We can visualize the same using a heat map.
- h = heatmap(Conf_Mat);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement