whylogs.core.feature_weights#

Module Contents#

Classes#

FeatureWeights

A Writable is an object that contains data to write to a file or files.

class whylogs.core.feature_weights.FeatureWeights(weights: Dict[str, float], segment: Optional[whylogs.core.Segment] = None, metadata: Optional[Dict] = None)#

Bases: whylogs.api.writer.writer.Writable

A Writable is an object that contains data to write to a file or files. These might be temporary files intended to be passed on to another consumer (e.g., WhyLabs servers) via a Writer.

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

Writes the Writable’s data to file(s) under path (excluding filename(s)) if specified, else under _get_default_path(). filename specifies the file to write there. Writables can generate a default filename if None is specified. Returns a bool that’s True iff all files were written successfully and a list of the filenames (including path) written.

Parameters
  • path (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, Union[str, List[str]]]

to_json() str#
Return type

str

to_dict() Dict[str, Union[Optional[whylogs.core.Segment], Optional[float]]]#
Return type

Dict[str, Union[Optional[whylogs.core.Segment], Optional[float]]]

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