Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_relevant_features(X):
"""
Returns a binary mask specifying the continuous features to operate on.
Args:
X (pd.DataFrame): array-like, shape [n_samples, n_features] The data used to compute the mean and standard
deviation used for later scaling along the features axis (axis=0).
Returns:
pd.Index: a pd.Index with name of columns specifying which features to apply the transformation on.
"""
# FIXME utilize sklearn.utils.multiclass.type_of_target()
continuous_cols = X.columns[~which_columns_are_binary(X)]
return continuous_cols
def _get_relevant_features(self, X):
"""
Returns a binary mask specifying the features to operate on (either all features or binary features if
self.only_binary_features is True.
Args:
X (pd.DataFrame): array-like, shape [n_samples, n_features] The data used to compute the mean and standard
deviation used for later scaling along the features axis (axis=0).
Returns:
pd.Index: a binary mask specifying which features to apply the transformation on.
"""
if self.only_binary_features:
feature_mask = which_columns_are_binary(X)
else:
feature_mask = np.ones(X.shape[1], dtype=bool)
return feature_mask