我正在嘗試使用 GridCV 在 scala 中進(jìn)行超參數(shù)調(diào)整。但是我創(chuàng)建了我的管道和所有內(nèi)容,我將我的數(shù)據(jù)集安裝到管道中,它非常適合。然后我添加了一些,然后paramGrid在 4 個(gè)階段后進(jìn)行交叉驗(yàn)證,它給了我錯(cuò)誤:scala> val cvModel = cv.fit(df)Tracker started, with env={DMLC_NUM_SERVER=0, DMLC_TRACKER_URI=10.xx.xx.xxx, DMLC_TRACKER_PORT=9091, DMLC_NUM_WORKER=1}Tracker started, with env={DMLC_NUM_SERVER=0, DMLC_TRACKER_URI=10.xx.xx.xxx, DMLC_TRACKER_PORT=9091, DMLC_NUM_WORKER=1}Tracker started, with env={DMLC_NUM_SERVER=0, DMLC_TRACKER_URI=10.xx.xx.xxx, DMLC_TRACKER_PORT=9091, DMLC_NUM_WORKER=1}Tracker started, with env={DMLC_NUM_SERVER=0, DMLC_TRACKER_URI=10.xx.xx.xxx, DMLC_TRACKER_PORT=9091, DMLC_NUM_WORKER=1}19/02/13 09:16:33 WARN TaskSetManager: Lost task 2.0 in stage 152.0 (TID 916, ip-10.xx.xx.xxx.ec2.internal, executor 7): java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.spark.ml.linalg.DenseVector.apply(Vectors.scala:448) at org.apache.spark.ml.evaluation.BinaryClassificationEvaluator$$anonfun$1.apply(BinaryClassificationEvaluator.scala:82) at org.apache.spark.ml.evaluation.BinaryClassificationEvaluator$$anonfun$1.apply(BinaryClassificationEvaluator.scala:81) at scala.collection.Iterator$$anon$11.next(Iterator.scala:409) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter..然后實(shí)際上有兩三段錯(cuò)誤。我無(wú)法弄清楚為什么會(huì)發(fā)生這種情況,因?yàn)槲沂堑谝淮卧?scala 中編碼。但是根據(jù)我的概念和示例中給出的代碼,它似乎沒(méi)有鍛煉?;蛘哂袥](méi)有其他方法可以對(duì)交叉驗(yàn)證進(jìn)行超參數(shù)調(diào)優(yōu)和測(cè)試?我在setEvaluator執(zhí)行代碼時(shí)遇到了這個(gè)問(wèn)題。我的理解是我的特征形狀和 y 預(yù)測(cè)形狀不匹配。但是我如何確保他們這樣做呢?PS 我在 EMR 集群上運(yùn)行它。我也嘗試了同樣的事情,只是將算法更改為邏輯回歸,它工作得很好。我正在使用 xgboost v0.8 而 spark 是 v2.2
WARN TaskSetManager: Lost Task xxx: java.lang.
開(kāi)滿天機(jī)
2022-06-15 17:51:18