我试图使用这里的代码:https://github.com/pystruct/pystruct/blob/master/examples/multi_label.py
我有形状为(2591, 256)
的X峎u火车和形状为(2591, 175)
的y火车。当我运行这个:
tree = chow_liu_tree(y_train)
tree_model = MultiLabelClf(edges=tree, inference_method="max-product")
tree_ssvm = OneSlackSSVM(tree_model, inference_cache=50, C=.1, tol=0.01)
print("fitting tree model...")
tree_ssvm.fit(X_train, y_train)
我知道了:
^{pr2}$当我直接从链接运行代码时,它可以工作(使用它们的数据集)。有人知道问题出在哪里吗?在
万一有人也会得到这个错误,
y
必须是int-I-got float类型。在指向解决方案的链接:https://groups.google.com/forum/#!searchin/pystruct/matching/pystruct/T6UKEgZLmxY/297oLYQL8U8J
相关问题 更多 >
编程相关推荐