(self, X, threshold=None)
return X[:, safe_mask(X, mask)]
Reduce X to the selected features.

        Parameters
        ----------
        X : array of shape [n_samples, n_features]
            The input samples.

        threshold: float.
            Threshold defining the minimum cutoff value for the
            stability scores.

        Returns
        -------
        X_r : array of shape [n_samples, n_selected_features]
            The input samples with only the selected features.
Reduce X to the selected features.
Reduce X to the selected features .
def transform(self, X, threshold=None):
        """Reduce X to the selected features.

        Parameters
        ----------
        X : array of shape [n_samples, n_features]
            The input samples.

        threshold: float.
            Threshold defining the minimum cutoff value for the
            stability scores.

        Returns
        -------
        X_r : array of shape [n_samples, n_selected_features]
            The input samples with only the selected features.
        """
        X = check_array(X, accept_sparse='csr')
        mask = self.get_support(threshold=threshold)

        check_is_fitted(self, 'stability_scores_')

        if len(mask) != X.shape[1]:
            raise ValueError("X has a different shape than during fitting.")

        if not mask.any():
            warn("No features were selected: either the data is"
                 " too noisy or the selection test too strict.",
                 UserWarning)
            return np.empty(0).reshape((X.shape[0], 0))

        return X[:, safe_mask(X, mask)]
def transform ( self , X , threshold = None ) : X = check_array ( X , accept_sparse = 'csr' ) mask = self . get_support ( threshold = threshold ) check_is_fitted ( self , 'stability_scores_' ) if len ( mask ) != X . shape [ 1 ] : raise ValueError ( "X has a different shape than during fitting." ) if not mask . any ( ) : warn ( "No features were selected: either the data is" " too noisy or the selection test too strict." , UserWarning ) return np . empty ( 0 ) . reshape ( ( X . shape [ 0 ] , 0 ) ) return X [ : , safe_mask ( X , mask ) ]