Last active
August 11, 2018 10:53
-
-
Save agamemnonc/0d668ae2552188b73958be7961a7e9e3 to your computer and use it in GitHub Desktop.
Comparison of predicted probability for LDA classifier with MATLAB and sklearn Raw
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
import numpy as np | |
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis | |
from sklearn import datasets | |
iris = datasets.load_iris() | |
X = iris.data | |
y = iris.target | |
lda_clf = LinearDiscriminantAnalysis(solver = 'lsqr').fit(X,y) | |
post_probs = lda_clf.predict_proba(X) | |
print(post_probs[51]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment