wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union, cast
      2
      3import attr
      4
      5from ..models.explainability_create_config_json_body_feature_bounds import \
      6    ExplainabilityCreateConfigJsonBodyFeatureBounds
      7from ..types import UNSET, Unset
      8
      9T = TypeVar("T", bound="ExplainabilityCreateConfigJsonBody")
     10
     11@attr.s(auto_attribs=True)
     12class ExplainabilityCreateConfigJsonBody:
     13    """ A configuration for reference and adhoc explainability requests
     14
     15    Attributes:
     16        workspace_id (int):  The users workspace
     17        reference_pipeline_version (str):  The production pipeline to be analyzed
     18        id (Union[Unset, None, str]):
     19        explainability_pipeline_version (Union[Unset, None, str]):  The copy of the production pipeline that will be
     20            used for analysis.
     21        num_points (Union[Unset, None, int]):  How many points to sample for each feature bounds range
     22        feature_names (Union[Unset, None, List[str]]):  Names of features for improved reporting.
     23        feature_bounds (Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]):  Calculated feature bounds
     24        output_names (Union[Unset, None, List[str]]):  The names of the outputs for improved reporting
     25    """
     26
     27    workspace_id: int
     28    reference_pipeline_version: str
     29    id: Union[Unset, None, str] = UNSET
     30    explainability_pipeline_version: Union[Unset, None, str] = UNSET
     31    num_points: Union[Unset, None, int] = UNSET
     32    feature_names: Union[Unset, None, List[str]] = UNSET
     33    feature_bounds: Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds] = UNSET
     34    output_names: Union[Unset, None, List[str]] = UNSET
     35    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     36
     37
     38    def to_dict(self) -> Dict[str, Any]:
     39        workspace_id = self.workspace_id
     40        reference_pipeline_version = self.reference_pipeline_version
     41        id = self.id
     42        explainability_pipeline_version = self.explainability_pipeline_version
     43        num_points = self.num_points
     44        feature_names: Union[Unset, None, List[str]] = UNSET
     45        if not isinstance(self.feature_names, Unset):
     46            if self.feature_names is None:
     47                feature_names = None
     48            else:
     49                feature_names = self.feature_names
     50
     51
     52
     53
     54        feature_bounds: Union[Unset, None, Dict[str, Any]] = UNSET
     55        if not isinstance(self.feature_bounds, Unset):
     56            feature_bounds = self.feature_bounds.to_dict() if self.feature_bounds else None
     57
     58        output_names: Union[Unset, None, List[str]] = UNSET
     59        if not isinstance(self.output_names, Unset):
     60            if self.output_names is None:
     61                output_names = None
     62            else:
     63                output_names = self.output_names
     64
     65
     66
     67
     68
     69        field_dict: Dict[str, Any] = {}
     70        field_dict.update(self.additional_properties)
     71        field_dict.update({
     72            "workspace_id": workspace_id,
     73            "reference_pipeline_version": reference_pipeline_version,
     74        })
     75        if id is not UNSET:
     76            field_dict["id"] = id
     77        if explainability_pipeline_version is not UNSET:
     78            field_dict["explainability_pipeline_version"] = explainability_pipeline_version
     79        if num_points is not UNSET:
     80            field_dict["num_points"] = num_points
     81        if feature_names is not UNSET:
     82            field_dict["feature_names"] = feature_names
     83        if feature_bounds is not UNSET:
     84            field_dict["feature_bounds"] = feature_bounds
     85        if output_names is not UNSET:
     86            field_dict["output_names"] = output_names
     87
     88        return field_dict
     89
     90
     91
     92    @classmethod
     93    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     94        d = src_dict.copy()
     95        workspace_id = d.pop("workspace_id")
     96
     97        reference_pipeline_version = d.pop("reference_pipeline_version")
     98
     99        id = d.pop("id", UNSET)
    100
    101        explainability_pipeline_version = d.pop("explainability_pipeline_version", UNSET)
    102
    103        num_points = d.pop("num_points", UNSET)
    104
    105        feature_names = cast(List[str], d.pop("feature_names", UNSET))
    106
    107
    108        _feature_bounds = d.pop("feature_bounds", UNSET)
    109        feature_bounds: Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]
    110        if _feature_bounds is None:
    111            feature_bounds = None
    112        elif isinstance(_feature_bounds,  Unset):
    113            feature_bounds = UNSET
    114        else:
    115            feature_bounds = ExplainabilityCreateConfigJsonBodyFeatureBounds.from_dict(_feature_bounds)
    116
    117
    118
    119
    120        output_names = cast(List[str], d.pop("output_names", UNSET))
    121
    122
    123        explainability_create_config_json_body = cls(
    124            workspace_id=workspace_id,
    125            reference_pipeline_version=reference_pipeline_version,
    126            id=id,
    127            explainability_pipeline_version=explainability_pipeline_version,
    128            num_points=num_points,
    129            feature_names=feature_names,
    130            feature_bounds=feature_bounds,
    131            output_names=output_names,
    132        )
    133
    134        explainability_create_config_json_body.additional_properties = d
    135        return explainability_create_config_json_body
    136
    137    @property
    138    def additional_keys(self) -> List[str]:
    139        return list(self.additional_properties.keys())
    140
    141    def __getitem__(self, key: str) -> Any:
    142        return self.additional_properties[key]
    143
    144    def __setitem__(self, key: str, value: Any) -> None:
    145        self.additional_properties[key] = value
    146
    147    def __delitem__(self, key: str) -> None:
    148        del self.additional_properties[key]
    149
    150    def __contains__(self, key: str) -> bool:
    151        return key in self.additional_properties

