---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/python-reference_catboost_set_scale_and_bias.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# set_scale_and_bias

<!-- source: en/_includes/work_src/reusage-python/set_scale_and_bias__desc.md -->
Set the scale and bias.
<!-- endsource: en/_includes/work_src/reusage-python/set_scale_and_bias__desc.md -->

## Method call format {#method-call-format}

```
set_scale_and_bias(scale, bias)
```

## Parameters {#parameters}

<!-- source: en/_includes/work_src/reusage-python/set_scale_and_bias__params-table.md -->
### scale

#### Description

The model scale.

<!-- source: en/_includes/work_src/reusage-python/scale_and_bias__desc.md -->
The model prediction results are calculated as follows:
$\sum leaf\_values \cdot scale + bias$
<!-- endsource: en/_includes/work_src/reusage-python/scale_and_bias__desc.md -->

The value of this parameters affects the prediction by changing the default value of the scale.

**Possible types**

float

**Default value**

1

### bias

#### Description

The model bias.

<!-- source: en/_includes/work_src/reusage-python/scale_and_bias__desc.md -->
The model prediction results are calculated as follows:
$\sum leaf\_values \cdot scale + bias$
<!-- endsource: en/_includes/work_src/reusage-python/scale_and_bias__desc.md -->

The value of this parameters affects the prediction by changing the default value of the bias.

**Possible types**

float

**Default value**

Depends on the value of the `--boost-from-average` for the Command-line version parameter:

- True — The best constant value for the specified loss function
- False — 0
<!-- endsource: en/_includes/work_src/reusage-python/set_scale_and_bias__params-table.md -->


## Examples {#examples}

```python
from catboost import CatBoost
import numpy as np

train_data = np.random.randint(1, 100, size=(100, 10))
train_labels = np.random.randint(2, size=(100))

model = CatBoost()

print("Default scale and bias: " + str(model.get_scale_and_bias()))
model.set_scale_and_bias(0.5, 0.5)
print("Modified scale and bias: " + str(model.get_scale_and_bias()))

```

The output of this example:

```
Default scale and bias: (1.0, 0.0)
Modified scale and bias: (0.5, 0.5)
```

