whylogs.api.logger.result_set#

Module Contents#

Classes#

ResultSetReader

ResultSet

A holder object for profiling results.

ViewResultSet

A holder object for profiling results.

ProfileResultSet

A holder object for profiling results.

SegmentedResultSet

A holder object for profiling results.

Attributes#

whylogs.api.logger.result_set.logger#
class whylogs.api.logger.result_set.ResultSetReader(reader: whylogs.api.reader.Reader)#
Parameters

reader (whylogs.api.reader.Reader) –

option(**kwargs: Any) ResultSetReader#
Parameters

kwargs (Any) –

Return type

ResultSetReader

read(**kwargs: Any) ResultSet#
Parameters

kwargs (Any) –

Return type

ResultSet

class whylogs.api.logger.result_set.ResultSet#

Bases: whylogs.api.writer.writer._Writable, abc.ABC

A holder object for profiling results.

A whylogs.log call can result in more than one profile. This wrapper class simplifies the navigation among these profiles.

Note that currently we only hold one profile but we’re planning to add other kinds of profiles such as segmented profiles here.

property metadata: Optional[Dict[str, str]]#
Return type

Optional[Dict[str, str]]

property count: int#
Return type

int

property performance_metrics: Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

get_default_path() Optional[str]#
Return type

Optional[str]

static read(multi_profile_file: str) ResultSet#
Parameters

multi_profile_file (str) –

Return type

ResultSet

static reader(name: str = 'local') ResultSetReader#
Parameters

name (str) –

Return type

ResultSetReader

abstract view() Optional[whylogs.core.DatasetProfileView]#
Return type

Optional[whylogs.core.DatasetProfileView]

abstract profile() Optional[whylogs.core.DatasetProfile]#
Return type

Optional[whylogs.core.DatasetProfile]

get_writables() Optional[List[whylogs.api.writer.writer._Writable]]#
Return type

Optional[List[whylogs.api.writer.writer._Writable]]

set_dataset_timestamp(dataset_timestamp: datetime.datetime) None#
Parameters

dataset_timestamp (datetime.datetime) –

Return type

None

add_model_performance_metrics(metrics: whylogs.core.model_performance_metrics.ModelPerformanceMetrics) None#
Parameters

metrics (whylogs.core.model_performance_metrics.ModelPerformanceMetrics) –

Return type

None

add_metric(name: str, metric: whylogs.core.metrics.metrics.Metric) None#
Parameters
Return type

None

abstract merge(other: ResultSet) ResultSet#
Parameters

other (ResultSet) –

Return type

ResultSet

write(path: Optional[str] = None, **kwargs: Any) Tuple[bool, str]#
Parameters
  • path (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, str]

writer(name: str = 'local', **kwargs: Any) WriterWrapper#

Utility method to create a Writer of the specified type

Parameters
  • name (str) –

  • kwargs (Any) –

Return type

WriterWrapper

class whylogs.api.logger.result_set.ViewResultSet(view: whylogs.core.DatasetProfileView)#

Bases: ResultSet

A holder object for profiling results.

A whylogs.log call can result in more than one profile. This wrapper class simplifies the navigation among these profiles.

Note that currently we only hold one profile but we’re planning to add other kinds of profiles such as segmented profiles here.

Parameters

view (whylogs.core.DatasetProfileView) –

property metadata: Optional[Dict[str, str]]#
Return type

Optional[Dict[str, str]]

property count: int#
Return type

int

property performance_metrics: Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

profile() Optional[whylogs.core.DatasetProfile]#
Return type

Optional[whylogs.core.DatasetProfile]

view() Optional[whylogs.core.DatasetProfileView]#
Return type

Optional[whylogs.core.DatasetProfileView]

static zero() ViewResultSet#
Return type

ViewResultSet

merge(other: ResultSet) ViewResultSet#
Parameters

other (ResultSet) –

Return type

ViewResultSet

set_dataset_timestamp(dataset_timestamp: datetime.datetime) None#
Parameters

dataset_timestamp (datetime.datetime) –

Return type

None

get_default_path() Optional[str]#
Return type

