Selectors
MultiClassClassifier
Bases: AbstractModelBasedSelector
MultiClassClassifier is a class that predicts the best algorithm for a given instance using a multi-class classification model.
Attributes:
Name | Type | Description |
---|---|---|
model_class |
The class of the classification model to be used. |
|
metadata |
Metadata containing information about the algorithms. |
|
classifier |
The trained classification model. |
Source code in asf/selectors/mutli_class.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
__init__(model_class, metadata, hierarchical_generator=DummyFeatureGenerator())
Initializes the MultiClassClassifier with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_class
|
The class of the classification model to be used. |
required | |
metadata
|
Metadata containing information about the algorithms. |
required | |
hierarchical_generator
|
Feature generator to be used. |
DummyFeatureGenerator()
|
Source code in asf/selectors/mutli_class.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
PairwiseClassifier
Bases: AbstractModelBasedSelector
, AbstractFeatureGenerator
PairwiseClassifier is a selector that uses pairwise comparison of algorithms to predict the best algorithm for a given instance.
Attributes:
Name | Type | Description |
---|---|---|
model_class |
ClassifierMixin
|
The classifier model to be used for pairwise comparisons. |
classifiers |
list[ClassifierMixin]
|
List of trained classifiers for pairwise comparisons. |
Source code in asf/selectors/pairwise_classifier.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
__init__(model_class, metadata, hierarchical_generator=DummyFeatureGenerator())
Initializes the PairwiseClassifier with a given model class and hierarchical feature generator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_class
|
ClassifierMixin
|
The classifier model to be used for pairwise comparisons. |
required |
hierarchical_generator
|
AbstractFeatureGenerator
|
The feature generator to be used. Defaults to DummyFeatureGenerator. |
DummyFeatureGenerator()
|
Source code in asf/selectors/pairwise_classifier.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
generate_features(features)
Generates features for the pairwise classifiers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
DataFrame
|
The feature data for the instances. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: An array of predictions for each instance and algorithm pair. |
Source code in asf/selectors/pairwise_classifier.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
PairwiseRegressor
Bases: AbstractModelBasedSelector
, AbstractFeatureGenerator
PairwiseRegressor is a selector that uses pairwise regression of algorithms to predict the best algorithm for a given instance.
Attributes:
Name | Type | Description |
---|---|---|
model_class |
The regression model to be used for pairwise comparisons. |
|
regressors |
List of trained regressors for pairwise comparisons. |
Source code in asf/selectors/pairwise_regressor.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
__init__(model_class, metadata, hierarchical_generator=DummyFeatureGenerator())
Initializes the PairwiseRegressor with a given model class and hierarchical feature generator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_class
|
The regression model to be used for pairwise comparisons. |
required | |
hierarchical_generator
|
AbstractFeatureGenerator
|
The feature generator to be used. Defaults to DummyFeatureGenerator. |
DummyFeatureGenerator()
|
Source code in asf/selectors/pairwise_regressor.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
generate_features(features)
Generates features for the pairwise regressors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
DataFrame
|
The feature data for the instances. |
required |
Returns:
Type | Description |
---|---|
np.ndarray: An array of predictions for each instance and algorithm pair. |
Source code in asf/selectors/pairwise_regressor.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
PerformanceModel
Bases: AbstractModelBasedSelector
, AbstractFeatureGenerator
PerformancePredictor is a class that predicts the performance of algorithms based on given features. It can handle both single-target and multi-target regression models.
Attributes:
Name | Type | Description |
---|---|---|
model_class |
The class of the regression model to be used. |
|
metadata |
Metadata containing information about the algorithms. |
|
use_multi_target |
Boolean indicating whether to use multi-target regression. |
|
normalize |
Method to normalize the performance data. |
|
regressors |
List of trained regression models. |
Source code in asf/selectors/performance_model.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
__init__(model_class, metadata, use_multi_target=False, normalize='log', hierarchical_generator=DummyFeatureGenerator())
Initializes the PerformancePredictor with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_class
|
The class of the regression model to be used. |
required | |
metadata
|
Metadata containing information about the algorithms. |
required | |
use_multi_target
|
Boolean indicating whether to use multi-target regression. |
False
|
|
normalize
|
Method to normalize the performance data. |
'log'
|
|
hierarchical_generator
|
Feature generator to be used. |
DummyFeatureGenerator()
|
Source code in asf/selectors/performance_model.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
generate_features(features)
Generates predictions for the given features using the trained models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
DataFrame
|
DataFrame containing the feature data. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame containing the predictions for each algorithm. |
Source code in asf/selectors/performance_model.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|