Ignore:
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.statistics.estimate.rst

    r10246 r11337  
    33.. index:: Probability Estimation 
    44 
    5 ======================================= 
     5===================================== 
    66Probability Estimation (``estimate``) 
    7 ======================================= 
     7===================================== 
    88 
    99Probability estimators compute probabilities of values of class variable. 
     
    164164 
    165165Base classes 
    166 ============= 
     166============ 
    167167 
    168168All probability estimators are derived from two base classes: one for 
     
    180180 
    181181        :param priori: prior distribution. 
    182         :type distribution: :class:`~Orange.statistics.distribution.Distribution` 
     182        :type priori: :class:`~Orange.statistics.distribution.Distribution` 
    183183 
    184184        :param instances: input data. 
    185         :type distribution: :class:`Orange.data.Table` 
     185        :type instances: :class:`Orange.data.Table` 
    186186 
    187187        :param weight_id: ID of the weight attribute. 
     
    196196        decide what to use. 
    197197 
     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 
    198202.. class:: Estimator 
    199203 
     
    230234 
    231235        :param prior: prior distribution. 
    232         :type distribution: :class:`~Orange.statistics.distribution.Distribution` 
     236        :type prior: :class:`~Orange.statistics.distribution.Distribution` 
    233237 
    234238        :param instances: input data. 
    235         :type distribution: :class:`Orange.data.Table` 
     239        :type instances: :class:`Orange.data.Table` 
    236240 
    237241        :param weight_id: ID of the weight attribute. 
     
    246250        decide what to use. 
    247251 
     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. 
     255 
    248256.. class:: ConditionalEstimator 
    249257 
     
    330338.. class:: ConditionalByRows 
    331339 
    332     Bases: :class:`ConditionalEstimator` 
     340    Bases: :class:`ConditionalEstimatorConstructor` 
    333341 
    334342    .. attribute:: estimator_constructor 
     
    348356 
    349357        :param prior: prior distribution. 
    350         :type distribution: :class:`~Orange.statistics.distribution.Distribution` 
     358        :type prior: :class:`~Orange.statistics.distribution.Distribution` 
    351359 
    352360        :param instances: input data. 
    353         :type distribution: :class:`Orange.data.Table` 
     361        :type instances: :class:`Orange.data.Table` 
    354362 
    355363        :param weight_id: ID of the weight attribute. 
     
    392400        parameters, see the inherited :obj:`ConditionalEstimator.__call__`. 
    393401 
     402 
     403Example 
     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> 
  • source/orange/assoc.hpp

    r10960 r11338  
    276276 
    277277  TAssociationRulesSparseInducer(float asupp=0.3, float aconf=0, int awei=0); 
    278   TSparseItemsetTree *TAssociationRulesSparseInducer::buildTree(PExampleGenerator examples, const int &weightID, long &i, float &fullWeight); 
     278  TSparseItemsetTree *buildTree(PExampleGenerator examples, const int &weightID, long &i, float &fullWeight); 
    279279  PAssociationRules operator()(PExampleGenerator, const int &weightID); 
    280280 
  • source/orange/examplegen.hpp

    r10960 r11338  
    151151  bool operator != (const TExampleIterator &other); 
    152152 
    153   inline TExampleIterator &TExampleIterator::operator ++ () 
     153  inline TExampleIterator &operator ++ () 
    154154  { if (!example) 
    155155      raiseErrorWho("exampleIterator", "out of range"); 
  • source/orange/hclust.hpp

    r9026 r11338  
    8080 
    8181private: 
    82     TClusterW *THierarchicalClustering::merge_CompleteLinkage(TClusterW **clusters, float *callbackMilestones); 
    83     TClusterW *THierarchicalClustering::merge_SingleLinkage(TClusterW **clusters, float *callbackMilestones); 
    84     TClusterW *THierarchicalClustering::merge_AverageLinkage(TClusterW **clusters, float *callbackMilestones); 
     82    TClusterW *merge_CompleteLinkage(TClusterW **clusters, float *callbackMilestones); 
     83    TClusterW *merge_SingleLinkage(TClusterW **clusters, float *callbackMilestones); 
     84    TClusterW *merge_AverageLinkage(TClusterW **clusters, float *callbackMilestones); 
    8585    // Average linkage also computes Ward's linkage 
    8686 
  • source/orange/lib_components.cpp

    r10478 r11336  
    24592459    argp = args; 
    24602460    if ((argp != argc) && ((*argp==Py_None) || PyOrDistribution_Check(*argp))) { 
    2461         dist = (*argp==Py_None) ? PDistribution() : PyOrange_AsDistribution(*argp++); 
     2461        if (*argp == Py_None){ 
     2462            dist = PDistribution(); 
     2463            argp++; 
     2464        } else { 
     2465            dist = PyOrange_AsDistribution(*argp++); 
     2466        } 
     2467 
    24622468        if ((argp != argc) && PyOrDistribution_Check(*argp)) 
    24632469            apriori = PyOrange_AsDistribution(*argp++); 
     
    25152521    PExampleGenerator gen; 
    25162522    int weightID = 0; 
    2517     if (!PyArg_UnpackTuple(uargs, "ProbabilityEstimatorConstructor.call", 0, 4, args, args+1, args+2, args+3)) 
     2523    if (!PyArg_UnpackTuple(uargs, "ConditionalProbabilityEstimatorConstructor.call", 0, 4, args, args+1, args+2, args+3)) 
    25182524        return PYNULL; 
    25192525 
     
    25252531    argp = args; 
    25262532    if ((argp != argc) && ((*argp==Py_None) || PyOrContingency_Check(*argp))) { 
    2527         cont = (*argp==Py_None) ? PContingency() : PyOrange_AsContingency(*argp++); 
     2533        if (*argp==Py_None){ 
     2534            cont = PContingency(); 
     2535            argp++; 
     2536        } else { 
     2537            cont = PyOrange_AsContingency(*argp++); 
     2538        } 
     2539 
    25282540        if ((argp != argc) && PyOrDistribution_Check(*argp)) 
    25292541            apriori = PyOrange_AsDistribution(*argp++); 
     
    25392551 
    25402552    if (argp != argc) 
    2541         PYERROR(PyExc_TypeError, "Invalid arguments for 'ProbabilityEstimatorConstructor.call'", PYNULL); 
     2553        PYERROR(PyExc_TypeError, "Invalid arguments for 'ConditionalProbabilityEstimatorConstructor.call'", PYNULL); 
    25422554 
    25432555    return WrapOrange(cest->call(cont, apriori, gen, weightID)); 
  • source/orange/pythonvars.hpp

    r6531 r11338  
    4141  TPythonValue(PyObject *value); 
    4242 
    43   TPythonValue &TPythonValue::operator =(const TPythonValue &other); 
     43  TPythonValue &operator =(const TPythonValue &other); 
    4444 
    4545  ~TPythonValue(); 
  • source/orangeom/pathfinder.hpp

    r6925 r11338  
    135135     * @param result: The resulting matrix 
    136136     */ 
    137     void TPathfinder::op(const Matrix &A, const Matrix &B, Matrix &result) const; 
     137    void op(const Matrix &A, const Matrix &B, Matrix &result) const; 
    138138     
    139139    /** 
  • source/pyxtract/pyxtract.py

    r10478 r11338  
    810810    externsfile.write('#define PyOr%s_Check(op) PyObject_TypeCheck(op, (PyTypeObject *)&PyOr%s_Type)\n' % (type, type)) 
    811811    if classdefs[type].datastructure == "TPyOrange": 
    812       externsfile.write('#define PyOrange_As%s(op) (*(GCPtr< T%s > *)(void *)(&PyOrange_AS_Orange(op)))\n' % (type, type)) 
     812      externsfile.write('#define PyOrange_As%s(op) (static_cast<GCPtr< T%s > >(PyOrange_AS_Orange(op)))\n' % (type, type)) 
    813813      externsfile.write('\n') 
    814814 
Note: See TracChangeset for help on using the changeset viewer.