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.关于决策树:决策树是一个非参数的监督式学习方法,主要用于 ...
随机推荐
- TJson.format() 输出错误的CRLF
下面的JSON串: { "a":"x=\"a,b\"" } 通过下面代码输出,多了CRLF: procedure JsonFormatTes ...
- 离线使用Visual Studio的Javascript Prettier插件
用Prettier插件来格式化Javascript代码效果好的不得了,简直是强迫症的救命克星,可惜单位的电脑是不联网的,始终用不了,今天抽空研究了一下,找到办法了. 1.下载JavaScript Pr ...
- Android manifest 获取源代码
/********************************************************************************* * Android manifes ...
- linux fdisk tf卡分区操作解析说明
/***************************************************************************** * linux fdisk tf卡分区操作 ...
- [LeetCode&Python] Problem 463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represen ...
- [LeetCode&Python] Problem 883. Projection Area of 3D Shapes
On a N * N grid, we place some 1 * 1 * 1 cubes that are axis-aligned with the x, y, and z axes. Each ...
- CF1096.F. Inversion Expectation(树状数组)
A permutation of size n is an array of size n such that each integer from 1 to n occurs exactly once ...
- Koa下http代理
前言 最近做管理后台的重构或者说重做. 至于为什么要重构. 随意的解释: 是原来写的人走了. 客观的解释: 用的人觉得不好用 维护的人员找不到北 再多一点解释: express + ejs的混合编写 ...
- 大家一起做训练 第一场 G CD
题目来源:UVA 624 题目的意思就是:我现在需要从 t 张CD中拿出一部分来,尽可能的凑出接近 N 这么久的音乐,但是不能超过 N. CD不超过20张,每张长度不超过 N ,不能重复选. 一个很简 ...
- VisualSVN安装配置与使用
VisualSVN安装配置与使用 1. 所选服务器安装包:VisualSVN-Server-2.1.3.msi. 2. 客户端安装包:TortoiseSVN-1.6.2.16344-win32-s ...