@@ -8,117 +8,180 @@ The simplest way to use Vectrix. One function call for each task.
88
99## Functions
1010
11- ### ` forecast(data, date=None, value=None, steps=30, frequency='auto', verbose=False) `
11+ ### ` forecast() `
12+
13+ ``` python
14+ forecast(
15+ data, # str | DataFrame | ndarray | list | Series | dict
16+ date = None , # str — date column name
17+ value = None , # str — value column name
18+ steps = 30 , # int — forecast horizon
19+ verbose = False , # bool
20+ models = None , # list[str] | None — model IDs to evaluate
21+ ensemble = None , # str | None — 'mean', 'weighted', 'median', 'best'
22+ confidence = 0.95 # float — 0.80, 0.90, 0.95, 0.99
23+ ) -> EasyForecastResult
24+ ```
25+
26+ ** Available model IDs:** ` 'dot' ` , ` 'auto_ets' ` , ` 'auto_arima' ` , ` 'auto_ces' ` , ` 'four_theta' ` , ` 'auto_mstl' ` , ` 'tbats' ` , ` 'theta' ` , ` 'dtsf' ` , ` 'esn' ` , ` 'garch' ` , ` 'croston' ` , ` 'ets_aan' ` , ` 'ets_aaa' ` , ` 'naive' ` , ` 'mean' ` , ` 'rwd' ` , ` 'window_avg' ` , ` 'egarch' ` , ` 'gjr_garch' ` , ` 'seasonal_naive' ` , ` 'mstl' `
27+
28+ ### ` analyze() `
29+
30+ ``` python
31+ analyze(
32+ data, # str | DataFrame | ndarray | list | Series | dict
33+ date = None , # str
34+ value = None , # str
35+ period = None , # int | None — seasonal period (auto if None)
36+ features = True , # bool
37+ changepoints = True , # bool
38+ anomalies = True , # bool
39+ anomalyThreshold = 3.0 # float — z-score threshold
40+ ) -> EasyAnalysisResult
41+ ```
42+
43+ ### ` regress() `
44+
45+ ``` python
46+ regress(
47+ y = None , # ndarray | Series | None (direct mode)
48+ X = None , # ndarray | DataFrame | None (direct mode)
49+ data = None , # DataFrame | None (formula mode)
50+ formula = None , # str | None — "y ~ x1 + x2"
51+ method = ' ols' , # str — 'ols', 'ridge', 'lasso', 'huber', 'quantile'
52+ summary = True , # bool — auto-print summary
53+ alpha = None , # float | None — regularization strength
54+ diagnostics = False # bool — auto-run diagnostics
55+ ) -> EasyRegressionResult
56+ ```
57+
58+ ### ` compare() `
59+
60+ ``` python
61+ compare(
62+ data, # str | DataFrame | ndarray | list | Series | dict
63+ date = None , # str
64+ value = None , # str
65+ steps = 30 , # int
66+ verbose = False , # bool
67+ models = None # list[str] | None
68+ ) -> pd.DataFrame # Returns DataFrame directly, NOT a Result object
69+ ```
70+
71+ ** Returned DataFrame columns:** ` model ` , ` mape ` , ` rmse ` , ` mae ` , ` smape ` , ` time_ms ` , ` selected `
72+
73+ ### ` quickReport() `
74+
75+ ``` python
76+ quickReport(
77+ data, date = None , value = None , steps = 30
78+ ) -> dict # Returns dict, NOT a Result object
79+ ```
80+
81+ ** Returned dict keys:** ` 'forecast' ` (EasyForecastResult), ` 'analysis' ` (EasyAnalysisResult), ` 'summary' ` (str)
82+
83+ ** Alias:** ` quick_report ` = ` quickReport ` (backward compatibility)
84+
85+ ### ` loadSample() `
86+
87+ ``` python
88+ loadSample(name: str ) -> pd.DataFrame
89+ ```
1290
13- One-call forecasting with automatic model selection.
14-
15- ** Parameters:**
16- - ` data ` — Input data (list, ndarray, Series, DataFrame, dict, or CSV path)
17- - ` date ` — Date column name (optional, auto-detected)
18- - ` value ` — Value column name (optional, auto-detected)
19- - ` steps ` — Number of forecast steps (default: 30)
20- - ` frequency ` — Frequency hint (default: ` 'auto' ` , auto-detected)
21- - ` verbose ` — Print progress (default: False)
22-
23- ** Returns:** ` EasyForecastResult `
24-
25- ### ` analyze(data, date=None, value=None, period=None) `
26-
27- Time series DNA profiling, changepoint detection, anomaly identification.
28-
29- ** Parameters:**
30- - ` data ` — Input data (same formats as forecast)
31- - ` date ` — Date column name (optional)
32- - ` value ` — Value column name (optional)
33- - ` period ` — Seasonal period (optional, auto-detected)
34-
35- ** Returns:** ` EasyAnalysisResult `
36-
37- ### ` regress(y=None, X=None, data=None, formula=None, method="ols", **kwargs) `
38-
39- R-style formula regression with full diagnostics.
40-
41- ** Parameters:**
42- - ` y ` — Dependent variable (ndarray)
43- - ` X ` — Independent variables (ndarray)
44- - ` data ` — DataFrame (use with formula)
45- - ` formula ` — R-style formula string (e.g. ` "y ~ x1 + x2" ` )
46- - ` method ` — ` "ols" ` , ` "ridge" ` , ` "lasso" ` , ` "huber" ` , ` "quantile" `
47- - ` summary ` — Print summary automatically (default: True)
48-
49- ** Returns:** ` EasyRegressionResult `
50-
51- ### ` compare(data, date=None, value=None, steps=30, verbose=False) `
52-
53- Compare all models on the given data and return a ranked DataFrame.
54-
55- ** Returns:** ` DataFrame ` — Models ranked by accuracy (sMAPE, MAPE, RMSE, MAE)
56-
57- ### ` quick_report(data, date=None, value=None, steps=30) `
91+ Load a built-in sample dataset.
5892
59- Combined analysis + forecast report generation.
93+ ** Available samples: ** ` 'airline' ` , ` 'retail' ` , ` 'stock' ` , ` 'temperature' ` , ` 'energy' ` , ` 'web' ` , ` 'intermittent' `
6094
61- ** Returns:** ` Dict[str, Any] ` — Report dictionary with ` 'summary' ` , ` 'forecast' ` , ` 'analysis' ` keys
95+ | Sample | date col | value col |
96+ | --------| ----------| -----------|
97+ | airline | date | passengers |
98+ | retail | date | sales |
99+ | stock | date | close |
100+ | temperature | date | temperature |
101+ | energy | date | consumption_kwh |
102+ | web | date | pageviews |
103+ | intermittent | date | demand |
62104
63105### ` listSamples() `
64106
65- List available built-in sample datasets.
66-
67- ** Returns:** ` DataFrame ` — Dataset names and descriptions
68-
69- ### ` loadSample(name) `
70-
71- Load a built-in sample dataset.
72-
73- ** Parameters:**
74- - ` name ` — Dataset name (e.g. ` "airline" ` , ` "retail" ` , ` "stock" ` )
107+ ``` python
108+ listSamples() -> pd.DataFrame
109+ ```
75110
76- ** Returns: ** ` DataFrame `
111+ List available built-in sample datasets.
77112
78113## Result Classes
79114
80115### EasyForecastResult
81116
117+ ** Attributes:**
118+
82119| Attribute | Type | Description |
83120| ---| ---| ---|
84121| ` .predictions ` | ` np.ndarray ` | Forecast values |
85- | ` .dates ` | ` list ` | Forecast date strings |
86- | ` .lower ` | ` np.ndarray ` | 95% lower bound |
87- | ` .upper ` | ` np.ndarray ` | 95% upper bound |
88- | ` .model ` | ` str ` | Selected model name |
89- | ` .mape ` | ` float ` | Validation MAPE (%) |
90- | ` .rmse ` | ` float ` | Validation RMSE |
91- | ` .mae ` | ` float ` | Validation MAE |
92- | ` .smape ` | ` float ` | Validation sMAPE |
93- | ` .models ` | ` list ` | All evaluated model names |
94- | ` .compare() ` | ` DataFrame ` | All models ranked by MAPE |
95- | ` .all_forecasts() ` | ` DataFrame ` | Every model's predictions |
96- | ` .summary() ` | ` str ` | Formatted text summary |
97- | ` .to_dataframe() ` | ` DataFrame ` | date, prediction, lower95, upper95 |
98- | ` .to_csv(path) ` | ` self ` | Save to CSV |
99- | ` .to_json(path) ` | ` str ` | Save to JSON |
100- | ` .describe() ` | ` DataFrame ` | Pandas-style statistics |
122+ | ` .dates ` | ` list[str] ` | Forecast dates |
123+ | ` .lower ` | ` np.ndarray ` | Lower CI |
124+ | ` .upper ` | ` np.ndarray ` | Upper CI |
125+ | ` .model ` | ` str ` | Best model name |
126+ | ` .mape ` | ` float ` | MAPE % |
127+ | ` .rmse ` | ` float ` | RMSE |
128+ | ` .mae ` | ` float ` | MAE |
129+ | ` .smape ` | ` float ` | sMAPE |
130+ | ` .models ` | ` list[str] ` | All valid model names (sorted by MAPE) |
131+
132+ ** Methods:**
133+
134+ | Method | Alias | Returns | Description |
135+ | --------| -------| ---------| -------------|
136+ | ` summary() ` | — | ` str ` | Text summary |
137+ | ` toDataframe() ` | ` to_dataframe() ` | ` DataFrame ` | date, prediction, lower95, upper95 |
138+ | ` compare() ` | — | ` DataFrame ` | All models ranked by MAPE |
139+ | ` allForecasts() ` | ` all_forecasts() ` | ` DataFrame ` | date + one col per model |
140+ | ` describe() ` | — | ` DataFrame ` | ` .describe() ` style stats |
141+ | ` toCsv(path) ` | ` to_csv(path) ` | ` self ` | Save to CSV |
142+ | ` toJson(path=None) ` | ` to_json(path=None) ` | ` str ` | JSON string or save to file |
143+ | ` save(path) ` | — | ` self ` | Alias for ` toJson(path) ` |
144+ | ` plot() ` | — | ` Figure ` | matplotlib plot (optional dep) |
101145
102146### EasyAnalysisResult
103147
104148| Attribute | Type | Description |
105149| ---| ---| ---|
106150| ` .dna ` | ` DNAProfile ` | DNA profile object |
107- | ` .changepoints ` | ` np.ndarray ` | Changepoint indices |
108- | ` .anomalies ` | ` np.ndarray ` | Anomaly indices |
109- | ` .features ` | ` dict ` | Extracted features |
110- | ` .characteristics ` | ` DataCharacteristics ` | Data properties |
151+ | ` .changepoints ` | ` np.ndarray ` | Changepoint ** int indices** (NOT dicts) |
152+ | ` .anomalies ` | ` np.ndarray ` | Anomaly ** int indices** (NOT dicts) |
153+ | ` .features ` | ` dict ` | Statistical features dict |
154+ | ` .characteristics ` | ` DataCharacteristics ` | Data characteristics |
111155| ` .summary() ` | ` str ` | Formatted report |
112156
157+ !!! warning "anomalies/changepoints are int arrays"
158+ ```python
159+ # CORRECT
160+ for idx in analysis.anomalies:
161+ print(f"Anomaly at index {idx}")
162+
163+ # WRONG — will crash
164+ for a in analysis.anomalies:
165+ print(a['index'], a['value']) # TypeError!
166+ ```
167+
113168### EasyRegressionResult
114169
115- | Attribute | Type | Description |
116- | ---| ---| ---|
117- | ` .coefficients ` | ` np.ndarray ` | Regression coefficients |
118- | ` .pvalues ` | ` np.ndarray ` | P-values |
119- | ` .r_squared ` | ` float ` | R² |
120- | ` .adj_r_squared ` | ` float ` | Adjusted R² |
121- | ` .f_stat ` | ` float ` | F-statistic |
122- | ` .summary() ` | ` str ` | Regression table |
123- | ` .diagnose() ` | ` str ` | Full diagnostics |
124- | ` .predict(X) ` | ` DataFrame ` | Predictions with intervals |
170+ ** Attributes (camelCase primary, snake_case aliases):**
171+
172+ | Primary | Alias | Type | Description |
173+ | ---------| -------| ------| -------------|
174+ | ` coefficients ` | — | ` np.ndarray ` | Including intercept |
175+ | ` pvalues ` | — | ` np.ndarray ` | P-values |
176+ | ` rSquared ` | ` r_squared ` | ` float ` | R² |
177+ | ` adjRSquared ` | ` adj_r_squared ` | ` float ` | Adjusted R² |
178+ | ` fStat ` | ` f_stat ` | ` float ` | F-statistic |
179+ | ` durbinWatson ` | ` durbin_watson ` | ` float ` | Durbin-Watson statistic |
180+
181+ ** Methods:**
182+
183+ | Method | Returns | Description |
184+ | --------| ---------| -------------|
185+ | ` summary() ` | ` str ` | Regression summary table |
186+ | ` diagnose() ` | ` str ` | Full diagnostics report |
187+ | ` predict(X, interval, alpha) ` | ` DataFrame ` | Predictions with intervals |
0 commit comments