Untitled
unknown
python
3 years ago
316 B
7
Indexable
labels = gmm.predict_proba(X_sample)
def conf_mat_from_prob(y_prob_a,y_true):
k = len(y_prob_a[0])
prob_df = pd.DataFrame(y_prob_a)
prob_df['y'] = y_true
conf_matrix = prob_df.groupby(by='y').sum() # pred vs true
return conf_matrix.T.values
conf_mat = conf_mat_from_prob(labels, y_test)
conf_matEditor is loading...