---
title: "init(validationData:maxDepth:minLossReduction:minChildWeight:randomSeed:)"
framework: createml
role: symbol
role_heading: Initializer
path: "createml/mldecisiontreeregressor/modelparameters-swift.struct/init(validationdata:maxdepth:minlossreduction:minchildweight:randomseed:)"
---

# init(validationData:maxDepth:minLossReduction:minChildWeight:randomSeed:)

Creates a new set of parameters.

## Declaration

```swift
init(validationData: MLDataTable? = nil, maxDepth: Int = 6, minLossReduction: Double = 0, minChildWeight: Double = 0.1, randomSeed: Int = 42)
```

## Parameters

- `validationData`: The dataset used to monitor how well the model is generalizing. The default value is nil which will use an automatically sampled validation set.
- `maxDepth`: The maximum depth of the tree. Must be a value of at least 1. The default value is 6.
- `minLossReduction`: The minimum amount of reduction to the loss function that is required to make another node to split the data. Larger values help prevent overfitting. The default value is 0.
- `minChildWeight`: Determines the minimum weight of each leaf node of the tree. Larger values help prevent overfitting. The default value is 0.1.
- `randomSeed`: A seed for internal random operations. Set this value to ensure reproducible results. The default value is 42.

## See Also

### Creating parameters

- [init(validation:maxDepth:minLossReduction:minChildWeight:randomSeed:)](createml/mldecisiontreeregressor/modelparameters-swift.struct/init(validation:maxdepth:minlossreduction:minchildweight:randomseed:).md)
- [MLDecisionTreeRegressor.ModelParameters.ValidationData](createml/mldecisiontreeregressor/modelparameters-swift.struct/validationdata-swift.enum.md)
