Py3上的调试问题 AttributeError: module 'types' has no attribute 'ListType'求解
来源:互联网 发布:电视机的电视直播软件 编辑:程序博客网 时间:2024/05/29 19:19
import types as Types
def TrainCART(df,feature_list,y, depth = 10000):
'''
:param df: 建立CART的数据集
:param feature_list: 用于模型开发的特征的列表
:param y: 标签,取值0,1
:param depth: 树的深度。当指明深度时,设置该参数。
:return: 叶子节点,或者子树。最终返回字典形式的CART树
'''
cartResult = {bestFeature:{}}
if type(bestSplit) == Types.ListType: #按:出错,==types.ListType;试着改为Types.ListType
#AttributeError: module 'types' has no attribute 'ListType'
subTreeFeatures = [i for i in feature_list if i != bestFeature]
bestFeaturesVals = list(set(df[bestFeature]))
阅读全文
0 0
- Py3上的调试问题 AttributeError: module 'types' has no attribute 'ListType'求解
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'post'问题
- 【TensorFlow问题】AttributeError:'module' object has no attribute 'mul'
- 问题AttributeError: ‘module’ object has no attribute ‘sub’
- 【TensorFlow问题】AttributeError:'module' object has no attribute 'mul'
- Python问题分析:AttributeError: module 'sys' has no attribute 'setdefaultencoding'
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 'getpass'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- 取得tensor里的shape操作
- Hello World
- Java反射机制知识点
- 情感分析
- C++中的命名空间
- Py3上的调试问题 AttributeError: module 'types' has no attribute 'ListType'求解
- TF-IDF与余弦相似性的应用(二):找出相似文章
- SQLyog12.09(64 bit)证书秘钥
- IO编程
- 微信小程序 —— 模块化方法的总结
- set 的用法
- 第14周 项目3
- 变换自动编码器(Transforming Auto-Encoders)翻译
- laravel数据迁移