Skip to content
Snippets Groups Projects
Commit cc9a556e authored by Dominique Benielli's avatar Dominique Benielli
Browse files

Update plot_usecase_exampleMumBo.py

parent baa3932e
No related branches found
No related tags found
No related merge requests found
Pipeline #4181 passed
......@@ -11,7 +11,7 @@ multi class digit from sklearn, multivue
- vue 2 gradiant of image in second direction
"""
from __future__ import absolute_import
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
......@@ -22,7 +22,29 @@ from multimodal.datasets.data_sample import MultiModalArray
from multimodal.boosting.mumbo import MumboClassifier
from usecase_function import plot_subplot
import numpy as np
import matplotlib.pyplot as plt
import matplotlib._color_data as mcd
def plot_subplot(X, Y, Y_pred, vue, subplot, title):
cn = mcd.CSS4_COLORS
classes = np.unique(Y)
n_classes = len(np.unique(Y))
axs = plt.subplot(subplot[0],subplot[1],subplot[2])
axs.set_title(title)
#plt.scatter(X._extract_view(vue), X._extract_view(vue), s=40, c='gray',
# edgecolors=(0, 0, 0))
for index, k in zip(range(n_classes), cn.keys()):
Y_class, = np.where(Y==classes[index])
Y_class_pred = np.intersect1d(np.where(Y_pred==classes[index])[0], np.where(Y_pred==Y)[0])
plt.scatter(X._extract_view(vue)[Y_class],
X._extract_view(vue)[Y_class],
s=40, c=cn[k], edgecolors='blue', linewidths=2, label="class real class: "+str(index)) #
plt.scatter(X._extract_view(vue)[Y_class_pred],
X._extract_view(vue)[Y_class_pred],
s=160, edgecolors='orange', linewidths=2, label="class prediction: "+str(index))
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment