Hi Robert,

Raw scores are not available through the public API. It would be great to add 
this feature, it seems that we overlooked it. 

The simple way to access the raw predictions currently would be to create a 
wrapper for mlpModel. This wrapper should be defined in [ml] package. One need 
to get weights from MultilayerPerceptronClassificationModel to instantiate this 
wrapper. 

The better way would be to write a new implementation of MLP model that will 
extend Classifier (instead of Predictor). It will be a total copy of the 
current MultilayerPerceptronClassificationModel except that one would need to 
implement "predictRaw" and " raw2prediction". Eventually, it might replace the 
current implementation.

Best regards, Alexander

-----Original Message-----
From: Robert Dodier [mailto:[email protected]] 
Sent: Tuesday, November 17, 2015 1:38 PM
To: [email protected]
Subject: Any way to get raw score from MultilayerPerceptronClassificationModel ?

Hi,

I'd like to get the raw prediction score from a 
MultilayerPerceptronClassificationModel. It appears that the 'predict'
method only returns the argmax of the largest score in the output layer (line 
200 in MultilayerPerceptronClassificationModel.scala in Spark 1.5.2).

Is there any way to get the raw score? It is computed as
mlpModel.predict(features) in the source code. It appears that I can't access 
mlpModel since it is private in MultilayerPerceptronClassificationModel so I 
couldn't just grab mlpModel and call predict on it. Is there another way?

Thanks for any light you can shed on this question.

Robert Dodier

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional 
commands, e-mail: [email protected]

Reply via email to