Skip to main content
This page provides comprehensive reference documentation for the core classes and functions in the Plexe Python library.

Core Classes

Model

The primary class in the Plexe library, representing a machine learning model.
Parameters: Methods:

build

Builds the model using the provided datasets and configuration. Parameters: Returns: None Note: At least one of timeout or max_iterations must be provided.

predict

Makes a prediction using the trained model. Parameters: Returns: Dict[str, Any] - Prediction result

get_state

Returns the current state of the model. Returns: str representing model state: "draft", "building", "ready", or "error"

get_metadata

Returns metadata about the model. Returns: Dictionary containing metadata

get_metrics

Returns metrics for the trained model if available. Returns: Dictionary containing metrics or None

describe

Returns a detailed description of the model. Returns: ModelDescription object

DatasetGenerator

Class for generating synthetic data or augmenting existing data.
Constructor Parameters: Methods:

Callback

Base class for callbacks that monitor the build process.
See Callbacks Reference for more details.

Constraint

Represents rules or conditions that the model should satisfy.
Parameters:

Core Functions

save_model

Saves a trained model to a tar archive. Parameters: Returns: str - Path where the model was saved

load_model

Instantiate a model from a tar archive. Parameters: Returns: Model - The loaded model

configure_logging

Configures logging for the Plexe library. Parameters: Returns: None

Enums and Constants

ModelState

Enum representing the possible states of a model. The get_state() method returns the string value.
Note: When checking model state, compare against the string values:

Provider Configuration

ProviderConfig

Class for configuring different LLM providers for different agent roles (imported from plexe.internal.common.provider).
Parameters:

Performance Metrics

Metric

Class representing a performance metric for a model.
Parameters:

MetricComparator

Encapsulates comparison logic for metrics.
Parameters:

Type Hints

The library uses the following type hints:

Usage Example

For more details on specific components, see the other reference sections: