Changeset 10420:969093619068 in orange for Orange/regression/earth.py
 Timestamp:
 03/02/12 15:47:18 (2 years ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/regression/earth.py
r10330 r10420 104 104 class EarthLearner(Orange.regression.base.BaseRegressionLearner): 105 105 """Earth learner class. Supports both regression and classification 106 problems. In case of classification theclass values are expanded into106 problems. For classification, class values are expanded into 107 107 continuous indicator columns (one for each value if the number of 108 values is grater then 2), and a multi response model is learned onthese109 new columns. The resulting classifier will then use the computedresponse108 values is grater then 2), and a multi response model is fit to these 109 new columns. The resulting classifier the computes response 110 110 values on new instances to select the final predicted class. 111 111 … … 126 126 127 127 :param degree: Maximum degree (num. of hinge functions per term) 128 of the terms in the model .128 of the terms in the model (default: 1). 129 129 :type degree: int 130 :param terms: Maximum number of terms in the forward pass (default 21). 131 132 .. note:: If this paramter is None then 133 ``min(200, max(20, 2 * n_attributes)) + 1`` will be used. This 134 is the same as the default setting in earth R package. 135 130 :param terms: Maximum number of terms in the forward pass 131 (default: 21). If set to ``None``, ``min(200, max(20, 2 132 * n_attributes)) + 1`` will be used, like the default 133 setting in earth R package. 136 134 :type terms: int 137 135 :param penalty: Penalty for hinges in the GCV computation (used 138 in the pruning pass). By default it is 3.0 if the degree >1,139 2.0 otherwise.136 in the pruning pass). Default is 3.0 if ``degree`` is above 1, 137 and 2.0 otherwise. 140 138 :type penalty: float 141 139 :param thresh: Threshold for RSS decrease in the forward pass 142 (default 0.001).140 (default: 0.001). 143 141 :type thresh: float 144 142 :param min_span: TODO. 145 143 :param new_var_penalty: Penalty for introducing a new variable 146 in the model during the forward pass (default 0).144 in the model during the forward pass (default: 0). 147 145 :type new_var_penalty: float 148 146 :param fast_k: Fast k. 149 147 :param fast_beta: Fast beta. 150 148 :param pruned_terms: Maximum number of terms in the model after 151 pruning (default None no limit).149 pruning (default: ``None``, no limit). 152 150 :type pruned_terms: int 153 :param scale_resp: Scale responses prior to forward pass (default 154 True  ignored for multi response models).151 :param scale_resp: Scale responses prior to forward pass (default: 152 ``True``); ignored for models with multiple responses. 155 153 :type scale_resp: bool 156 154 :param store_instances: Store training instances in the model 157 (default True).155 (default: ``True``). 158 156 :type store_instances: bool 159 157 … … 333 331 def base_matrix(self, instances=None): 334 332 """Return the base matrix (bx) of the Earth model for the table. 335 If table is not supplied the base matrix of the training instances333 If table is not supplied, the base matrix of the training instances 336 334 is returned. 337 335 Base matrix is a len(instances) x num_terms matrix of computed values … … 350 348 351 349 def predict(self, instance): 352 """ Predict the response value s for the instance350 """ Predict the response value(s) 353 351 354 352 :param instance: Data instance … … 363 361 364 362 def used_attributes(self, term=None): 365 """ Return the used terms for term (index). If no term is given363 """Return the used terms for term (index). If no term is given, 366 364 return all attributes in the model. 367 365 … … 965 963 966 964 class ScoreEarthImportance(scoring.Score): 967 """ A n :class:`Orange.feature.scoring.Score` subclass.968 Scores features based on their importance in the Earth969 model using ``bagged_evimp`` 's function return value.965 """ A subclass of :class:`Orange.feature.scoring.Score` that. 966 scores features based on their importance in the Earth 967 model using ``bagged_evimp``. 970 968 971 969 """
Note: See TracChangeset
for help on using the changeset viewer.