Questions tagged [uncertainty]

The uncertainties package is a python package that transparently handles calculations with numbers with uncertainties (like 3.14±0.01). It can also yield the derivatives of any expression.

The uncertainties package is a python package that transparently handles calculations with numbers with uncertainties (like 3.14±0.01). It can also yield the derivatives of any expression.

Tag usage

Questions on tag should be about implementation and programming problems.
Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

138 questions
43
votes
4 answers

How to calculate prediction uncertainty using Keras?

I would like to calculate NN model certainty/confidence (see What my deep model doesn't know) - when NN tells me an image represents "8", I would like to know how certain it is. Is my model 99% certain it is "8" or is it 51% it is "8", but it could…
johndodo
  • 17,247
  • 15
  • 96
  • 113
27
votes
2 answers

Plotting shaded uncertainty region in line plot in matplotlib when data has NaNs

I would like a plot which looks like this: I am trying to do this with matplotlib: fig, ax = plt.subplots() with sns.axes_style("darkgrid"): for i in range(5): ax.plot(means.ix[i][list(range(3,104))], label=means.ix[i]["label"]) …
patapouf_ai
  • 17,605
  • 13
  • 92
  • 132
23
votes
1 answer

Uncertainties in Pandas

How to handle easily uncertainties on Series or DataFrame in Pandas (Python Data Analysis Library) ? I recently discovered the Python uncertainties package but I am wondering if there is any simpler way to manage uncertainties directly within…
Falken
  • 353
  • 2
  • 8
12
votes
2 answers

How to determine the uncertainty of fit parameters with Python?

I have the following data for x and y: x y 1.71 0.0 1.76 5.0 1.81 10.0 1.86 15.0 1.93 20.0 2.01 25.0 2.09 30.0 2.20 35.0 2.32 40.0 2.47 45.0 2.65 50.0 2.87 55.0 3.16 60.0 3.53 65.0 4.02 70.0 4.69 …
Tom Kurushingal
  • 6,086
  • 20
  • 54
  • 86
12
votes
1 answer

Calculate uncertainty in FFT amplitude

My Python programming problem is the following: I want to create an array of measurement results. Each result can be described as a normal distribution for which the mean value is the measurement result itself and the standard deviation is its…
user2996448
  • 157
  • 2
  • 6
9
votes
3 answers

How to calculate confidence score of a Neural Network prediction

I am using a deep neural network model (implemented in keras)to make predictions. Something like this: def make_model(): model = Sequential() model.add(Conv2D(20,(5,5), activation = "relu")) model.add(MaxPooling2D(pool_size=(2,2))) …
9
votes
1 answer

Shaded uncertainty/error region in matplotlib.pyplot

I'm searching for a way to draw shaded error-regions instead of error-bars in Python. I know that there is matplotlib.pyplot.fill_between() with which you can build a workaround for the y-error but that does not include the x-uncertainty. Any…
Suuuehgi
  • 4,547
  • 3
  • 27
  • 32
9
votes
5 answers

Finding the location of a parent node in a binary tree

So I need help coming up with an expression that will always give me the location of a child's parent node in a binary tree. Here is an example of a problem my teacher will put on our exam: "Consider a complete binary tree with exactly 10,000 nodes,…
user2188910
  • 141
  • 1
  • 1
  • 5
8
votes
1 answer

how to calculate the confidence level for random forest regression model in R

I'm using randomForest package in R, for the purpose of predicting the distances between proteins (regression model in RF) "for a homology modeling purposes" and I obtained quite good results. However, I need to have a confidence level to rank my…
DOSMarter
  • 1,485
  • 5
  • 21
  • 29
7
votes
1 answer

Gaussian-Process Prediction Confidence Interval Oddities

I'm doing some particle physics analysis and was hoping someone out there could give me some insight on a Gaussian-Process fit I'm trying to use to extrapolate some data. I have data with uncertainties that I'm feeding in to the scikit-learn…
6
votes
2 answers

How to incorporate individual measurement uncertainties into Gaussian Process?

I have a set of observations, f_i=f(x_i), and I want to construct a probabilistic surrogate, f(x) ~ N[mu(x), sigma(x)], where N is a normal distribution. Each observed output, f_i, is associated with a measurement uncertainty, sigma_i. I would like…
kilojoules
  • 9,768
  • 18
  • 77
  • 149
6
votes
1 answer

Measuring uncertainty using MC Dropout on pytorch

I am trying to implement Bayesian CNN using Mc Dropout on Pytorch, the main idea is that by applying dropout at test time and running over many forward passes , you get predictions from a variety of different models. I’ve found an application of the…
Ka_
  • 181
  • 1
  • 2
  • 8
6
votes
7 answers

A good uncertainty (interval) arithmetic library?

edited Given that the words "uncertain" and "uncertainty" are fairly ubiquitous, it's hard to Google "uncertainty arithmetic" and get anything immediately helpful. Thus, can anyone suggest a good library of routines, in almost any…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
6
votes
2 answers

Operator Overloading in Excel VBA

What I would like to do: I would like to use operator overloading in Excel to run custom functions on my custom data types. For example, when evaluating a formula, I want Excel to run my function instead of the '+' operator when the calculation…
Michael Molter
  • 1,296
  • 2
  • 14
  • 37
5
votes
1 answer

Negative loss when trying to implement aleatoric uncertainty estimation according to Kendall et al

I'm trying to implement a neural network with aleatoric uncertainty estimation for regression with pytorch according to Kendall et al.: "What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?" (Link). However, while the…
lauers
  • 61
  • 1
1
2 3
9 10