> For the complete documentation index, see [llms.txt](https://doc.verteego.com/verteego-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.verteego.com/verteego-doc/pipelines/forecasting-pipelines/configuration/configuring-the-forecasting-algorithm/fit_parameters.md).

# fit\_parameters

### **Description**

{% hint style="info" %}
This configuration is only available with the XGBoost algorithm.&#x20;
{% endhint %}

When using XGBoost as a model, Verteego offers a way to combine the benefits of a global model with the benefits of a local model.

It provides a method to tailor the fitting process, combining the advantages of a global model with those of a local model. These parameters might include settings for handling imbalanced data, specifying the number of boosting rounds, or other XGBoost-specific options that influence how the model learns from the data.

To do so, an advanced method has been developed to pick the best number of estimators when predicting, for a given resolution level.

### Options

The parameter **resolution** indicates the resolution used to optimize the number of estimators. **gain\_threshold** specifies the minimal gain in percentage to trigger the use of the optimisation.

Optimization is enabled during prediction only when **use\_for\_optim** is true. **metric\_names** lists the metrics used for the optimization.

When the **export\_fitting** parameter is enabled, optimization curves are exported during training.

### Steps impacted

<mark style="background-color:yellow;">training</mark>

### Example

```yaml
fit_parameters: 
    resolution: 
    - locid 
    gain_threshold: 0.1 
    use_for_optim: true
    metric_names:
    - precision
    export_fitting: true
```

#### Conditional overriding of Hyper Parameters

Verteego support overriding of Hyper Parameters for a given resolution, using the following section in the config:

```yaml
conditional_algorithm_parameters:
  usa:
    where:
      country: us
    alpha: 0.666
  france:
    where:
      country: fr
    alpha: 0.777
```

Please note that the condition expressed in the `where` statement must be unique for a given model resolution.

###
