Changeset 54:2a1c28cec845 in orange-reliability for orangecontrib/reliability/__init__.py


Ignore:
Timestamp:
10/07/13 16:34:49 (6 months ago)
Author:
markotoplak
Branch:
default
Message:

Documentation updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orangecontrib/reliability/__init__.py

    r53 r54  
    5252def get_pearson_r(res): 
    5353    """ 
    54     :param res: results of evaluation, done using learners, 
    55         wrapped into :class:`Orange.evaluation.reliability.Classifier`. 
     54    :param res: Evaluation results with :obj:`reliability_estimate`. 
    5655    :type res: :class:`Orange.evaluation.testing.ExperimentResults` 
    5756 
    58     Return Pearson's coefficient between the prediction error and each of the 
    59     used reliability estimates. Also, return the p-value of each of 
    60     the coefficients. 
     57    Pearson's coefficients between the prediction error and  
     58    reliability estimates with p-values. 
    6159    """ 
    6260    prediction_error = get_prediction_error_list(res) 
     
    7674def get_spearman_r(res): 
    7775    """ 
    78     :param res: results of evaluation, done using learners, 
    79         wrapped into :class:`Orange.evaluation.reliability.Classifier`. 
     76    :param res: Evaluation results with :obj:`reliability_estimate`. 
    8077    :type res: :class:`Orange.evaluation.testing.ExperimentResults` 
    8178 
    82     Return Spearman's coefficient between the prediction error and each of the 
    83     used reliability estimates. Also, return the p-value of each of 
    84     the coefficients. 
     79    Spearman's coefficients between the prediction error and  
     80    reliability estimates with p-values. 
    8581    """ 
    8682    prediction_error = get_prediction_error_list(res) 
     
    10096def get_pearson_r_by_iterations(res): 
    10197    """ 
    102     :param res: results of evaluation, done using learners, 
    103         wrapped into :class:`Orange.evaluation.reliability.Classifier`. 
     98    :param res: Evaluation results with :obj:`reliability_estimate`. 
    10499    :type res: :class:`Orange.evaluation.testing.ExperimentResults` 
    105100 
    106     Return average Pearson's coefficient over all folds between prediction error 
    107     and each of the used estimates. 
     101    Pearson's coefficients between prediction error 
     102    and reliability estimates averaged over all folds. 
    108103    """ 
    109104    results_by_fold = Orange.evaluation.scoring.split_by_iterations(res) 
     
    112107    number_of_folds = len(results_by_fold) 
    113108    results = [0 for _ in xrange(number_of_estimates)] 
     109    M 
    114110    sig = [0 for _ in xrange(number_of_estimates)] 
    115111    method_list = [0 for _ in xrange(number_of_estimates)] 
     
    199195class Estimate: 
    200196    """ 
    201     Reliability estimate. Contains attributes that describe the results of 
    202     reliability estimation. 
     197    Describes a reliability estimate. 
    203198 
    204199    .. attribute:: estimate 
    205200 
    206         A numerical reliability estimate. 
     201        Value of reliability. 
    207202 
    208203    .. attribute:: signed_or_absolute 
    209204 
    210         Determines whether the method used gives a signed or absolute result. 
     205        Determines whether the method returned a signed or absolute result. 
    211206        Has a value of either :obj:`SIGNED` or :obj:`ABSOLUTE`. 
    212207 
    213208    .. attribute:: method 
    214209 
    215         An integer ID of reliability estimation method used. 
     210        An integer ID of the reliability estimation method used. 
    216211 
    217212    .. attribute:: method_name 
    218213 
    219         Name (string) of reliability estimation method used. 
     214        Name (string) of the reliability estimation method used. 
    220215 
    221216    """ 
     
    281276    :rtype: :class:`Orange.evaluation.reliability.SensitivityAnalysisClassifier` 
    282277     
    283     To estimate the reliability of prediction for a given instance, 
    284     the learning set is extended with that instance with the label changes to  
     278    The learning set is extended with that instancem, where the label is changed to  
    285279    :math:`K + \epsilon (l_{max} - l_{min})` (:math:`K` is  the initial prediction, 
    286280    :math:`\epsilon` a sensitivity parameter, and :math:`l_{min}` and 
    287     :math:`l_{max}` the lower and upper bounds of labels on training data) 
     281    :math:`l_{max}` the lower and upper bounds of labels on training data). 
    288282    Results for multiple values of :math:`\epsilon` are combined 
    289     into SAvar and SAbias. SAbias can be used either in a signed or absolute form. 
     283    into SAvar and SAbias. SAbias has a signed or absolute form. 
    290284 
    291285    :math:`SAvar = \\frac{\sum_{\epsilon \in E}(K_{\epsilon} - K_{-\epsilon})}{|E|}` 
     
    386380    """ 
    387381     
    388     :param m: Number of bagging models to be used with BAGV estimate 
     382    :param m: Number of bagged models. Default: 50. 
    389383    :type m: int 
    390384     
    391     :param for instances:  Optional. If test instances 
     385    :param for_instances:  Optional. If test instances 
    392386      are given as a parameter, this class can compute their reliabilities 
    393387      on the fly, which saves memory.  
     
    397391    :rtype: :class:`Orange.evaluation.reliability.BaggingVarianceClassifier` 
    398392     
    399      
    400     :math:`m` different bagging models are used to estimate 
    401     the value of dependent variable for a given instance. For regression, 
    402     the variance of predictions is a reliability 
    403     estimate: 
     393    For regression, BAGV is the variance of predictions: 
    404394 
    405395    :math:`BAGV = \\frac{1}{m} \sum_{i=1}^{m} (K_i - K)^2`, where  
     
    407397    predictions of individual models. 
    408398 
    409     For classification, 1 minus the average Euclidean distance between class 
    410     probability distributions predicted by the model, and distributions 
    411     predicted by the individual bagged models, is the BAGV reliability 
    412     measure. For classification, a greater value implies a better 
    413     prediction. 
    414      
     399    For classification, BAGV is 1 minus the average Euclidean 
     400    distance between class probability distributions predicted by the 
     401    model, and distributions predicted by the individual bagged model; 
     402    a greater value implies a better prediction. 
     403 
    415404    This reliability measure can run out of memory if individual classifiers themselves 
    416405    use a lot of memory; it needs :math:`m` times memory 
     
    502491    :type distance: function 
    503492 
    504     :param distance_weighted: For classification, 
     493    :param distance_weighted: Relevant only for classification; 
    505494        use an average distance between distributions, weighted by :math:`e^{-d}`, 
    506495        where :math:`d` is the distance between predicted instance and the 
     
    594583    :rtype: :class:`Orange.evaluation.reliability.CNeighboursClassifier` 
    595584     
    596     For regression, CNK is defined a difference 
     585    For regression, CNK is a difference 
    597586    between average label of its nearest neighbours and the prediction. CNK 
    598587    can be either signed or absolute. A greater value implies greater prediction error. 
     
    10701059class Learner: 
    10711060    """ 
    1072     Adds reliability estimation to any learner: multiple reliability estimation  
    1073     algorithms can be used simultaneously. 
    1074     This learner can be used as any other learner, 
     1061    Adds reliability estimation to any prediction method. 
     1062    This class can be used as any other Orange learner, 
    10751063    but returns the classifier wrapped into an instance of 
    10761064    :class:`Orange.evaluation.reliability.Classifier`. 
    1077      
     1065 
    10781066    :param box_learner: Learner to wrap into a reliability estimation 
    10791067        classifier. 
     
    11061094 
    11071095    def __call__(self, instances, weight=None, **kwds): 
    1108         """Learn from the given table of data instances. 
     1096        """Construct a classifier. 
    11091097         
    1110         :param instances: Data to learn from. 
     1098        :param instances: Learning data. 
    11111099        :type instances: Orange.data.Table 
    11121100        :param weight: Id of meta attribute with weights of instances 
     
    11491137    def __call__(self, instance, result_type=Orange.core.GetValue): 
    11501138        """ 
    1151         Classify and estimate reliability of estimation for a new instance. 
     1139        Classify and estimate reliability for a new instance. 
    11521140        When :obj:`result_type` is set to 
    11531141        :obj:`Orange.classification.Classifier.GetBoth` or 
Note: See TracChangeset for help on using the changeset viewer.