Optional[str]

static read(multi_profile_file: str) ResultSet#
Parameters

multi_profile_file (str) –

Return type

ResultSet

static reader(name: str = 'local') ResultSetReader#
Parameters

name (str) –

Return type

ResultSetReader

get_writables() Optional[List[whylogs.api.writer.writer._Writable]]#
Return type

Optional[List[whylogs.api.writer.writer._Writable]]

add_model_performance_metrics(metrics: whylogs.core.model_performance_metrics.ModelPerformanceMetrics) None#
Parameters

metrics (whylogs.core.model_performance_metrics.ModelPerformanceMetrics) –

Return type

None

add_metric(name: str, metric: whylogs.core.metrics.metrics.Metric) None#
Parameters
Return type

None

write(path: Optional[str] = None, **kwargs: Any) Tuple[bool, str]#
Parameters
  • path (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, str]

writer(name: str = 'local', **kwargs: Any) WriterWrapper#

Utility method to create a Writer of the specified type

Parameters
  • name (str) –

  • kwargs (Any) –

Return type

WriterWrapper

class whylogs.api.logger.result_set.ProfileResultSet(profile: whylogs.core.DatasetProfile)#

Bases: ResultSet

A holder object for profiling results.

A whylogs.log call can result in more than one profile. This wrapper class simplifies the navigation among these profiles.

Note that currently we only hold one profile but we’re planning to add other kinds of profiles such as segmented profiles here.

Parameters

profile (whylogs.core.DatasetProfile) –

property metadata: Optional[Dict[str, str]]#
Return type

Optional[Dict[str, str]]

property count: int#
Return type

int

property performance_metrics: Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

profile() Optional[whylogs.core.DatasetProfile]#
Return type

Optional[whylogs.core.DatasetProfile]

view() Optional[whylogs.core.DatasetProfileView]#
Return type

Optional[whylogs.core.DatasetProfileView]

static zero() ProfileResultSet#
Return type

ProfileResultSet

merge(other: ResultSet) ViewResultSet#
Parameters

other (ResultSet) –

Return type

ViewResultSet

get_default_path() Optional[str]#
Return type

Optional[str]

static read(multi_profile_file: str) ResultSet#
Parameters

multi_profile_file (str) –

Return type

ResultSet

static reader(name: str = 'local') ResultSetReader#
Parameters

name (str) –

Return type

ResultSetReader

get_writables() Optional[List[whylogs.api.writer.writer._Writable]]#
Return type

Optional[List[whylogs.api.writer.writer._Writable]]

set_dataset_timestamp(dataset_timestamp: datetime.datetime) None#
Parameters

dataset_timestamp (datetime.datetime) –

Return type

None

add_model_performance_metrics(metrics: whylogs.core.model_performance_metrics.ModelPerformanceMetrics) None#
Parameters

metrics (whylogs.core.model_performance_metrics.ModelPerformanceMetrics) –

Return type

None

add_metric(name: str, metric: whylogs.core.metrics.metrics.Metric) None#
Parameters
Return type

None

write(path: Optional[str] = None, **kwargs: Any) Tuple[bool, str]#
Parameters
  • path (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, str]

writer(name: str = 'local', **kwargs: Any) WriterWrapper#

Utility method to create a Writer of the specified type

Parameters
  • name (str) –

  • kwargs (Any) –

Return type

WriterWrapper

class whylogs.api.logger.result_set.SegmentedResultSet(segments: Dict[str, Dict[whylogs.core.Segment, Union[whylogs.core.DatasetProfile, whylogs.core.DatasetProfileView]]], partitions: Optional[List[whylogs.core.segmentation_partition.SegmentationPartition]] = None, metrics: Optional[Dict[str, Any]] = None, properties: Optional[Dict[str, Any]] = None)#

Bases: ResultSet

A holder object for profiling results.

A whylogs.log call can result in more than one profile. This wrapper class simplifies the navigation among these profiles.

Note that currently we only hold one profile but we’re planning to add other kinds of profiles such as segmented profiles here.

