Orange Forum • View topic - How To - Probability Estimation Package

How To - Probability Estimation Package

A place to ask questions about methods in Orange and how they are used and other general support.

How To - Probability Estimation Package

Postby nesterran » Mon Nov 19, 2012 23:16

Hi to all,

I was reviewing the orange.statistics package and the documentation is straightforward however in the Probability Estimation part there are no examples like in the other sections (Basic Statistics, ContingencyTable and Distributions). I was trying to instantiate and play arround by myself with the EstimatorConstructors, Estimators, ConditionalEstimators and I could neither figure out how to setup them nor how to execute them nor how to combine them. Therefore a good improvement in the documentation could be to add some examples.

So my question is:
Any of you can help me with examples of how to use them (EstimatorConstructor, Estimators and ConditionalEstimators), starting with a toy dataset like "".

Thanks for your help,
Nestor Andres Rodriguez

Re: How To - Probability Estimation Package

Postby Ales » Wed Nov 21, 2012 12:53

The documentation is in fact wrong or misleading in some parts. There are also some bugs in the code itself, for instance the 'pass None for the distribution' does not even work. It also does not specify that only the *ByRows estimators can actually make use of the 'instances' argument, the others just raise an (uninformative) error if not also given the distribution.

Example code:
Code: Select all
import Orange
iris ="iris")

# discrete class distribution
iris_dist = Orange.statistics.distribution.Distribution("iris", iris)

# m estimate constructor
mest_constructor = Orange.statistics.estimate.M(m=10)

# estimator
mest = mest_constructor(iris_dist)

print mest(iris[0]['iris'])  # prints 0.333... as expected

# petal length distribution
plength_dist = Orange.statistics.distribution.Distribution("petal length", iris)

# loess contructor
loess_est_constructor = Orange.statistics.estimate.Loess()

# loess estimator
plength_dist.normalize()  # loess constructor does not normalize the distribution (this is a bug).
loess_est = loess_est_constructor(plength_dist)

print loess_est(iris[0]['petal length'])

# contingency matrix for the conditional estimator
contingency = Orange.statistics.contingency.VarClass('petal length', iris)

conditional_loess_constructor = Orange.statistics.estimate.ConditionalLoess()

cloess_est = conditional_loess_constructor(contingency)

print cloess_est(iris[0]['petal length'])  # prints <0.980, 0.008, 0.012>

Re: How To - Probability Estimation Package

Postby nesterran » Wed Nov 21, 2012 14:26

Hi Ales,

Thanks again for your great help. I will check your example so that I can undestand how to use it.

Nestor Andres Rodriguez

Return to Questions & Support