sklearn python3.6_Python3.6 SciKitLearn模块没有“CategoricalEncoder”属性

在使用Scikit Learn进行机器学习实践中遇到问题,Python3.6环境中尝试使用CategoricalEncoder时出现错误。书中提到的CategoricalEncoder可能是新引入的,可能未在当前版本的sklearn中提供。已检查文档和源代码,但无法找到解决办法。其他sklearn类正常工作,只在CategoricalEncoder上遇到问题。
摘要由CSDN通过智能技术生成

我将在《使用Scikit Learn&Tensorflow进行机器实践学习》一书中继续学习。

现在,我试图使用sklearn的^{},但是python拒绝接受它。在

这是我现在的代码:from util.fetch import *

from data.data import *

import matplotlib.pyplot as plot

from sklearn.model_selection import *

from sklearn.preprocessing import *

from sklearn.pipeline import *

import pandas.plotting as pdp

def main():

#

# Basic Data Exploration

#

fetch_housing_data()

housing = load_housing_data()

housing.hist(bins=50, figsize=(20,15))

plot.savefig(os.path.join('datasets', 'histogram.png'))

#

# Creating a Test Set

#

train_set, test_set = train_test_split(housing, test_size=0.2, random_state=42)

housing['income_cat'] = np.ceil(housing['median_income'] / 1.5)

housing['inc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值