“在‘​​NoneType’和‘NoneType’的实例之间不支持‘<’” 使用 StratifiedShuffleSplit 的 split() 方法时

问题描述

from sklearn.model_selection import StratifiedShuffleSplit
split = StratifiedShuffleSplit(n_splits=1,test_size=0.2,random_state=42)
for train_index,test_index in split.split(housing,housing["income_cat"]):
    strat_train_set = housing.loc[train_index]
    strat_test_set = housing.loc[test_index]

我用来以分层方式拆分数据集的这段代码给了我一个我无法理解的错误。 在此处输入图片说明error message enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)