本文整理汇总了Python中sklearn.preprocessing.StandardScaler.set_params方法的典型用法代码示例。如果您正苦于以下问题:Python StandardScaler.set_params方法的具体用法?Python StandardScaler.set_params怎么用?Python StandardScaler.set_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.preprocessing.StandardScaler
的用法示例。
在下文中一共展示了StandardScaler.set_params方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StandardScalerComponent
# 需要导入模块: from sklearn.preprocessing import StandardScaler [as 别名]
# 或者: from sklearn.preprocessing.StandardScaler import set_params [as 别名]
class StandardScalerComponent(Rescaling, AutoSklearnPreprocessingAlgorithm):
def __init__(self, random_state):
from sklearn.preprocessing import StandardScaler
self.preprocessor = StandardScaler(copy=False)
@staticmethod
def get_properties(dataset_properties=None):
return {'shortname': 'StandardScaler',
'name': 'StandardScaler',
'handles_missing_values': False,
'handles_nominal_values': False,
'handles_numerical_features': True,
'prefers_data_scaled': False,
'prefers_data_normalized': False,
'handles_regression': True,
'handles_classification': True,
'handles_multiclass': True,
'handles_multilabel': True,
'is_deterministic': True,
# TODO find out of this is right!
'handles_sparse': True,
'handles_dense': True,
'input': (SPARSE, DENSE, UNSIGNED_DATA),
'output': (INPUT,),
'preferred_dtype': None}
def fit(self, X, y=None):
if sparse.isspmatrix(X):
self.preprocessor.set_params(with_mean=False)
return super(StandardScalerComponent, self).fit(X, y)