导航

class sklearn.base.BaseEstimator:为所有的estimators提供基类

方法:

__init__() 初始化方法
get_params(deep=True)

获取这个估计器的参数

Parameters:

deep : boolean, optional

True,将返回该estimator的参数,并包含作为estimator的子对象.

 

Returns:字符串到任意的映射,参数名称映射到它们的取值.

set_params(**params)

设置这个estimator的参数

 

 

 

 

 

 

 

 

 

 

class sklearn.base.TransformerMixin:为所有的transformers提供Mixin class 

 

方法:

__init__() 初始化方法
fit_transform(Xy=None**fit_params)

拟合数据并转换它

Parameters:

 X : numpy array of shape [n_samples, n_features]

 y : numpy array of shape [n_samples]

 

Returns:

X_new : numpy array of shape [n_samples, n_features_new]

 

 

 

 

 

 

 

 

class sklearn.base.ClassifierMixin:为所有的classifiers提供Mixin class

__init__() 初始化方法
score(Xysample_weight=None)

返回给定测试数据和标签的平均度量值

Parameters:

X : array-like, shape = (n_samples, n_features)

y : array-like, shape = (n_samples) or (n_samples, n_outputs)

sample_weight : array-like, shape = [n_samples]

 

 

 

 

 

 

class sklearn.base.RegressorMixin:为所有的regression estimators提供Mixin class

 

__init__() 初始化方法
score(Xysample_weight=None)

Parameters:

X : array-like, shape = (n_samples, n_features)

y : array-like, shape = (n_samples) or (n_samples, n_outputs)

sample_weight : array-like, shape = [n_samples]

 

 

 

 

 

class sklearn.base.ClusterMixin:为所有的cluster estimators提供Mixin class

 

__init__() 初始化方法
fit_predict(Xy=None)

Parameters:

X : ndarray, shape (n_samples, n_features)

 

Returns:返回聚类的标签

y : ndarray, shape (n_samples,)