最近在复现图神经网络代码时,遇到一个问题,对应的代码是
self.train_targets = preprocessing.label_binarize(self.train_subjects,all_classes)
该行代码的含义是将self.train_subjects进行二值化,即将cora数据集中的数据进行分类,
但报错:TypeError: label_binarize() takes 1 positional argument but 2 were given即label_binarize()函数只需要一个参数但是代码中实际出现了两个
label_binarize()用法如下
代码中self.train_subjects
all_classes
查询了相关文件,也没找到解决答案,希望高人路过能指点一下,感谢!