Calculating prediction probability per each predicted outcome
Hi everyone, I'm currently using Scikit learn to train and test multiple neural networks. My issue - I'm breaking my dataset into 90/10, training on the 90%, and testing on the 10%. For the 10% trained data, I get outcomes as follows: predicted = neural_network.predict(test_data) Here, the predicted variable is basically either 1 or 0, which is what i'm feeding in as the outcome. But how can I get the prediction probability per each predicted outcome? back in the day when I used weka it produced a single prediction, followed by a prediction probability between 1 and 0 for each outcome. -- Best Regards, Suranga
Hi Suranga, if you are using the MLPClassifier class, it should have a predict_proba() method. Try: predicted = neural_network.predict_proba(test_data) Best regards, Piotr On 26.10.2016 17:26, Suranga Kasthurirathne wrote: Hi everyone, I'm currently using Scikit learn to train and test multiple neural networks. My issue - I'm breaking my dataset into 90/10, training on the 90%, and testing on the 10%. For the 10% trained data, I get outcomes as follows: predicted = neural_network.predict(test_data) Here, the predicted variable is basically either 1 or 0, which is what i'm feeding in as the outcome. But how can I get the prediction probability per each predicted outcome? back in the day when I used weka it produced a single prediction, followed by a prediction probability between 1 and 0 for each outcome. -- Best Regards, Suranga _______________________________________________ scikit-learn mailing list scikit-learn@python.org<mailto:scikit-learn@python.org> https://mail.python.org/mailman/listinfo/scikit-learn
Thanks Piotr, this was indeed the case. Works for me now :) On Wed, Oct 26, 2016 at 11:26 AM, Suranga Kasthurirathne < surangakas@gmail.com> wrote:
Hi everyone,
I'm currently using Scikit learn to train and test multiple neural networks.
My issue - I'm breaking my dataset into 90/10, training on the 90%, and testing on the 10%.
For the 10% trained data, I get outcomes as follows:
predicted = neural_network.predict(test_data)
Here, the predicted variable is basically either 1 or 0, which is what i'm feeding in as the outcome.
But how can I get the prediction probability per each predicted outcome? back in the day when I used weka it produced a single prediction, followed by a prediction probability between 1 and 0 for each outcome.
-- Best Regards, Suranga
-- Best Regards, Suranga
participants (2)
-
Piotr Bialecki -
Suranga Kasthurirathne