PipelineWithYTransformations 类
管道转换器类。
假定管道和 y_transformer 已初始化。
但是,拟合可以改变这一点,以允许传递管道的参数和 y_transformer。
- 继承
-
sklearn.pipeline.PipelinePipelineWithYTransformations
构造函数
PipelineWithYTransformations(pipeline, y_trans_name, y_trans_obj)
参数
- pipeline
- <xref:sklearn.pipeline.Pipeline>
sklearn.pipeline.Pipeline 对象。
- y_trans_obj
计算 y 值转换的对象。
方法
| fit |
适用于管道转换的拟合函数。 执行 y_transformer 的 fit_transform,然后拟合到 sklearn.pipeline.Pipeline。 |
| fit_predict |
适用于管道转换的拟合预测函数。 |
| get_params |
返回管道转换器的参数。 |
| predict |
管道转换器的预测函数。 执行 sklearn.pipeline.Pipeline 的预测,然后从 y_transformer 执行反向转换。 |
| predict_proba |
带有类的管道转换器的预测概率函数。 使用 sklearn.pipeline.Pipeline 执行预测并获得概率,然后从 y_transformer 执行反向转换。 返回的数据帧是 (n_samples, n_classes)。 每一行都对应于输入 X 中的行。列名是类名,列条目是概率。 :rtype:pandas.DataFrame |
fit
适用于管道转换的拟合函数。
执行 y_transformer 的 fit_transform,然后拟合到 sklearn.pipeline.Pipeline。
fit(X, y, y_min=None, **kwargs)
参数
返回
self:返回 PipelineWithYTransformations 的实例。
fit_predict
适用于管道转换的拟合预测函数。
fit_predict(X, y, y_min=None)
参数
返回
执行拟合后的预测值。
get_params
返回管道转换器的参数。
get_params(deep=True)
参数
返回
管道转换器的参数。
predict
管道转换器的预测函数。
执行 sklearn.pipeline.Pipeline 的预测,然后从 y_transformer 执行反向转换。
predict(X)
参数
返回
来自管道转换器的预测值。
返回类型
predict_proba
带有类的管道转换器的预测概率函数。
使用 sklearn.pipeline.Pipeline 执行预测并获得概率,然后从 y_transformer 执行反向转换。
返回的数据帧是 (n_samples, n_classes)。 每一行都对应于输入 X 中的行。列名是类名,列条目是概率。 :rtype:pandas.DataFrame
predict_proba(X)
参数
返回
来自每个类(列名)的管道转换器的预测概率值。 形状
属性
classes_
LabelEncoder 可能已看到比基础管道更多的类,因为我们在完整数据上拟合 LabelEncoder,而基础管道仅在训练数据上拟合。
替代模型的 >>classes_<< 属性,以便我们只能返回 fitted_pipeline 看到的那些类。 :return:管道看到的类集。
反馈
提交和查看相关反馈