Understand the fundamental concepts behind the Plexe Python library.
plexe
) provides a powerful way to build machine learning models using natural language. Understanding these core concepts will help you use it effectively.
plexe.Model
)Model
object represents a machine learning task and, once built, the resulting trained model.
Model
by specifying its intent
and optionally its input_schema
, output_schema
, and constraints
.Model
progresses through states: DRAFT
(initial), BUILDING
(during build()
call), READY
(successfully built), ERROR
(build failed).build()
method triggers the agentic workflow to generate, train, and evaluate the model based on the intent and provided data.predict()
method uses the trained model (once READY
) to make predictions on new data.save_model()
and load_model()
allow you to store and retrieve trained models.intent
is a natural language string describing what you want the machine learning model to do. It’s the primary instruction given to the Plexe agent system.
"Predict the likelihood of customer churn based on their recent activity and subscription plan."
input_schema
, output_schema
)datasets
supplied during the build
call, using LLM analysis to identify the likely target variable(s). Explicitly defining schemas is often more reliable.model.build()
)datasets
(list of Pandas DataFrames or DatasetGenerator
objects) and a provider
configuration (LLM to use). Optional arguments include max_iterations
, timeout
, callbacks
, etc.PlexeAgent
): Internally, build
invokes a multi-agent system (PlexeAgent
) comprising specialized roles:
max_iterations
) to find the best model according to the selected performance metric. Each attempt involves planning, code generation, execution, and evaluation.Model
object’s state (READY
or ERROR
), populates its predictor
, metric
, metadata
, artifacts
, and source code attributes.provider
, ProviderConfig
)"openai/gpt-4o-mini"
or "anthropic/claude-3-haiku-20240307"
. Uses this model for most agent tasks.ProviderConfig
Object: Allows assigning different models to different agent roles (Orchestrator, Researcher, Engineer, Ops, Tool) for fine-grained control over cost and capability.datasets
, DatasetGenerator
)model.build()
as a list containing Pandas DataFrames.DatasetGenerator
: A class (plexe.DatasetGenerator
) can be used to define requirements for a dataset, including generating synthetic data based on a schema or augmenting existing data using an LLM provider. Pass instances of this class in the datasets
list if needed.plexe.Callback
, MLFlowCallback
)build()
process lifecycle (on_build_start
, on_iteration_start
, on_iteration_end
, on_build_end
).
MLFlowCallback
for easy integration with MLflow tracking. The ChainOfThoughtModelCallback
provides verbose agent step logging when chain_of_thought=True
is set in build()
.plexe.Callback
.plexe.Constraint
)condition
function that takes input and output data and returns a boolean&
for AND, |
for OR, ~
for NOT)