Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1c03d2e
Fix utilsforecast evaluation compatibility
Kushagra7777 Dec 20, 2025
f1bb87e
Add cutoff_col support to mase and forward to mae
Kushagra7777 Jan 7, 2026
d0c4c3d
removed cutoff_col from mae
Kushagra7777 Jan 8, 2026
2c7932f
Fix lint and styling issues
Kushagra7777 Jan 9, 2026
2747f0c
Fix live test flakiness in queryable checks
Kushagra7777 Jan 9, 2026
7869b10
Update timecopilot/utils/experiment_handler.py
Kushagra7777 Jan 9, 2026
2b9c697
Update timecopilot/utils/experiment_handler.py
Kushagra7777 Jan 9, 2026
b79bc2e
Fix ruff lint issues
Kushagra7777 Jan 9, 2026
387e0f5
lint fix
Kushagra7777 Jan 9, 2026
88f1c50
pulling fixes from main (#286)
Kushagra7777 Jan 13, 2026
91c2f6b
Fix test_is_queryable failure
Kushagra7777 Jan 13, 2026
d0829f7
Fix live test failure
Kushagra7777 Jan 13, 2026
1bad91c
Revert "Fix live test failure"
Kushagra7777 Jan 13, 2026
e603847
Fix MASE scaling issues and clean up unused arguments
Kushagra7777 Jan 19, 2026
9f89def
fixing conflicts
Kushagra7777 Jan 19, 2026
f0fa454
pulling from main. (#290)
Kushagra7777 Jan 19, 2026
8fabf75
Apply ruff formatting fixes
Kushagra7777 Jan 19, 2026
7f6ab3a
bad idea removing time_col: str = "ds"
Kushagra7777 Jan 19, 2026
bd51e00
adding tim_col for sorting
Kushagra7777 Jan 26, 2026
820794a
chore: add newest version of utilsforecast
AzulGarza Jan 26, 2026
726da08
fix: add compat with newest version utilsforecast
AzulGarza Jan 26, 2026
452f5a2
fix: update experiment handler tests with mase updates
AzulGarza Jan 26, 2026
95deb75
fix: import directly from utilsforecast
AzulGarza Jan 26, 2026
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
4 changes: 2 additions & 2 deletions docs/examples/agent-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"outputs": [],
"source": [
"import nest_asyncio\n",
"\n",
"nest_asyncio.apply()"
]
},
Expand Down Expand Up @@ -157,11 +158,10 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"tc = TimeCopilot(\n",
" llm=\"openai:gpt-4o\",\n",
" retries=3,\n",
")\n"
")"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/anomaly-detection-forecaster-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
" \"https://timecopilot.s3.amazonaws.com/public/data/the_anomaly_tour.csv\",\n",
" parse_dates=[\"ds\"],\n",
")\n",
"df\n"
"df"
]
},
{
Expand Down Expand Up @@ -222,7 +222,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"tcf = TimeCopilotForecaster(\n",
" models=[\n",
" Chronos(repo_id=\"amazon/chronos-bolt-mini\"),\n",
Expand Down
9 changes: 4 additions & 5 deletions docs/examples/aws-bedrock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"outputs": [],
"source": [
"import nest_asyncio\n",
"\n",
"nest_asyncio.apply()\n",
"\n",
"from timecopilot import TimeCopilot\n",
Expand Down Expand Up @@ -164,7 +165,7 @@
"outputs": [],
"source": [
"tc = TimeCopilot(\n",
" llm='bedrock:us.anthropic.claude-3-5-sonnet-20241022-v2:0',\n",
" llm=\"bedrock:us.anthropic.claude-3-5-sonnet-20241022-v2:0\",\n",
")"
]
},
Expand All @@ -187,9 +188,7 @@
"source": [
"from pydantic_ai.models.bedrock import BedrockConverseModel\n",
"\n",
"model = BedrockConverseModel(\n",
" 'us.anthropic.claude-3-5-sonnet-20241022-v2:0'\n",
")\n",
"model = BedrockConverseModel(\"us.anthropic.claude-3-5-sonnet-20241022-v2:0\")\n",
"tc = TimeCopilot(\n",
" llm=model,\n",
")"
Expand Down Expand Up @@ -219,7 +218,7 @@
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv(\"https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv\")\n"
"df = pd.read_csv(\"https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv\")"
]
},
{
Expand Down
12 changes: 7 additions & 5 deletions docs/examples/chronos-family.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
" \"https://timecopilot.s3.amazonaws.com/public/data/events_pageviews.csv\",\n",
" parse_dates=[\"ds\"],\n",
")\n",
"df.head()\n"
"df.head()"
]
},
{
Expand Down Expand Up @@ -241,7 +241,7 @@
"outputs": [],
"source": [
"level = [20, 40, 60, 80]\n",
"cv_df = tcf.cross_validation(df=df, h=12, level=level) "
"cv_df = tcf.cross_validation(df=df, h=12, level=level)"
]
},
{
Expand Down Expand Up @@ -638,12 +638,14 @@
],
"source": [
"eval_df = evaluate(\n",
" cv_df.drop(columns=[\"cutoff\"]), \n",
" train_df=df.query(\"ds <= '2024-08-31'\"), \n",
" cv_df.drop(columns=[\"cutoff\"]),\n",
" train_df=df.query(\"ds <= '2024-08-31'\"),\n",
" metrics=[partial(mase, seasonality=12), scaled_crps],\n",
" level=level,\n",
")\n",
"eval_df.groupby(\"metric\").mean(numeric_only=True).T.sort_values(by=\"scaled_crps\").round(3)"
"eval_df.groupby(\"metric\").mean(numeric_only=True).T.sort_values(by=\"scaled_crps\").round(\n",
" 3\n",
")"
]
}
],
Expand Down
85 changes: 46 additions & 39 deletions docs/examples/cryptocurrency-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"outputs": [],
"source": [
"files = os.listdir(path)\n",
"files = [path+'/'+x for x in files]"
"files = [path + \"/\" + x for x in files]"
]
},
{
Expand Down Expand Up @@ -198,18 +198,18 @@
"# Read all filez and set them up to the readable structure for timecopilot\n",
"for file in files:\n",
" temp_df = pd.read_csv(file)\n",
" temp_df = temp_df[['Symbol','Date','Close']]\n",
" temp_df.columns = ['unique_id','ds','y']\n",
" big_df = pd.concat([big_df,temp_df])\n",
" temp_df = temp_df[[\"Symbol\", \"Date\", \"Close\"]]\n",
" temp_df.columns = [\"unique_id\", \"ds\", \"y\"]\n",
" big_df = pd.concat([big_df, temp_df])\n",
"\n",
"big_df = big_df.reset_index(drop=True)\n",
"big_df[\"ds\"] = pd.to_datetime(big_df[\"ds\"], dayfirst=True, errors=\"coerce\")\n",
"\n",
"# This line will be kept for execution time sanity, feel free to remove it if you want to stress timing a little further. \n",
"# This line will be kept for execution time sanity, feel free to remove it if you want to stress timing a little further.\n",
"# big_df = big_df[big_df.ds >= \"2021-01-01\"]\n",
"cryptos=['MIOTA','XEM','ETH','LTC','DOGE','CRO','USDC','ADA']\n",
"big_df=big_df[big_df.unique_id.isin(cryptos)]\n",
"big_df=big_df.reset_index(drop=True)\n",
"cryptos = [\"MIOTA\", \"XEM\", \"ETH\", \"LTC\", \"DOGE\", \"CRO\", \"USDC\", \"ADA\"]\n",
"big_df = big_df[big_df.unique_id.isin(cryptos)]\n",
"big_df = big_df.reset_index(drop=True)\n",
"big_df"
]
},
Expand Down Expand Up @@ -341,6 +341,7 @@
" df_out.loc[idx, col] = np.nan\n",
" return df_out\n",
"\n",
"\n",
"df_missing = add_missing(big_df, col=\"y\", frac=0.03, seed=42)\n",
"df_missing = df_missing.sample(frac=1, random_state=42).reset_index(drop=True)\n",
"print(df_missing)"
Expand Down Expand Up @@ -709,12 +710,14 @@
}
],
"source": [
"anomaly_summary_xlm=anomalies_df[\n",
"anomaly_summary_xlm = anomalies_df[\n",
" # (anomalies_df.unique_id=='SOL') & \\\n",
" ((anomalies_df['Chronos-anomaly']==True) | \\\n",
" (anomalies_df['SeasonalNaive-anomaly']==True) |\n",
" (anomalies_df['Theta-anomaly']==True)\n",
" )].reset_index(drop=True)\n",
" (\n",
" (anomalies_df[\"Chronos-anomaly\"] == True)\n",
" | (anomalies_df[\"SeasonalNaive-anomaly\"] == True)\n",
" | (anomalies_df[\"Theta-anomaly\"] == True)\n",
" )\n",
"].reset_index(drop=True)\n",
"anomaly_summary_xlm"
]
},
Expand Down Expand Up @@ -954,12 +957,14 @@
}
],
"source": [
"anomaly_summary_xlm=anomalies_df[\n",
" (anomalies_df.unique_id=='ADA') & \\\n",
" ((anomalies_df['Chronos-anomaly']==True) | \\\n",
" (anomalies_df['SeasonalNaive-anomaly']==True) |\n",
" (anomalies_df['Theta-anomaly']==True)\n",
" )].reset_index(drop=True)\n",
"anomaly_summary_xlm = anomalies_df[\n",
" (anomalies_df.unique_id == \"ADA\")\n",
" & (\n",
" (anomalies_df[\"Chronos-anomaly\"] == True)\n",
" | (anomalies_df[\"SeasonalNaive-anomaly\"] == True)\n",
" | (anomalies_df[\"Theta-anomaly\"] == True)\n",
" )\n",
"].reset_index(drop=True)\n",
"anomaly_summary_xlm"
]
},
Expand Down Expand Up @@ -1199,12 +1204,14 @@
}
],
"source": [
"anomaly_summary_xlm=anomalies_df[\n",
" (anomalies_df.unique_id=='ADA') & \\\n",
" ((anomalies_df['Chronos-anomaly']==True) & \\\n",
" (anomalies_df['SeasonalNaive-anomaly']==True) \\\n",
" # (anomalies_df['Theta-anomaly']==True)\n",
" )].reset_index(drop=True)\n",
"anomaly_summary_xlm = anomalies_df[\n",
" (anomalies_df.unique_id == \"ADA\")\n",
" & (\n",
" (anomalies_df[\"Chronos-anomaly\"] == True)\n",
" & (anomalies_df[\"SeasonalNaive-anomaly\"] == True)\n",
" # (anomalies_df['Theta-anomaly']==True)\n",
" )\n",
"].reset_index(drop=True)\n",
"anomaly_summary_xlm"
]
},
Expand Down Expand Up @@ -1241,12 +1248,12 @@
"source": [
"tcf1 = TimeCopilotForecaster(\n",
" models=[\n",
" AutoARIMA(), \n",
" AutoARIMA(),\n",
" Chronos(repo_id=\"amazon/chronos-bolt-mini\"),\n",
" Theta(),\n",
" AutoETS(), \n",
" Moirai(), \n",
" Prophet(), \n",
" AutoETS(),\n",
" Moirai(),\n",
" Prophet(),\n",
" SeasonalNaive(),\n",
" ]\n",
")"
Expand All @@ -1259,7 +1266,7 @@
"metadata": {},
"outputs": [],
"source": [
"fcst_df = tcf1.forecast(df=big_df, h=30, level=[80,90])"
"fcst_df = tcf1.forecast(df=big_df, h=30, level=[80, 90])"
]
},
{
Expand Down Expand Up @@ -1303,9 +1310,9 @@
"metadata": {},
"outputs": [],
"source": [
"eth_fcst_normal=fcst_df[(fcst_df.unique_id=='ETH')]\\\n",
" [['unique_id','ds','Chronos','Chronos-lo-80']]\\\n",
" .reset_index(drop=True)"
"eth_fcst_normal = fcst_df[(fcst_df.unique_id == \"ETH\")][\n",
" [\"unique_id\", \"ds\", \"Chronos\", \"Chronos-lo-80\"]\n",
"].reset_index(drop=True)"
]
},
{
Expand Down Expand Up @@ -1345,9 +1352,9 @@
"metadata": {},
"outputs": [],
"source": [
"eth_fcst_missing=fcst_df[(fcst_df.unique_id=='ETH')]\\\n",
" [['unique_id','ds','Chronos','Chronos-lo-80']]\\\n",
" .reset_index(drop=True)"
"eth_fcst_missing = fcst_df[(fcst_df.unique_id == \"ETH\")][\n",
" [\"unique_id\", \"ds\", \"Chronos\", \"Chronos-lo-80\"]\n",
"].reset_index(drop=True)"
]
},
{
Expand Down Expand Up @@ -1515,9 +1522,9 @@
}
],
"source": [
"compare=eth_fcst_normal.merge(eth_fcst_missing,on=['ds','unique_id'])\n",
"compare['dif']=abs(compare['Chronos_x']-compare['Chronos_y'])\n",
"print(compare['dif'].sum())"
"compare = eth_fcst_normal.merge(eth_fcst_missing, on=[\"ds\", \"unique_id\"])\n",
"compare[\"dif\"] = abs(compare[\"Chronos_x\"] - compare[\"Chronos_y\"])\n",
"print(compare[\"dif\"].sum())"
]
},
{
Expand Down
11 changes: 5 additions & 6 deletions docs/examples/forecaster-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
" \"https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv\",\n",
" parse_dates=[\"ds\"],\n",
")\n",
"df.head()\n"
"df.head()"
]
},
{
Expand Down Expand Up @@ -170,13 +170,12 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"tcf = TimeCopilotForecaster(\n",
" models=[\n",
" AutoARIMA(), \n",
" AutoETS(), \n",
" Moirai(), \n",
" Prophet(), \n",
" AutoARIMA(),\n",
" AutoETS(),\n",
" Moirai(),\n",
" Prophet(),\n",
" SeasonalNaive(),\n",
" ]\n",
")"
Expand Down
Loading