sjishan
sjishan

Reputation: 3652

Getting output layer neuron values for Spark ML Multilayer Perceptron Classifier

I am doing binary classification using Spark ML Multilayer Perceptron Classifier.

mlp = MultilayerPerceptronClassifier(labelCol="evt", featuresCol="features", layers=[inputneurons,(inputneurons*2)+1,2])

The output layer has of two neurons as it is a binary classification problem. Now I would like get the values two neurons for each of the rows in the test set instead of just getting the prediction column containing either 0 or 1.

I could not find anything to get that in the API document.

Upvotes: 3

Views: 2482

Answers (1)

Espanta
Espanta

Reputation: 1140

According to the documentation, Spark ML package does offer MLP (Multilayer Perceptron) as classifier only (no regression), and as a result it pushes output layer values to a softmax function to generate binary output value:

Nodes in the output layer use softmax function

Upvotes: 2

Related Questions