Skip to content

Issues related to code execution #21

@X-j-s

Description

@X-j-s

I would like to ask why my code reported an error:Exception in thread "main" java.lang.AbstractMethodError

object FSTest01 {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("FS test")
    val sc = new SparkContext(conf)
    val raw = MLUtils.loadLibSVMFile(sc, "a2a.libsvm")
    val data: RDD[LabeledPoint] = raw.map({ case LabeledPoint(label, values) => LabeledPoint(label, Vectors.dense(values.toArray)) })

    val criterion: InfoThCriterionFactory = new InfoThCriterionFactory("mrmr")
    val nToSelect = 5
    val nPartitions = 10

    val featureSelector = new InfoThSelector(criterion, nToSelect, nPartitions).fit(data)

    val redData = data.map { lp =>
      LabeledPoint(lp.label, featureSelector.transform(lp.features))
    }

    println(redData.first().toString())
  }
}

Error reported on the fit line of the code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions