Created
July 18, 2016 10:44
-
-
Save agamemnonc/4c9ddb472cd7c3ac84718cee1d2f6ce6 to your computer and use it in GitHub Desktop.
Comparison of predicted probability for LDA classifier with MATLAB and sklearn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
load iris_dataset.mat % Load iris dataset (same order as in sklearn) | |
X = irisInputs'; | |
[~, y] = max(irisTargets); y = y'; % Transform target | |
lda_clf = fitcdiscr(X,y,'DiscrimType','linear'); % Classifier | |
[~,post_probs] = predict(lda_clf,X); % Predicted probability for training data | |
disp(post_probs(52,:)) % Display predicted probability for datum 52 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment