Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scikit-multimodallearn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dev
scikit-multimodallearn
Commits
cc9a556e
Commit
cc9a556e
authored
5 years ago
by
Dominique Benielli
Browse files
Options
Downloads
Patches
Plain Diff
Update plot_usecase_exampleMumBo.py
parent
baa3932e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4181
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/usecase/plot_usecase_exampleMumBo.py
+24
-2
24 additions, 2 deletions
examples/usecase/plot_usecase_exampleMumBo.py
with
24 additions
and
2 deletions
examples/usecase/plot_usecase_exampleMumBo.py
+
24
−
2
View file @
cc9a556e
...
@@ -11,7 +11,7 @@ multi class digit from sklearn, multivue
...
@@ -11,7 +11,7 @@ multi class digit from sklearn, multivue
- vue 2 gradiant of image in second direction
- vue 2 gradiant of image in second direction
"""
"""
from
__future__
import
absolute_import
import
numpy
as
np
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
from
sklearn.model_selection
import
train_test_split
from
sklearn.model_selection
import
train_test_split
...
@@ -22,7 +22,29 @@ from multimodal.datasets.data_sample import MultiModalArray
...
@@ -22,7 +22,29 @@ from multimodal.datasets.data_sample import MultiModalArray
from
multimodal.boosting.mumbo
import
MumboClassifier
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__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment