inferences.inferences#

class Inferences(dataframe: DataFrame, schema: Schema | Any, name: str | None = None)#

Bases: object

A dataset to use for analysis using phoenix. Used to construct a phoenix session via px.launch_app

Parameters:
  • dataframe (pandas.DataFrame) – The pandas dataframe containing the data to analyze

  • schema (phoenix.Schema) – the schema of the dataset. Maps dataframe columns to the appropriate model inference dimensions (features, predictions, actuals).

  • name (str, optional) – The name of the dataset. If not provided, a random name will be generated. Is helpful for identifying the dataset in the application.

Returns:

dataset – The dataset object that can be used in a phoenix session

Return type:

Dataset

Examples

>>> primary_inferences = px.Inferences(
>>>    dataframe=production_dataframe, schema=schema, name="primary"
>>> )
property dataframe: DataFrame#
classmethod from_name(name: str) Inferences#

Retrieves a dataset by name from the file system

classmethod from_open_inference(dataframe: DataFrame) Inferences#
property name: str#
property schema: Schema#
to_disc() None#

writes the data and schema to disc

class OpenInferenceCategory(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

actual = 'actual'#
feature = 'feature'#
id = 'id'#
prediction = 'prediction'#
tag = 'tag'#
timestamp = 'timestamp'#
class OpenInferenceSpecifier(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

default = ''#
embedding = 'embedding'#
label = 'label'#
raw_data = 'raw_data'#
retrieved_document_ids = 'retrieved_document_ids'#
retrieved_document_scores = 'retrieved_document_scores'#
score = 'score'#