---
title: "writeWithOptimizer(_:to:overwrite:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/updatablesupervisedtemporalestimator/writewithoptimizer(_:to:overwrite:)"
---

# writeWithOptimizer(_:to:overwrite:)

Writes the encoded transformer and optimizer to a file.

## Declaration

```swift
func writeWithOptimizer(_ transformer: Self.Transformer, to url: URL, overwrite: Bool = true) throws
```

## Parameters

- `transformer`: A transformer created by this estimator.
- `url`: A file URL.
- `overwrite`: A Boolean value indicating whether to overwrite existing files.

## See Also

### Reading and writing

- [readWithOptimizer(from:)](createmlcomponents/updatablesupervisedtemporalestimator/readwithoptimizer(from:).md)
