Calculating Demand confidence

I recently was asked to work on a business problem related to sales using Data Science. This required me to come up with a Demand confidence number that would specify how confident we are on delivering goods to customers given a certain supply on a particular day. This demand confidence is dependent on factors like quotes, agreements, profitability. how to model this kind of problem to come up with weightages to above said factors and calculate a confidence number? the …
Category: Data Science

Is it possible to train probabilistic model to return several distributions?

I have nonlinear data of function y(x), which is let's say parabolic. At some points of x there are several y's (look at the picture). Is it possible to train a probabilistic model to return several distributions (when needed) i.e. several means and variances. For example: when I feed a (x=a) to the model -> it returns 2 red distributions (2 means and 2 variances), and when I feed b (x=b) to the model -> it returns 1 blue distribution. …
Category: Data Science

Bayes posteriograms

My main objective is to predict the posterior probability of an individual belonging to one of the classes, using Bayes theorem. The information I have is: value of the data point mean and stdev of the 2 potential populations, that this data point could belong to (=the potential classes normal distributions drawn on those 2 classes I'm using numpy to create a probability distribution over a given mean and stdev. Let's say that this distribution represents the average weight of …
Category: Data Science

Bayes net inference in Pyro

I am familiar with Bayes nets (discrete/continuous/hybrid). I recently started to learn basics of Pyro and tried to model simple Bayes nets as Pyro programs. I also noticed the simple example answered in Question "Whats the Difference between probabilistic programming such as pyro and Belief networks?". Can anyone provide a full working Pyro example that shows Bayesian inference for computing any node/variable X posterior distribution P(X|e) in a Bayes net given some set of evidence e? Inference can be exact …
Category: Data Science

PyMC3 do not converge

I'm trying to run a simple logistic regression on PyMC3. Here the code: with pm.Model() as logistic_model: alpha=pm.Normal('alpha', mu=0, sd=100) beta1=pm.Normal('beta', mu=0, sd=100) beta2=pm.Normal('beta2', mu=0, sd=100) argtemp=alpha + beta1*data['age'].values +beta2*data['educ'].values prob=pm.invlogit(argtemp) Y_obs = pm.Bernoulli('Y_obs', p=prob, observed=data['income_more_50K'].values) map_estimate = pm.find_MAP() sampler=pm.Metropolis() trace= pm.sample(40000, step=sampler, start=map_estimate) The sampler run, but at the end it gives this error: The gelman-rubin statistic is larger than 1.4 for some parameters. The sampler did not converge. The estimated number of effective samples is smaller than 200 …
Category: Data Science

Laplacian smoothing on Class Probability (Naive bayes)

I am implementing a Naive Bayes classifier in Python from scratch. The instructions I have asks that I incorporate Laplacian Smoothing with K=1 to computing the probability that a message belongs to a given class. I have two classes, ham and spam (E-mail spam filtering problem). So one example without smoothing would be if I had X spam messages and Y spam messages: P(X) = X / (X+Y) --> Probability that a class is spam in my dataset P(Y) = …
Category: Data Science

What is the quantity sold for a specific fruit & country combination?

What is the algorithm that generates these potential quantities that meet the given criteria? Essentially - there are number of quantities for a fruit and country combination. E.g: Country+Fruit Potential Quantity 1 India+Apple 25 2 India+Apple 27 3 India+Banana 35 4 India+Banana 37 5 France+Apple 130 6 France+Apple 132 7 France+Banana 11 8 France+Banana 13 9 France+Banana 15 10 France+Cherry 88 For complete dataset click here. Each Country has to be as close as possible to the following values for …
Category: Data Science

How to generate a sample from a generative model like a Restricted Boltzmann Machine?

I am learning about the Boltzmann machine. So far, I have successfully written a code that can learn the coefficients of the energy function of a Restricted Boltzmann Machine. Now, since my model is generative (if I have understood things correctly so far) and I know for sure that RBMs can be used for inpainting in binary images at least, I want to know how I can generate a sample from my probabilistic distribution given by the Boltzmann machine. That …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.