

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/mustafaslanCoto/peshbeen/blob/main/peshbeen/models/naive.py#L15"
target="_blank" style="float:right; font-size:smaller">source</a>

### naive

``` python

def naive(
    target_col:str, # Name of the target variable column.
    season_period:Optional[int]=None, # Seasonal period ``m``.  ``None`` selects the non-seasonal naïve method.  When provided and the training series is shorter than ``m``, ``forecast`` returns an array of ``NaN``.
    box_cox:Union[bool, float]=False, # Whether to apply Box-Cox transformation to the target variable. If a float value is provided, it will be used as the lambda parameter for the Box-Cox transformation. If True, the lambda parameter will be estimated from the data.
    box_cox_biasadj:bool=False, # Bias adjustment when inverting the manual Box-Cox on forecasts.
)->None:

```

*Naïve forecaster.*

Two modes controlled by `season_period`:

- **Non-seasonal** (`season_period=None`): every forecast step repeats
  the last observed value in the training series.
- **Seasonal** (`season_period=m`): forecast values are taken from the
  last complete season and cycled forward — i.e. step `h` is predicted
  by `y[T - m + ((h-1) % m)]`, where `T` is the last training index.

<table>
<colgroup>
<col style="width: 6%" />
<col style="width: 25%" />
<col style="width: 34%" />
<col style="width: 34%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>target_col</td>
<td>str</td>
<td></td>
<td>Name of the target variable column.</td>
</tr>
<tr>
<td>season_period</td>
<td>Optional[int]</td>
<td>None</td>
<td>Seasonal period <code>m</code>. <code>None</code> selects the
non-seasonal naïve method. When provided and the training series is
shorter than <code>m</code>, <code>forecast</code> returns an array of
<code>NaN</code>.</td>
</tr>
<tr>
<td>box_cox</td>
<td>Union[bool, float]</td>
<td>False</td>
<td>Whether to apply Box-Cox transformation to the target variable. If a
float value is provided, it will be used as the lambda parameter for the
Box-Cox transformation. If True, the lambda parameter will be estimated
from the data.</td>
</tr>
<tr>
<td>box_cox_biasadj</td>
<td>bool</td>
<td>False</td>
<td>Bias adjustment when inverting the manual Box-Cox on forecasts.</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>None</strong></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

------------------------------------------------------------------------

<a
href="https://github.com/mustafaslanCoto/peshbeen/blob/main/peshbeen/models/naive.py#L102"
target="_blank" style="float:right; font-size:smaller">source</a>

### naive.fit

``` python

def fit(
    df:pd.DataFrame, # Training DataFrame containing the target column.
)->None:

```

*Store the values needed for naïve forecasting.*

No statistical model is estimated. `fit` simply applies `data_prep` and
records the training series so that `forecast` can replicate the correct
naïve pattern.

<table>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>df</td>
<td>pd.DataFrame</td>
<td>Training DataFrame containing the target column.</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>None</strong></td>
<td></td>
</tr>
</tbody>
</table>

------------------------------------------------------------------------

<a
href="https://github.com/mustafaslanCoto/peshbeen/blob/main/peshbeen/models/naive.py#L165"
target="_blank" style="float:right; font-size:smaller">source</a>

### naive.forecast

``` python

def forecast(
    H:int, # Forecast horizon.
    exog:Optional[pd.DataFrame]=None, # Accepted for API consistency with other models but silently ignored — naïve forecasts do not use exogenous variables.
)->np.ndarray: # Forecast values of length `H`.

```

*Generate naïve forecasts.*

<table>
<colgroup>
<col style="width: 6%" />
<col style="width: 25%" />
<col style="width: 34%" />
<col style="width: 34%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>H</td>
<td>int</td>
<td></td>
<td>Forecast horizon.</td>
</tr>
<tr>
<td>exog</td>
<td>Optional[pd.DataFrame]</td>
<td>None</td>
<td>Accepted for API consistency with other models but silently ignored
— naïve forecasts do not use exogenous variables.</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>np.ndarray</strong></td>
<td></td>
<td><strong>Forecast values of length <code>H</code>.</strong></td>
</tr>
</tbody>
</table>

------------------------------------------------------------------------

<a
href="https://github.com/mustafaslanCoto/peshbeen/blob/main/peshbeen/models/naive.py#L227"
target="_blank" style="float:right; font-size:smaller">source</a>

### naive.cross_validate

``` python

def cross_validate(
    df:pd.DataFrame, # Full dataset.
    cv_split:int, # Number of CV folds.
    test_size:int, # Test window size per fold.
    metrics:List[Callable], # Metric functions (e.g. ``[MAE, RMSE]``) used to evaluate forecast accuracy across folds. Call ``.cv_summary()`` after cross-validation to retrieve the aggregated scores.
    step_size:int=1, # Step size to advance the test window each fold.
    h_split_point:Optional[int]=None, # Split the test window into two sub-horizons for separate short- and long-term evaluation.
)->Tuple[pd.DataFrame, pd.DataFrame]: # Summary DataFrame with mean metric scores across folds, and (optionally) a fold-level DataFrame with true vs. predicted values for each fold.

```

*Run time-series cross-validation.*

<table>
<colgroup>
<col style="width: 6%" />
<col style="width: 25%" />
<col style="width: 34%" />
<col style="width: 34%" />
</colgroup>
<thead>
<tr>
<th></th>
<th><strong>Type</strong></th>
<th><strong>Default</strong></th>
<th><strong>Details</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>df</td>
<td>pd.DataFrame</td>
<td></td>
<td>Full dataset.</td>
</tr>
<tr>
<td>cv_split</td>
<td>int</td>
<td></td>
<td>Number of CV folds.</td>
</tr>
<tr>
<td>test_size</td>
<td>int</td>
<td></td>
<td>Test window size per fold.</td>
</tr>
<tr>
<td>metrics</td>
<td>List[Callable]</td>
<td></td>
<td>Metric functions (e.g. <code>[MAE, RMSE]</code>) used to evaluate
forecast accuracy across folds. Call <code>.cv_summary()</code> after
cross-validation to retrieve the aggregated scores.</td>
</tr>
<tr>
<td>step_size</td>
<td>int</td>
<td>1</td>
<td>Step size to advance the test window each fold.</td>
</tr>
<tr>
<td>h_split_point</td>
<td>Optional[int]</td>
<td>None</td>
<td>Split the test window into two sub-horizons for separate short- and
long-term evaluation.</td>
</tr>
<tr>
<td><strong>Returns</strong></td>
<td><strong>Tuple[pd.DataFrame, pd.DataFrame]</strong></td>
<td></td>
<td><strong>Summary DataFrame with mean metric scores across folds, and
(optionally) a fold-level DataFrame with true vs. predicted values for
each fold.</strong></td>
</tr>
</tbody>
</table>
