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

predit with out ind

parent 4606b052
No related branches found
No related tags found
No related merge requests found
Pipeline #4110 passed
......@@ -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.
......
......@@ -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
......
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