@attr.s(auto_attribs=True)
class ExplainabilityCreateConfigJsonBody: View Source

     12@attr.s(auto_attribs=True)
     13class ExplainabilityCreateConfigJsonBody:
     14    """ A configuration for reference and adhoc explainability requests
     15
     16    Attributes:
     17        workspace_id (int):  The users workspace
     18        reference_pipeline_version (str):  The production pipeline to be analyzed
     19        id (Union[Unset, None, str]):
     20        explainability_pipeline_version (Union[Unset, None, str]):  The copy of the production pipeline that will be
     21            used for analysis.
     22        num_points (Union[Unset, None, int]):  How many points to sample for each feature bounds range
     23        feature_names (Union[Unset, None, List[str]]):  Names of features for improved reporting.
     24        feature_bounds (Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]):  Calculated feature bounds
     25        output_names (Union[Unset, None, List[str]]):  The names of the outputs for improved reporting
     26    """
     27
     28    workspace_id: int
     29    reference_pipeline_version: str
     30    id: Union[Unset, None, str] = UNSET
     31    explainability_pipeline_version: Union[Unset, None, str] = UNSET
     32    num_points: Union[Unset, None, int] = UNSET
     33    feature_names: Union[Unset, None, List[str]] = UNSET
     34    feature_bounds: Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds] = UNSET
     35    output_names: Union[Unset, None, List[str]] = UNSET
     36    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     37
     38
     39    def to_dict(self) -> Dict[str, Any]:
     40        workspace_id = self.workspace_id
     41        reference_pipeline_version = self.reference_pipeline_version
     42        id = self.id
     43        explainability_pipeline_version = self.explainability_pipeline_version
     44        num_points = self.num_points
     45        feature_names: Union[Unset, None, List[str]] = UNSET
     46        if not isinstance(self.feature_names, Unset):
     47            if self.feature_names is None:
     48                feature_names = None
     49            else:
     50                feature_names = self.feature_names
     51
     52
     53
     54
     55        feature_bounds: Union[Unset, None, Dict[str, Any]] = UNSET
     56        if not isinstance(self.feature_bounds, Unset):
     57            feature_bounds = self.feature_bounds.to_dict() if self.feature_bounds else None
     58
     59        output_names: Union[Unset, None, List[str]] = UNSET
     60        if not isinstance(self.output_names, Unset):
     61            if self.output_names is None:
     62                output_names = None
     63            else:
     64                output_names = self.output_names
     65
     66
     67
     68
     69
     70        field_dict: Dict[str, Any] = {}
     71        field_dict.update(self.additional_properties)
     72        field_dict.update({
     73            "workspace_id": workspace_id,
     74            "reference_pipeline_version": reference_pipeline_version,
     75        })
     76        if id is not UNSET:
     77            field_dict["id"] = id
     78        if explainability_pipeline_version is not UNSET:
     79            field_dict["explainability_pipeline_version"] = explainability_pipeline_version
     80        if num_points is not UNSET:
     81            field_dict["num_points"] = num_points
     82        if feature_names is not UNSET:
     83            field_dict["feature_names"] = feature_names
     84        if feature_bounds is not UNSET:
     85            field_dict["feature_bounds"] = feature_bounds
     86        if output_names is not UNSET:
     87            field_dict["output_names"] = output_names
     88
     89        return field_dict
     90
     91
     92
     93    @classmethod
     94    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     95        d = src_dict.copy()
     96        workspace_id = d.pop("workspace_id")
     97
     98        reference_pipeline_version = d.pop("reference_pipeline_version")
     99
    100        id = d.pop("id", UNSET)
    101
    102        explainability_pipeline_version = d.pop("explainability_pipeline_version", UNSET)
    103
    104        num_points = d.pop("num_points", UNSET)
    105
    106        feature_names = cast(List[str], d.pop("feature_names", UNSET))
    107
    108
    109        _feature_bounds = d.pop("feature_bounds", UNSET)
    110        feature_bounds: Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]
    111        if _feature_bounds is None:
    112            feature_bounds = None
    113        elif isinstance(_feature_bounds,  Unset):
    114            feature_bounds = UNSET
    115        else:
    116            feature_bounds = ExplainabilityCreateConfigJsonBodyFeatureBounds.from_dict(_feature_bounds)
    117
    118
    119
    120
    121        output_names = cast(List[str], d.pop("output_names", UNSET))
    122
    123
    124        explainability_create_config_json_body = cls(
    125            workspace_id=workspace_id,
    126            reference_pipeline_version=reference_pipeline_version,
    127            id=id,
    128            explainability_pipeline_version=explainability_pipeline_version,
    129            num_points=num_points,
    130            feature_names=feature_names,
    131            feature_bounds=feature_bounds,
    132            output_names=output_names,
    133        )
    134
    135        explainability_create_config_json_body.additional_properties = d
    136        return explainability_create_config_json_body
    137
    138    @property
    139    def additional_keys(self) -> List[str]:
    140        return list(self.additional_properties.keys())
    141
    142    def __getitem__(self, key: str) -> Any:
    143        return self.additional_properties[key]
    144
    145    def __setitem__(self, key: str, value: Any) -> None:
    146        self.additional_properties[key] = value
    147
    148    def __delitem__(self, key: str) -> None:
    149        del self.additional_properties[key]
    150
    151    def __contains__(self, key: str) -> bool:
    152        return key in self.additional_properties

