A code-first side lane for users who want the brief, editor, and diagnostics on one screen while the guided empirical workflow stays intact.
Editor
Generated notebook cells first, full script view second. Keep the notebook logic visible before you move into a single file or remote execution.
Cell 1
Load raw data
Why use load raw dataNotebook work is easier to trust when the raw target and the source assumptions are visible first.
Start from the staged session and make the raw frame explicit before you touch transforms or model choices.
import pandas as pd
from statsmodels.tsa.stattools import acf, pacf
SERIES_IDS = [
"replace-with-series-id"
]
SERIES_LABELS = [
"Your staged series"
]
SOURCE_MODE = "connect"
# Replace this stub with the connected provider pull or uploaded dataframe when execution is wired.
raw_frame = pd.DataFrame()
target_column = raw_frame.columns[0] if len(raw_frame.columns) > 0 else 'target'
Load preview
Source mode: connect
Series staged: 0
Primary target: Your staged series
This preview is generated from the staged session. Remote execution still comes later.
Source mode
connect
Series staged
0
Primary target
No staged target
Session frame
No live or uploaded frame is staged yet. Connect a provider series or upload a dataset to populate the notebook frame.
Cell 2
Transform target
Why use transform targetThe transform layer is where a lot of model confusion starts. Writing it down makes the target explicit.
Carry the review posture into code so the machine-facing target is visible before you fit anything.
session_transforms = {
"logTransform": false,
"growthTransform": "none",
"detrendMethod": "none",
"seasonalAdjustment": "keep",
"missingValuePolicy": "warn",
"frequencyHarmonization": "none"
}
analysis_frame = raw_frame.copy()
if session_transforms['logTransform']:
analysis_frame = analysis_frame.where(analysis_frame > 0).apply('log') # Replace with np.log when execution is wired.
if session_transforms['growthTransform'] != 'none':
analysis_frame = analysis_frame.pct_change()
analysis_frame = analysis_frame.dropna()
Cell 3
Diagnose series
Why use diagnose seriesThis is the notebook step where you decide whether the target is persistent, seasonal, over-transformed, or still unstable.
Read the target like a forecaster before you commit to the baseline model.
analysis_target = analysis_frame.iloc[:, 0].dropna()
raw_target = raw_frame.iloc[:, 0].dropna() if not raw_frame.empty else analysis_target
acf_preview = acf(analysis_target, nlags=min(12, len(analysis_target) - 1)) if len(analysis_target) > 12 else []
pacf_preview = pacf(analysis_target, nlags=min(12, len(analysis_target) - 1)) if len(analysis_target) > 12 else []
diagnostic_notes = [
"Stage a provider series or upload a dataset so the notebook can inherit a real macro frame.",
"Compare the raw series against the transformed target before locking the model.",
"Keep the holdout rule visible while reading the diagnostics.",
]
Cell 4
Fit baseline
Why use fit baselineThe first fit cell should make the baseline concrete while keeping the assumptions easy to challenge.
Write the first model cell as if you were about to evaluate it, not as if the class choice were already settled.
from statsmodels.tsa.arima.model import ARIMA
analysis_target = analysis_frame.iloc[:, 0].dropna()
# Replace the fallback order with the evaluated order or the machine recommendation.
baseline_model = ARIMA(analysis_target, order=(1, 1, 1))
baseline_fit = baseline_model.fit()
forecast = baseline_fit.forecast(steps=6)
Connect a series firstRemote execution and package sandboxing come next. This pass makes the notebook logic explicit first and keeps the code surface local.