Parameters
property dataset_properties: Optional[Dict[str, Any]]#
Return type

Optional[Dict[str, Any]]

property dataset_metrics: Optional[Dict[str, Any]]#
Return type

Optional[Dict[str, Any]]

property partitions: Optional[List[whylogs.core.segmentation_partition.SegmentationPartition]]#
Return type

Optional[List[whylogs.core.segmentation_partition.SegmentationPartition]]

property count: int#
Return type

int

property model_performance_metric: Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

property metadata: Optional[Dict[str, str]]#
Return type

Optional[Dict[str, str]]

property performance_metrics: Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

profile(segment: Optional[whylogs.core.Segment] = None) Optional[Union[whylogs.core.DatasetProfile, whylogs.core.DatasetProfileView]]#
Parameters

segment (Optional[whylogs.core.Segment]) –

Return type

Optional[Union[whylogs.core.DatasetProfile, whylogs.core.DatasetProfileView]]

get_writables() Optional[List[whylogs.api.writer.writer._Writable]]#
Return type

Optional[List[whylogs.api.writer.writer._Writable]]

get_whylabs_tags() List[whylabs_client.model.segment_tag.SegmentTag]#
Return type

List[whylabs_client.model.segment_tag.SegmentTag]

get_timestamps() List[Optional[datetime.datetime]]#
Return type

List[Optional[datetime.datetime]]

set_dataset_timestamp(dataset_timestamp: datetime.datetime) None#
Parameters

dataset_timestamp (datetime.datetime) –

Return type

None

segments(restrict_to_parition_id: Optional[str] = None) Optional[List[whylogs.core.Segment]]#
Parameters

restrict_to_parition_id (Optional[str]) –

Return type

Optional[List[whylogs.core.Segment]]

segments_in_partition(partition: whylogs.core.segmentation_partition.SegmentationPartition) Optional[Dict[whylogs.core.Segment, Union[whylogs.core.DatasetProfile, whylogs.core.DatasetProfileView]]]#
Parameters

partition (whylogs.core.segmentation_partition.SegmentationPartition) –

Return type

Optional[Dict[whylogs.core.Segment, Union[whylogs.core.DatasetProfile, whylogs.core.DatasetProfileView]]]

view(segment: Optional[whylogs.core.Segment] = None) Optional[whylogs.core.DatasetProfileView]#
Parameters

segment (Optional[whylogs.core.Segment]) –

Return type

Optional[whylogs.core.DatasetProfileView]

get_model_performance_metrics_for_segment(segment: whylogs.core.Segment) Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]#
Parameters

segment (whylogs.core.Segment) –

Return type

Optional[whylogs.core.model_performance_metrics.ModelPerformanceMetrics]

add_metrics_for_segment(metrics: whylogs.core.model_performance_metrics.ModelPerformanceMetrics, segment: whylogs.core.Segment) None#
Parameters
Return type

None

static zero() SegmentedResultSet#
Return type

SegmentedResultSet

add_model_performance_metrics(metrics: whylogs.core.model_performance_metrics.ModelPerformanceMetrics) None#
Parameters

metrics (whylogs.core.model_performance_metrics.ModelPerformanceMetrics) –

Return type

None

add_metric(name: str, metric: whylogs.core.metrics.metrics.Metric) None#
Parameters
Return type

None

merge(other: ResultSet) SegmentedResultSet#
Parameters

other (ResultSet) –

Return type

SegmentedResultSet

get_default_path() Optional[str]#
Return type

Optional[str]

static read(multi_profile_file: str) ResultSet#
Parameters

multi_profile_file (str) –

Return type

ResultSet

static reader(name: str = 'local') ResultSetReader#
Parameters

name (str) –

Return type

ResultSetReader

write(path: Optional[str] = None, **kwargs: Any) Tuple[bool, str]#
Parameters
  • path (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, str]

writer(name: str = 'local', **kwargs: Any) WriterWrapper#

Utility method to create a Writer of the specified type

Parameters
  • name (str) –

  • kwargs (Any) –

Return type

WriterWrapper

whylogs.api.logger.result_set.ResultSetWriter#