(self, X)
return pred
r"""Predict the probability of being 1 for each label.

        Parameters
        ----------
        X : array-like, shape=(n_samples, n_features)
            Feature vector.

        Returns
        -------
        pred : numpy array, shape=(n_samples, n_labels)
            Predicted probability of each label.
r"""Predict the probability of being 1 for each label.
r Predict the probability of being 1 for each label .
def predict_real(self, X):
        r"""Predict the probability of being 1 for each label.

        Parameters
        ----------
        X : array-like, shape=(n_samples, n_features)
            Feature vector.

        Returns
        -------
        pred : numpy array, shape=(n_samples, n_labels)
            Predicted probability of each label.
        """
        X = np.asarray(X)
        if self.clfs_ is None:
            raise ValueError("Train before prediction")
        if X.shape[1] != self.n_features_:
            raise ValueError('given feature size does not match')

        pred = np.zeros((X.shape[0], self.n_labels_))
        for i in range(self.n_labels_):
            if isinstance(self.clfs_[i], DummyClf):
                pred[:, i] = self.clfs_[i].predict_real(X)[:, 1]
            elif isinstance(self.clfs_[i], SVC):
                value = self.clfs_[i].decision_function(X)
                if len(np.shape(value)) == 1:  # n_classes == 2
                    pred_value = np.vstack((-value, value)).T
                    pred[:, i] = pred_value[:, 1]
                else:
                    pred[:, i] = value[:, 1]
            elif isinstance(self.clfs_[i], LogisticRegression):
                value = self.clfs_[i].decision_function(X)
                if len(np.shape(value)) == 1:  # n_classes == 2
                    pred_value = np.vstack((-value, value)).T
                    pred[:, i] = pred_value[:, 1]
                else:
                    pred[:, i] = value[:, 1]
            # pred[:, i] = self.clfs_[i].predict_real(X)[:, 1]
        return pred
def predict_real ( self , X ) : X = np . asarray ( X ) if self . clfs_ is None : raise ValueError ( "Train before prediction" ) if X . shape [ 1 ] != self . n_features_ : raise ValueError ( 'given feature size does not match' ) pred = np . zeros ( ( X . shape [ 0 ] , self . n_labels_ ) ) for i in range ( self . n_labels_ ) : if isinstance ( self . clfs_ [ i ] , DummyClf ) : pred [ : , i ] = self . clfs_ [ i ] . predict_real ( X ) [ : , 1 ] elif isinstance ( self . clfs_ [ i ] , SVC ) : value = self . clfs_ [ i ] . decision_function ( X ) if len ( np . shape ( value ) ) == 1 : # n_classes == 2 pred_value = np . vstack ( ( - value , value ) ) . T pred [ : , i ] = pred_value [ : , 1 ] else : pred [ : , i ] = value [ : , 1 ] elif isinstance ( self . clfs_ [ i ] , LogisticRegression ) : value = self . clfs_ [ i ] . decision_function ( X ) if len ( np . shape ( value ) ) == 1 : # n_classes == 2 pred_value = np . vstack ( ( - value , value ) ) . T pred [ : , i ] = pred_value [ : , 1 ] else : pred [ : , i ] = value [ : , 1 ] # pred[:, i] = self.clfs_[i].predict_real(X)[:, 1] return pred