吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型
from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型
def test_MinMaxScaler():
X=[[1,5,1,2,10],
[2,6,3,2,7],
[3,7,5,6,4,],
[4,8,7,8,1]]
print("before transform:",X)
scaler=MinMaxScaler(feature_range=(0,2))
scaler.fit(X)
print("min_ is :",scaler.min_)
print("scale_ is :",scaler.scale_)
print("data_max_ is :",scaler.data_max_)
print("data_min_ is :",scaler.data_min_)
print("data_range_ is :",scaler.data_range_)
print("after transform:",scaler.transform(X)) # 调用 test_MinMaxScaler
test_MinMaxScaler()

吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型的更多相关文章
- 吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型
from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[ ...
- 吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型
from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler() ...
- 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型
from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...
- 吴裕雄 python 机器学习——数据预处理流水线Pipeline模型
from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...
- 吴裕雄 python 机器学习——数据预处理字典学习模型
from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...
- 吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型
from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def ...
- 吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型
from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_Va ...
- 吴裕雄 python 机器学习——数据预处理二元化OneHotEncoder模型
from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X ...
- 吴裕雄 python 机器学习——数据预处理二元化Binarizer模型
from sklearn.preprocessing import Binarizer #数据预处理二元化Binarizer模型 def test_Binarizer(): X=[[1,2,3,4,5 ...
随机推荐
- Wannafly Camp 2020 Day 1A 期望逆序对 - 概率期望
分类讨论即可 #include <bits/stdc++.h> using namespace std; #define int long long const int N = 5005; ...
- C语言-基本数据类型
一.C语言数据类型深度剖析 1.什么是数据类型? -可以理解为固定内存大小的别名 -数据类型是创建变量的模子 -数据类型是对内存的格式化操作 上面三句话如何理解? 在以前的汇编语言时代,我们要存储一些 ...
- 常见通用框架的理解(Redis,Zookeeper,Thrift)
redis 主要功能是内存版的Hashta zookeeper 主要功能是分布式中的全局变量. thrift 跨平台的Client和Server通信架构. taskengine用于启动定时任务和查看 ...
- redis 列表类型list
列表类型(list)1.插入 左侧插入 :lpush key value1 value2 value3... 右侧插入: lpush key value1 value2 value3... 在指定元素 ...
- python 数组格式转换
格式转换 arr1 = [ {'name': 'jack', 'hobby': '西瓜'}, {'name': 'jack', 'hobby': '冬瓜'}, {'name': 'rose', 'ho ...
- SQLServer2005:在执行时出现错误。错误消息为: 目录名无效
删除数据时忘了想delete删除的话会记录日志,更何况是我删除百万条数据,结果还没删完服务器内存就占慢了,一切数据都进不来了,估计这种情况导致我的数据库有问题了,右键打开表提示:目录名无效,执行SQL ...
- 高效完成R代码
为什么R有时候运行慢? 参考https://www.cnblogs.com/qiaoyihang/p/7779144.html 一.为什么R程序有时候会很慢? 1.计算性能的三个限制条件 cpu ra ...
- EF中的持久化场景
使用EF实现实体持久化(保存)到数据库有两种情况:在线场景和离线场景. 1.在线场景 在线场景中,context是上下文实例,读写都通过一个context. 这种方案适用于连接本地数据库或同一网络上的 ...
- jQuery func
1. $(selector).each(function(index,element)); -----------index 选择器的index位置,element --当前的元素 2. _.eac ...
- python,装饰器带参数,原理
import time # 函数装饰器传参 def zhuang1(hao): def zhuang2(func1): def funczhuang(*args, **kw): print(time. ...