【发布时间】:2017-10-12 11:48:43
【问题描述】:
您好,我正在使用 Spark ML 训练模型。训练数据集有 130 列和 1000 万行。现在,问题是每当我运行 MultiLayerPerceptron 时,它都会显示以下错误:
org.apache.spark.SparkException:作业因阶段失败而中止: 阶段 1882.0 中的任务 43 失败 4 次,最近一次失败:丢失任务 43.3 in stage 1882.0 (TID 180174, 10.233.252.145, executor 6): java.lang.ArrayIndexOutOfBoundsException
有趣的是,当我使用其他分类器(例如逻辑回归和随机森林)时,它不会发生。
我的代码:
# Building the model
inputneurons = len(features_columns)
#Assembling the Feature Vectors
assembler = VectorAssembler(inputCols=features_columns, outputCol="features")
#Logistic Regression
mlp = MultilayerPerceptronClassifier(labelCol=label, featuresCol="features", layers=[inputneurons,300,2])
#Pipelining the assembling and modeling process
pipeline = Pipeline(stages=[assembler, mlp])
model = pipeline.fit(training_df)
Spark 中 MLP 出现此类问题的原因可能是什么?
【问题讨论】:
标签: apache-spark pyspark apache-spark-ml