- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有办法使用 sklearn.preprocessing 对象来估算分类值?我想最终创建一个预处理对象,我可以将其应用于新数据并以与旧数据相同的方式对其进行转换。
我正在寻找一种方法来做到这一点,以便我可以使用它 this方式。
最佳答案
是的,这是可能的。例如,您可以将 sklearn.preprocessing.Imputer 与参数 strategy = 'most_frequent'
结合使用。
使用 fit_transform
方法将其应用于旧数据(训练集),然后对新数据(测试集)进行transform
。
关于machine-learning - sklearn : Categorical Imputer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42846345/
我的代码无法正常工作,因为我从机器学习 A-Z™:数据科学中的 Python 和 R 实践教程类(class)中逐字复制。我使用的是 Python 3.7,我已经在我的环境中安装了 scikit-le
我正在尝试在 google cloud ai 平台上创建一个版本,但找不到 impute 模块 No module named 'sklearn.impute._base; 'sklearn.impu
我正在对数据集进行预处理,我得到了该行的错误原因 imputer = imputer.fit(X [:,1:3])。我不明白哪个?我理解imputer = Imputer(missing_values
问题是我无法从 sklearn 导入模块。 from sklearn.impute import SimpleImputer ModuleNotFoundError: No module named
print(np.shape(ar_fulldata_input_xx)) Output: (9027, 1443) 现在,我使用 Imputer 来估算数据帧 ar_fulldata_input_x
我目前正在学习 sklearn imputer我发现有一种策略没有被 imputers 实现。 我想构建一个管道,删除具有任何缺失值的列或删除所有具有缺失值的行。 我为什么要这个? 因为我想进行网格搜
我正在尝试使用 Imputer 来查找缺失值。我还想跟踪具有所有缺失值的列,但因为否则我不知道其中哪些(列)已被处理:是否还可以返回包含所有缺失值的列? Impute Notes When axis=
我有一个包含缺失值 NaN 的特征矩阵,因此我需要先初始化这些缺失值。但是,最后一行提示并抛出以下错误行:预期序列或类数组,得到 Imputer(axis=0, copy=True, missing_
目前我正在尝试用 pandas 估算因变量。 (不要问为什么。)这是数据集 y.head(15) Out[138]: 0 13495.0 1 16500.0 2 16500.0
我有以下问题:我有一个 pandas 数据框,其中缺失值由字符串 na 标记。我想在其上运行一个 Imputer 以用列中的平均值替换缺失值。根据 sklearn 文档,参数 missing_valu
我试图在数据框中填充我的 NA 数据。我做了简单的数据: library(mice) first <- c(1,2,3,4,5,NA,7,8,9,NA) second<- c(1,2,NA,4,5,6
我不确定为什么,但在应用 knn.impute 时出现以下错误: Error in storage.mode(use.data) <- "double" : (list) object canno
考虑 data其中包含以下一些 nan: Column-1 Column-2 Column-3 Column-4 Column-5 0 NaN 15.0 63.0
有没有办法让 Scikit-learn Imputer 查找并替换多个被视为“缺失值”的值? 例如,我想做类似的事情 imp = Imputer(missing_values=(7,8,9)) 但根据
我正在练习机器学习中的数据集,在获取缺失值时,我使用了 imputer 类,但它给了我一个错误:数组索引太多。对于这个错误,我只是查看了所有 numpy 模块,但我没有任何想法来解决它。 import
有没有办法使用 sklearn.preprocessing 对象来估算分类值?我想最终创建一个预处理对象,我可以将其应用于新数据并以与旧数据相同的方式对其进行转换。 我正在寻找一种方法来做到这一点,以
docs对于 scikit-learn 的 Imputation transformer 说 When axis=0, columns which only contained missing val
我有一个包含 332 列的数据框。我想估算值以便能够使用 scikit-learn 的决策树分类器。我的问题是 imputer 函数的结果数据列只有 330。 from sklearn.preproc
我想在数据帧的所有 float64 列上使用 DataFrameMapper Imputer+Scaler 映射。我的代码适用于 StandardScaler,但当我添加 Imputer 时,映射器仅
import numpy as np import matplotlib.pyplot as plt import pandas as pd #Import Data set dataset= pd.
我是一名优秀的程序员,十分优秀!