## How To - Probability Estimation Package

3 posts
• Page

**1**of**1**### How To - Probability Estimation Package

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 "iris.tab".

Thanks for your help,

Nestor Andres Rodriguez

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 "iris.tab".

Thanks for your help,

Nestor Andres Rodriguez

### Re: How To - Probability Estimation Package

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:

Example code:

- Code: Select all
`import Orange`

iris = Orange.data.Table("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

Hi Ales,

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

Regards,

Nestor Andres Rodriguez

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

Regards,

Nestor Andres Rodriguez

3 posts
• Page

**1**of**1**