Skip to content

Commit

Permalink
Update docs/src/workflow examples/Early Stopping/iteration.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Blaom, PhD <[email protected]>
  • Loading branch information
EssamWisam and ablaom authored Jun 7, 2024
1 parent 79f85d3 commit e476125
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/src/workflow examples/Early Stopping/iteration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ callbacks = [
]

# Construct the iterated model and pass to it the stop_conditions and the callbacks:
iterated_model = IteratedModel(model=clf,
resampling=CV(nfolds=6), # Split the data internally into 0.7 training and 0.3 validation
measures=log_loss,
iteration_parameter=:(epochs),
controls=vcat(stop_conditions, callbacks),
retrain=false # no need to retrain on all data at the end
);
iterated_model = IteratedModel(
model=clf,
resampling=CV(nfolds=6), # Split the data internally into 0.7 training and 0.3 validation
measures=log_loss,
iteration_parameter=:(epochs),
controls=vcat(stop_conditions, callbacks),
retrain=false # no need to retrain on all data at the end
);

# You can see more advanced stopping conditions as well as how to involve callbacks in the [documentation](https://juliaai.github.io/MLJ.jl/stable/controlling_iterative_models/#Controlling-Iterative-Models)

Expand Down

0 comments on commit e476125

Please sign in to comment.