Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.60 KB | None | 0 0
  1. %Load Data
  2. load fisheriris;
  3. %The variable meas contains measurements on the sepal length, sepal width,
  4. %petal length, and petal width for 150 iris specimens from the
  5. %following three species :
  6. labels = unique(species);
  7. disp(labels);
  8. %Train a Linear Discriminant Analysis (LDA) Classifier
  9. mdl = ClassificationDiscriminant.fit(meas,species);
  10. %Predict Species Using the LDA Model
  11. predicted_species = predict(mdl,meas);
  12. %Compute and Visualize the Confusion Matrix
  13. Conf_Mat = confusionmat(species,predicted_species);
  14. disp(Conf_Mat);
  15. %We can visualize the same using a heat map.
  16. h = heatmap(Conf_Mat);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement