The EarthLearner and EarthClassifier provide the standard Orange learner/classifier pair for model induction/prediction.
Bases: Orange.regression.base.BaseRegressionLearner
Earth learner class.
Supports both regression and classification problems. For classification, class values are expanded into continuous indicator columns (one for each value if the number of values is grater then 2), and a multi response model is fit to these new columns. The resulting classifier computes response values on new instances to select the final predicted class.
Parameters: |
|
---|
Train an EarthClassifier instance on the instances.
Parameters: | instances (Orange.data.Table) – Training instances. |
---|
Note
weight_id is ignored.
Bases: Orange.classification.ClassifierFD
Earth classifier.
Predict the response value on instance.
Parameters: | instance (Orange.data.Instance) – Input data instance. |
---|
list of weak references to the object (if defined)
Return a list of constructed features of Earth terms.
The features can be used in Orange’s domain translation (i.e. they define the proper get_value_from() functions).
Return type: | list of Orange.feature.Descriptor |
---|
Return the base matrix (bx) of the Earth model for the table.
Base matrix is a len(instances) * num_terms matrix of computed values of terms in the model (not multiplied by beta) for each instance.
If table is not supplied, the base matrix of the training instances is returned.
Parameters: | instances (Orange.data.Table) – Input instances for the base matrix. |
---|
Return the estimated variable importances.
Parameters: | used_only (bool) – If True return only used attributes. |
---|
Predict the response values.
Parameters: | instance (Orange.data.Instance) – Data instance |
---|
See also
Example:
>>> import Orange, orangecontrib.earth
>>> data = Orange.data.Table("housing")
>>> c = orangecontrib.earth.EarthLearner(data, degree=2, terms=10)
>>> print c
MEDV =
23.587
+11.896 * max(0, RM - 6.431)
+1.142 * max(0, 6.431 - RM)
-0.612 * max(0, LSTAT - 6.120)
-228.795 * max(0, NOX - 0.647) * max(0, RM - 6.431)
+0.023 * max(0, TAX - 307.000) * max(0, 6.120 - LSTAT)
+0.029 * max(0, 307.000 - TAX) * max(0, 6.120 - LSTAT)
Bases: Orange.feature.scoring.Score
A subclass of Orange.feature.scoring.Score that scores features based on their importance in the Earth model using bagged_evimp.
Parameters: |
|
---|
GCV increase when the feature was removed during the pruning pass (averaged over all t models)
The number of subsets the feature is included during the pruning pass.
Residual squared error increase when the feature was removed during the pruning pass (averaged over all t models)
Return the score for attr as evaluated on data.
Parameters: |
|
---|
Note
weight_id is ignored.
list of weak references to the object (if defined)
See also
Orange.feature.scoring
Return the generalized cross validation (GCV).
Parameters : | rss : array_like
n : float
n_effective_params : array_like
|
---|
Plot the variable importances as returned from EarthClassifier.evimp().
import Orange, orangecontrib.earth
data = Orange.data.Table("housing")
c = orangecontrib.earth.EarthLearner(data, degree=3)
orangecontrib.earth.plot_evimp(c.evimp())
The left axis is the nsubsets measure and on the right are the normalized RSS and GCV.
Extract combined (average) evimp() from an instance of BaggedClassifier using EarthLearner as a base_learner.
Example:
from Orange.ensemble.bagging import BaggedLearner
bc = BaggedLearner(EarthLearner(degree=3, terms=10), data)
bagged_evimp(bc)
See also