class WeakSegmentsPerformance[source]#

Search for segments with low performance scores.

The check is designed to help you easily identify weak spots of your model and provide a deepdive analysis into its performance on different segments of your data. Specifically, it is designed to help you identify the model weakest segments in the data distribution for further improvement and visibility purposes.

The segments are based on the image properties - characteristics of each image such as the contrast.

In order to achieve this, the check trains several simple tree based models which try to predict the error of the user provided model on the dataset. The relevant segments are detected by analyzing the different leafs of the trained trees.

image_propertiesList[Dict[str, Any]], default: None

List of properties. Replaces the default deepchecks properties. Each property is a dictionary with keys 'name' (str), method (Callable) and 'output_type' (str), representing attributes of said method. ‘output_type’ must be one of:

  • 'numerical' - for continuous ordinal outputs.

  • 'categorical' - for discrete, non-ordinal outputs. These can still be numbers, but these numbers do not have inherent value.

For more on image properties, see the guide about Vision Properties.

segment_minimum_size_ratio: float , default: 0.05

Minimum size ratio for segments. Will only search for segments of size >= segment_minimum_size_ratio * data_size.

n_samplesOptional[int] , default: 10_000

number of samples to use for this check.

n_to_showint , default: 3

number of segments with the weakest performance to show.

categorical_aggregation_thresholdfloat , default: 0.05

For each categorical property, categories with frequency below threshold will be merged into “Other” category.

multiple_segments_per_propertybool , default: True

If True, will allow the same property to be a segmenting feature in multiple segments, otherwise each property can appear in one segment at most.

n_samplesOptional[int] , default10000

Number of samples to use for the check. If None, all samples will be used.

__init__(image_properties: Optional[List[Dict[str, Any]]] = None, n_to_show: int = 3, segment_minimum_size_ratio: float = 0.05, n_samples: Optional[int] = 10000, categorical_aggregation_threshold: float = 0.05, multiple_segments_per_property: bool = True, **kwargs)[source]#
__new__(*args, **kwargs)#









WeakSegmentsPerformance.add_condition(name, ...)

Add new condition function to the check.


Add condition - check that the score of the weakest segment is greater than supplied relative threshold.


Remove all conditions from this check instance.

WeakSegmentsPerformance.compute(context, ...)

Find the segments with the worst performance.


Run conditions on given result.


Return check configuration (conditions' configuration not yet supported).

WeakSegmentsPerformance.from_config(conf[, ...])

Return check object from a CheckConfig object.

WeakSegmentsPerformance.from_json(conf[, ...])

Deserialize check instance from JSON string.


Initialize the properties and sample scores states.


Return check metadata.


Name of class in split camel case.


Return parameters to show when printing the check.


Remove given condition by index.

WeakSegmentsPerformance.run(dataset[, ...])

Run check.

WeakSegmentsPerformance.to_json([indent, ...])

Serialize check instance to JSON string.

WeakSegmentsPerformance.update(context, ...)

Calculate the image properties and scores per image.