arthurai.datasets.arthur_example.ArthurExample#

class arthurai.datasets.arthur_example.ArthurExample(name, download_destination_folder=None)#

Bases: object

Class for a user to interface with example data for model analysis and using Arthur

Methods

get_dataset

Returns a dataframe of the model's inputs, predictions, ground truth labels, and non input data

get_ground_truth_data

Returns the model's ground truth labels from self.dataset

get_inputs

Returns the model's input attribute feature values from self.dataset

get_non_input_data

Returns the model's non input attributes from self.dataset

get_predictions

Returns the model's predicted values from self.predictions

Attributes

gt_attribute_names

The list of attribute names which make up the model's ground truth attributes Either GroundTruth or GroundTruthClass

input_attribute_names

The list of feature names which make up the model's input attributes

non_input_attribute_names

The list of feature names which make up the model's non-input attributes

pred_attribute_names

The list of feature names which make up the model's predicted attributes

get_dataset(split=False, test_split_size=None)#

Returns a dataframe of the model’s inputs, predictions, ground truth labels, and non input data

Parameters
  • split (bool) – bool, whether to return the data split into train/test.

  • test_split_size (Optional[float]) – the percentage of data to be split into the test set if splitting the data. If None, uses the default test split defined in the example schema.

Return type

Union[DataFrame, Tuple[DataFrame, DataFrame]]

Returns

dataframe of inputs, predictions, ground truth labels, and non input data

get_ground_truth_data(split=False, test_split_size=None, random_state=None)#

Returns the model’s ground truth labels from self.dataset

Parameters
  • split (bool) – bool, whether to return the data split by reference/inference (AKA train/test), or whether to return a single dataframe

  • test_split_size (Optional[float]) – the percentage of data to be split into the test set if splitting the data

  • random_state (Optional[int]) – int, random state for optional split

Return type

Union[DataFrame, Series, Tuple[DataFrame, DataFrame], Tuple[Series, Series]]

Returns

dataframe of model ground truth values

get_inputs(split=False, test_split_size=None, random_state=None)#

Returns the model’s input attribute feature values from self.dataset

Parameters
  • split (bool) – bool, whether to return the data split by reference/inference (AKA train/test), or whether to return a single dataframe

  • test_split_size (Optional[float]) – the percentage of data to be split into the test set if splitting the data

  • random_state (Optional[int]) – int, random state for optional split

Return type

Union[DataFrame, Series, Tuple[DataFrame, DataFrame], Tuple[Series, Series]]

Returns

dataframe of model input features

get_non_input_data(split=False, test_split_size=None, random_state=None)#

Returns the model’s non input attributes from self.dataset

Parameters
  • split (bool) – bool, whether to return the data split by reference/inference (AKA train/test), or whether to return a single dataframe

  • test_split_size (Optional[float]) – the percentage of data to be split into the test set if splitting the data

  • random_state (Optional[int]) – int, random state for optional split

Return type

Union[DataFrame, Series, Tuple[DataFrame, DataFrame], Tuple[Series, Series]]

Returns

dataframe of model non-input attribute data

get_predictions(split=False, test_split_size=None, random_state=None)#

Returns the model’s predicted values from self.predictions

Parameters
  • split (bool) – bool, whether to return the data split by reference/inference (AKA train/test), or whether to return a single dataframe

  • test_split_size (Optional[float]) – the percentage of data to be split into the test set if splitting the data

  • random_state (Optional[int]) – int, random state for optional split

Return type

Union[DataFrame, Series, Tuple[DataFrame, DataFrame], Tuple[Series, Series]]

Returns

dataframe of model prediction data

property gt_attribute_names: List[str]#

The list of attribute names which make up the model’s ground truth attributes Either GroundTruth or GroundTruthClass

Return type

List[str]

Returns

list of ground truth attribute names

property input_attribute_names: List[str]#

The list of feature names which make up the model’s input attributes

Return type

List[str]

Returns

list of input attribute names

property non_input_attribute_names: List[str]#

The list of feature names which make up the model’s non-input attributes

Return type

List[str]

Returns

list of non-input attribute names

property pred_attribute_names: List[str]#

The list of feature names which make up the model’s predicted attributes

Return type

List[str]

Returns

list of predicted attribute names