A configuration for reference and adhoc explainability requests

Attributes: workspace_id (int): The users workspace reference_pipeline_version (str): The production pipeline to be analyzed id (Union[Unset, None, str]): explainability_pipeline_version (Union[Unset, None, str]): The copy of the production pipeline that will be used for analysis. num_points (Union[Unset, None, int]): How many points to sample for each feature bounds range feature_names (Union[Unset, None, List[str]]): Names of features for improved reporting. feature_bounds (Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]): Calculated feature bounds output_names (Union[Unset, None, List[str]]): The names of the outputs for improved reporting

ExplainabilityCreateConfigJsonBody( workspace_id: int, reference_pipeline_version: str, id: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, explainability_pipeline_version: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, num_points: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, int] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, feature_names: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[str]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, feature_bounds: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.explainability_create_config_json_body_feature_bounds.ExplainabilityCreateConfigJsonBodyFeatureBounds] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, output_names: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[str]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

     2def __init__(self, workspace_id, reference_pipeline_version, id=attr_dict['id'].default, explainability_pipeline_version=attr_dict['explainability_pipeline_version'].default, num_points=attr_dict['num_points'].default, feature_names=attr_dict['feature_names'].default, feature_bounds=attr_dict['feature_bounds'].default, output_names=attr_dict['output_names'].default):
     3    self.workspace_id = workspace_id
     4    self.reference_pipeline_version = reference_pipeline_version
     5    self.id = id
     6    self.explainability_pipeline_version = explainability_pipeline_version
     7    self.num_points = num_points
     8    self.feature_names = feature_names
     9    self.feature_bounds = feature_bounds
    10    self.output_names = output_names
    11    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class ExplainabilityCreateConfigJsonBody.

