Feature effects
- class datarobot.models.FeatureEffects
Feature Effects provides partial dependence and predicted vs actual values for top-500 features ordered by feature impact score.
The partial dependence shows marginal effect of a feature on the target variable after accounting for the average effects of all other predictive features. It indicates how, holding all other variables except the feature of interest as they were, the value of this feature affects your prediction.
- Variables:
project_id (
string
) – The project that contains requested modelmodel_id (
string
) – The model to retrieve Feature Effects forsource (
string
) – The source to retrieve Feature Effects fordata_slice_id (
string
orNone
) – The slice to retrieve Feature Effects for; if None, retrieve unsliced datafeature_effects (
list
) – Feature Effects for every featurebacktest_index (
string
,required only for DatetimeModels,
) – The backtest index to retrieve Feature Effects for.
Notes
featureEffects
is a dict containing the following:feature_name
(string) Name of the featurefeature_type
(string) dr.enums.FEATURE_TYPE, Feature type either numeric, categorical or datetimefeature_impact_score
(float) Feature impact scoreweight_label
(string) optional, Weight label if configured for the project else nullpartial_dependence
(List) Partial dependence resultspredicted_vs_actual
(List) optional, Predicted versus actual results, may be omitted if there are insufficient qualified samples
partial_dependence
is a dict containing the following:is_capped
(bool) Indicates whether the data for computation is cappeddata
(List) partial dependence results in the following format
data
is a list of dict containing the following:label
(string) Contains label for categorical and numeric features as stringdependence
(float) Value of partial dependence
predicted_vs_actual
is a dict containing the following:is_capped
(bool) Indicates whether the data for computation is cappeddata
(List) pred vs actual results in the following format
data
is a list of dict containing the following:label
(string) Contains label for categorical features for numeric features contains range or numeric value.bin
(List) optional, For numeric features contains labels for left and right bin limitspredicted
(float) Predicted valueactual
(float) Actual value. Actual value is null for unsupervised timeseries modelsrow_count
(int or float) Number of rows for the label and bin. Type is float if weight or exposure is set for the project.
- classmethod from_server_data(data, *args, use_insights_format=False, **kwargs)
Instantiate an object of this class using the data directly from the server, meaning that the keys may have the wrong camel casing.
- Parameters:
data (
dict
) – The directly translated dict of JSON from the server. No casing fixes have taken placeuse_insights_format (
Optional[bool]
) – Whether to repack the data from the format used in the GET /insights/featureEffects/ URL to the format used in the legacy URL.
- class datarobot.models.FeatureEffectMetadata
Feature Effect Metadata for model, contains status and available model sources.
Notes
source
is expected parameter to retrieve Feature Effect. One of provided sources shall be used.
- class datarobot.models.FeatureEffectMetadataDatetime
Feature Effect Metadata for datetime model, contains list of feature effect metadata per backtest.
Notes
feature effect metadata per backtest
contains:status
: str.backtest_index
: str.sources
: List[str].
source
is expected parameter to retrieve Feature Effect. One of provided sources shall be used.backtest_index
is expected parameter to submit compute request and retrieve Feature Effect. One of provided backtest indexes shall be used.- Variables:
data (
list[FeatureEffectMetadataDatetimePerBacktest]
) – List feature effect metadata per backtest
- class datarobot.models.FeatureEffectMetadataDatetimePerBacktest
Convert dictionary into feature effect metadata per backtest which contains backtest_index, status and sources.