ValueError: Parameter values for parameter (max_depth) need to be a sequence.问题
因为在py2和py3中,很多类型都被独立出来,如range类型,因此在将py2的代码移植到py3时。
对GridSearchCV函数,parameters的内容要为list类型,因此要对这些内容进行强制转换,转换为list类型。
ValueError: Parameter values for parameter (max_depth) need to be a sequence.问题
因为在py2和py3中,很多类型都被独立出来,如range类型,因此在将py2的代码移植到py3时。
对GridSearchCV函数,parameters的内容要为list类型,因此要对这些内容进行强制转换,转换为list类型。