Changeset 11337:02feeae55f5f in orange
 Timestamp:
 02/20/13 13:08:50 (14 months ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

docs/reference/rst/Orange.statistics.estimate.rst
r11335 r11337 3 3 .. index:: Probability Estimation 4 4 5 ===================================== ==5 ===================================== 6 6 Probability Estimation (``estimate``) 7 ===================================== ==7 ===================================== 8 8 9 9 Probability estimators compute probabilities of values of class variable. … … 164 164 165 165 Base classes 166 ============ =166 ============ 167 167 168 168 All probability estimators are derived from two base classes: one for … … 196 196 decide what to use. 197 197 198 .. note:: The `instances` and `weight_id` argument are at the moment 199 only used by :class:`ConditionalByRows`. The rest of the builtin 200 constructors require that `distribution` is given. 201 198 202 .. class:: Estimator 199 203 … … 245 249 distribution and instances are given, it is up to constructor to 246 250 decide what to use. 251 252 .. note:: The `instances` and `weight_id` argument are at the moment 253 only used by :class:`ConditionalByRows`. The rest of the builtin 254 constructors require that `table` is given. 247 255 248 256 .. class:: ConditionalEstimator … … 392 400 parameters, see the inherited :obj:`ConditionalEstimator.__call__`. 393 401 402 403 Example 404 ======= 405 406 >>> import Orange 407 >>> iris = Orange.data.Table("iris") 408 >>> 409 >>> # discrete class distribution 410 >>> iris_dist = Orange.statistics.distribution.Distribution("iris", iris) 411 >>> # m estimate constructor 412 >>> mest_constructor = Orange.statistics.estimate.M(m=10) 413 >>> 414 >>> # create the estimator 415 >>> mest = mest_constructor(iris_dist) 416 >>> print "%.2f" % mest(iris[0]['iris']) 417 0.33 418 >>> # petal length (continuous) distribution 419 >>> plength_dist = Orange.statistics.distribution.Distribution("petal length", iris) 420 >>> plength_dist.normalize() 421 >>> 422 >>> # loess contructor 423 >>> loess_est_constructor = Orange.statistics.estimate.Loess() 424 >>> 425 >>> # create the loess estimator 426 >>> loess_est = loess_est_constructor(plength_dist) 427 >>> 428 >>> print "%.2f" % loess_est(iris[0]['petal length']) 429 0.04 430 >>> # contingency matrix for the conditional estimator 431 >>> contingency = Orange.statistics.contingency.VarClass('petal length', iris) 432 >>> conditional_loess_constructor = Orange.statistics.estimate.ConditionalLoess() 433 >>> 434 >>> cloess_est = conditional_loess_constructor(contingency) 435 >>> print cloess_est(iris[0]['petal length']) 436 <0.980, 0.008, 0.012>
Note: See TracChangeset
for help on using the changeset viewer.