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
1133a020
Commit
1133a020
authored
5 years ago
by
Dominique Benielli
Browse files
Options
Downloads
Patches
Plain Diff
predit with out ind
parent
4606b052
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4110
passed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
multimodal/kernels/lpMKL.py
+11
-3
11 additions, 3 deletions
multimodal/kernels/lpMKL.py
multimodal/kernels/mvml.py
+4
-7
4 additions, 7 deletions
multimodal/kernels/mvml.py
with
15 additions
and
10 deletions
multimodal/kernels/lpMKL.py
+
11
−
3
View file @
1133a020
...
...
@@ -237,7 +237,7 @@ class MKL(BaseEstimator, ClassifierMixin, MKernel):
return
C
,
weights
def
predict
(
self
,
X
,
views_ind
=
None
):
def
predict
(
self
,
X
):
"""
Parameters
...
...
@@ -271,7 +271,7 @@ class MKL(BaseEstimator, ClassifierMixin, MKernel):
"""
check_is_fitted
(
self
,
[
'
X_
'
,
'
C
'
,
'
K_
'
,
'
y_
'
,
'
weights
'
])
X
,
test_kernels
=
self
.
_global_kernel_transform
(
X
,
views_ind
=
views_ind
,
views_ind
=
self
.
X_
.
views_ind
,
Y
=
self
.
X_
)
check_array
(
X
)
C
=
self
.
C
...
...
@@ -322,7 +322,15 @@ class MKL(BaseEstimator, ClassifierMixin, MKernel):
Parameters
----------
X : {array-like} of shape = (n_samples, n_features)
X : dict dictionary with all views {array like} with shape = (n_samples, n_features) for multi-view
for each view.
or
`MultiModalData` , `MultiModalArray`
or
{array-like,}, shape = (n_samples, n_features)
Training multi-view input samples. can be also Kernel where attibute
'
kernel
'
is set to precompute
"
precomputed
"
y : array-like, shape = (n_samples,)
True labels for X.
...
...
This diff is collapsed.
Click to expand it.
multimodal/kernels/mvml.py
+
4
−
7
View file @
1133a020
...
...
@@ -410,7 +410,7 @@ class MVML(MKernel, BaseEstimator, ClassifierMixin):
A_inv
=
spli
.
pinv
(
A
)
return
A_inv
def
predict
(
self
,
X
,
views_ind
=
None
):
def
predict
(
self
,
X
):
"""
Parameters
...
...
@@ -444,7 +444,7 @@ class MVML(MKernel, BaseEstimator, ClassifierMixin):
"""
check_is_fitted
(
self
,
[
'
X_
'
,
'
U_dict
'
,
'
K_
'
,
'
y_
'
])
# , 'U_dict', 'K_' 'y_'
X
,
test_kernels
=
self
.
_global_kernel_transform
(
X
,
views_ind
=
views_ind
,
views_ind
=
self
.
X_
.
views_ind
,
Y
=
self
.
X_
)
check_array
(
X
)
...
...
@@ -454,12 +454,9 @@ class MVML(MKernel, BaseEstimator, ClassifierMixin):
else
:
pred
=
np
.
sign
(
pred
)
pred
=
pred
.
astype
(
int
)
pred
=
np
.
where
(
pred
==
-
1
,
0
,
pred
)
pred
=
np
.
where
(
pred
==
-
1
,
0
,
pred
)
return
np
.
take
(
self
.
classes_
,
pred
)
def
_predict_mvml
(
self
,
test_kernels
,
g
,
w
):
"""
...
...
@@ -599,7 +596,7 @@ class MVML(MKernel, BaseEstimator, ClassifierMixin):
return
A_new
def
score
(
self
,
X
,
y
):
def
score
(
self
,
X
,
y
=
None
):
"""
Return the mean accuracy on the given test data and labels.
Parameters
...
...
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