question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Predictions for the model

See original GitHub issue

Hello,

I was exploring the predict method for the model. So the predict gives two values, first is the array of 1s and 0s and second is the values of floats.

I have a few questions.

  1. How do you calculate the 0s and 1s array, is it based on some probability or what?
  2. What are the values in the float array? Are they activation values? Also, how can I convert them to probabilities? Doing a softmax over them won’t make sense because the model is trained in a 1vsall way.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kinoutecommented, Feb 18, 2020

Hi,

To convert the raw_outputs, you can use softmax from the scipy library:

from scipy.special import softmax

probabilities = softmax(raw_outputs, axis=1)

It will convert the float numbers to predictions like [0.12374 0.87612]

0reactions
ThilinaRajapaksecommented, Feb 25, 2020

Yes.

You’d be right to assume that I know what the 1 vs all approach is. What I pointed out was that if the labels are independent of each other, you cannot select a top k based on the scores given by the model for each label as they are independent of each other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use a model to do predictions with Keras - ActiveState
Keras models can be used to detect trends and make predictions, using the model.predict() class and it's variant, ...
Read more >
How to Make Predictions with Keras - Machine Learning Mastery
We can predict the class for new data instances using our finalized classification model in Keras using the predict_classes() function. Note ...
Read more >
What is Predictive Modeling? - TechTarget
Predictive modeling is a mathematical process used to predict future events or outcomes by analyzing patterns in a given set of input data....
Read more >
Predictive Modeling: Types, Benefits, and Algorithms | NetSuite
In short, predictive modeling is a statistical technique using machine learning and data mining to predict and forecast likely future ...
Read more >
Making Predictions with Regression Analysis - Statistics By Jim
As we saw in this post, using regression analysis to make predictions is a multi-step process. After collecting the data, you need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found