def to_dict(self) -> Dict[str, Any]: View Source

    39    def to_dict(self) -> Dict[str, Any]:
    40        workspace_id = self.workspace_id
    41        reference_pipeline_version = self.reference_pipeline_version
    42        id = self.id
    43        explainability_pipeline_version = self.explainability_pipeline_version
    44        num_points = self.num_points
    45        feature_names: Union[Unset, None, List[str]] = UNSET
    46        if not isinstance(self.feature_names, Unset):
    47            if self.feature_names is None:
    48                feature_names = None
    49            else:
    50                feature_names = self.feature_names
    51
    52
    53
    54
    55        feature_bounds: Union[Unset, None, Dict[str, Any]] = UNSET
    56        if not isinstance(self.feature_bounds, Unset):
    57            feature_bounds = self.feature_bounds.to_dict() if self.feature_bounds else None
    58
    59        output_names: Union[Unset, None, List[str]] = UNSET
    60        if not isinstance(self.output_names, Unset):
    61            if self.output_names is None:
    62                output_names = None
    63            else:
    64                output_names = self.output_names
    65
    66
    67
    68
    69
    70        field_dict: Dict[str, Any] = {}
    71        field_dict.update(self.additional_properties)
    72        field_dict.update({
    73            "workspace_id": workspace_id,
    74            "reference_pipeline_version": reference_pipeline_version,
    75        })
    76        if id is not UNSET:
    77            field_dict["id"] = id
    78        if explainability_pipeline_version is not UNSET:
    79            field_dict["explainability_pipeline_version"] = explainability_pipeline_version
    80        if num_points is not UNSET:
    81            field_dict["num_points"] = num_points
    82        if feature_names is not UNSET:
    83            field_dict["feature_names"] = feature_names
    84        if feature_bounds is not UNSET:
    85            field_dict["feature_bounds"] = feature_bounds
    86        if output_names is not UNSET:
    87            field_dict["output_names"] = output_names
    88
    89        return field_dict

@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T: View Source

     93    @classmethod
     94    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     95        d = src_dict.copy()
     96        workspace_id = d.pop("workspace_id")
     97
     98        reference_pipeline_version = d.pop("reference_pipeline_version")
     99
    100        id = d.pop("id", UNSET)
    101
    102        explainability_pipeline_version = d.pop("explainability_pipeline_version", UNSET)
    103
    104        num_points = d.pop("num_points", UNSET)
    105
    106        feature_names = cast(List[str], d.pop("feature_names", UNSET))
    107
    108
    109        _feature_bounds = d.pop("feature_bounds", UNSET)
    110        feature_bounds: Union[Unset, None, ExplainabilityCreateConfigJsonBodyFeatureBounds]
    111        if _feature_bounds is None:
    112            feature_bounds = None
    113        elif isinstance(_feature_bounds,  Unset):
    114            feature_bounds = UNSET
    115        else:
    116            feature_bounds = ExplainabilityCreateConfigJsonBodyFeatureBounds.from_dict(_feature_bounds)
    117
    118
    119
    120
    121        output_names = cast(List[str], d.pop("output_names", UNSET))
    122
    123
    124        explainability_create_config_json_body = cls(
    125            workspace_id=workspace_id,
    126            reference_pipeline_version=reference_pipeline_version,
    127            id=id,
    128            explainability_pipeline_version=explainability_pipeline_version,
    129            num_points=num_points,
    130            feature_names=feature_names,
    131            feature_bounds=feature_bounds,
    132            output_names=output_names,
    133        )
    134
    135        explainability_create_config_json_body.additional_properties = d
    136        return explainability_create_config_json_body

additional_keys: List[str]