Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions timecopilot/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,15 @@ async def tsfeatures_tool(
ctx: RunContext[ExperimentDataset],
features: list[str],
) -> str:
"""Calculate time series features to help understand the characteristics
of the time series data

Args:
features: List of feature names to calculate from available TSFEATURES

Returns:
Text representation of calculated features.
"""
callable_features = []
for feature in features:
if feature not in TSFEATURES:
Expand Down Expand Up @@ -964,6 +973,15 @@ async def cross_validation_tool(
ctx: RunContext[ExperimentDataset],
models: list[str],
) -> str:
"""Perform cross-validation to evaluate and compare multiple forecasting
models.

Args:
models: List of model names to evaluate using cross-validation.

Returns:
Text representation of evaluation metrics for the models.
"""
callable_models = []
for str_model in models:
if str_model not in self.forecasters:
Expand Down Expand Up @@ -995,6 +1013,14 @@ async def forecast_tool(
ctx: RunContext[ExperimentDataset],
model: str,
) -> str:
"""Generate forecast using specified forecasting model.

Args:
model: Name of the forecasting model to use.

Returns:
Text representation of the generated forecast.
"""
callable_model = self.forecasters[model]
forecaster = TimeCopilotForecaster(models=[callable_model])
fcst_df = forecaster.forecast(
Expand Down