sklearn的BaseEstimator、transformerMixin、ClassifierMixin、RegressorMixin、ClusterMixin介绍
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(X, y=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(X, y, sample_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(X, y, sample_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(X, y=None) |
Parameters: X : ndarray, shape (n_samples, n_features) Returns:返回聚类的标签 y : ndarray, shape (n_samples,) |
sklearn的BaseEstimator、transformerMixin、ClassifierMixin、RegressorMixin、ClusterMixin介绍的更多相关文章
- 基于sklearn的 BaseEstimator开发接口:模型融合Stacking
转载:https://github.com/LearningFromBest/CMB-credit-card-department-prediction-of-purchasing-behavior- ...
- sklearn多分类问题
sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频) https://study.163.com/course/introduction.htm?courseId=1005269003& ...
- Sklearn 与 TensorFlow 机器学习实战—一个完整的机器学习项目
本章中,你会假装作为被一家地产公司刚刚雇佣的数据科学家,完整地学习一个案例项目.下面是主要步骤: 项目概述. 获取数据. 发现并可视化数据,发现规律. 为机器学习算法准备数据. 选择模型,进行训练. ...
- 机器学习实战 | SKLearn最全应用指南
作者:韩信子@ShowMeAI 教程地址:http://www.showmeai.tech/tutorials/41 本文地址:http://www.showmeai.tech/article-det ...
- 使用sklearn进行数据挖掘-房价预测(4)—数据预处理
在使用机器算法之前,我们先把数据做下预处理,先把特征和标签拆分出来 housing = strat_train_set.drop("median_house_value",axis ...
- 利用Sklearn实现加州房产价格预测,学习运用机器学习的整个流程(包含很多细节注解)
Chapter1_housing_price_predict .caret, .dropup > .btn > .caret { border-top-color: #000 !impor ...
- Hands on Machine Learning with sklearn and TensorFlow —— 一个完整的机器学习项目(加州房地产)
数据集地址:https://github.com/ageron/handson-ml/tree/master/datasets 先行知识准备:NumPy,Pandas,Matplotlib的模块使用 ...
- 利用sklearn的LabelEncoder对标签进行数字化编码
from sklearn.preprocessing import LabelEncoder def gen_label_encoder(): labels = ['BB', 'CC'] le = L ...
- Sklearn库例子——决策树分类
Sklearn上关于决策树算法使用的介绍:http://scikit-learn.org/stable/modules/tree.html 1.关于决策树:决策树是一个非参数的监督式学习方法,主要用于 ...
随机推荐
- 接下来将介绍C#如何设置子窗体在主窗体中居中显示,本文提供详细的操作步骤,需要的朋友可以参考下
接下来将介绍C#如何设置子窗体在主窗体中居中显示,本文提供详细的操作步骤,需要的朋友可以参考下 其实表面上看是很简单的 开始吧,现在有两个窗体Form1主窗体,Form2子窗体 而且我相信大部分人都会 ...
- nw + iframe嵌入page 滚动条问题
iframe 加载完之后会在原尺寸基础上增加4像素(因此我用以下方法处理): <iframe id="myiframe" style="visibility: hi ...
- VC++实现解析快捷方式
VC++实现解析快捷方式: http://blog.csdn.net/mydreamremindme/article/details/9826745
- markdown添加本地图片
这是个坑 如果你的markdown在一个文件目录下,需要添加另一个目录下的图片,绝对路径是不可行的.需要 "迂回" 所谓 迂回,即需要先用../../命令返回上一文件目录,直至可以 ...
- 转:如何解决VC "应用程序无法启动,因为应用程序的并行配置不正确 sxstrace.exe"问题
如何解决VC "应用程序无法启动,因为应用程序的并行配置不正确 sxstrace.exe"问题 引用链接 http://blog.csdn.net/pizi0475/artic ...
- STM32 RTC时钟的配置
1) 使能电源时钟和备份区域时钟. RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE); //使能电源时钟和 ...
- 猎豹免费WiFi-随身WiFi共享热点,永久免费的无线路由器 - imsoft.cnblogs
- 《DSP using MATLAB》Problem 3.12
- flask第30篇——宏macro和import标签
宏是Jinja2特有的,像Django则没有这个. 先新建一个项目macroDemo: 然后在templates文件夹中新建index.html文件,并在代码中返回渲染后的文件: 然后回到index. ...
- ubuntu编译python源码的坑
在linux平台下编译python时只需要3条命令. 编译步骤 在github或https://www.python.org/downloads/中下载python源码 解压压缩包进路目录执行 1. ...