Lift Chart
- class datarobot.models.lift_chart.LiftChart(source, bins, source_model_id, target_class, data_slice_id=None)
Lift chart data for model.
Notes
LiftChartBin
is a dict containing the following:actual
(float) Sum of actual target values in binpredicted
(float) Sum of predicted target values in binbin_weight
(float) The weight of the bin. For weighted projects, it is the sum of the weights of the rows in the bin. For unweighted projects, it is the number of rows in the bin.
- Attributes:
- sourcestr
Lift chart data source. Can be ‘validation’, ‘crossValidation’ or ‘holdout’.
- binslist of dict
List of dicts with schema described as
LiftChartBin
above.- source_model_idstr
ID of the model this lift chart represents; in some cases, insights from the parent of a frozen model may be used
- target_classstr, optional
For multiclass lift - target class for this lift chart data.
- data_slice_id: string or None
The slice to retrieve Lift Chart for; if None, retrieve unsliced data.
- classmethod from_server_data(data, keep_attrs=None, use_insights_format=False, **kwargs)
Overwrite APIObject.from_server_data to handle lift chart data retrieved from either legacy URL or /insights/ new URL.
- Parameters:
- datadict
The directly translated dict of JSON from the server. No casing fixes have taken place
- use_insights_formatbool, optional
Whether to repack the data from the format used in the GET /insights/liftChart/ URL to the format used in the legacy URL.