在LinearSVC中检测到的类只支持二进制分类

2024-10-02 02:27:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我在这里输入代码时出现以下错误。在

   rf = LinearSVC(labelCol="indexedLabel", maxIter=10, regParam=0.1)
   pipeline = Pipeline(stages=[self.labelIndexer, self.featureIndexer, rf, 
   self.labelConverter])
   model = pipeline.fit(self.trainingData)

IllegalArgumentException: u'requirement failed: LinearSVC only supports binary classification. 99 classes detected in LinearSVC_6596220b55a3__labelCol'

Tags: 代码selfpipeline错误stagesrflinearsvcmaxiter

热门问题