# tfl.premade_lib.set_crystals_lattice_ensemble

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/premade_lib.py#L1304-L1354) |

Extracts crystals from a prefitting model and finalizes model_config.

#### View aliases


**Main aliases**

[`tfl.premade.premade_lib.set_crystals_lattice_ensemble`](https://www.tensorflow.org/lattice/api_docs/python/tfl/premade_lib/set_crystals_lattice_ensemble)

<br />

    tfl.premade_lib.set_crystals_lattice_ensemble(
        model_config, prefitting_model_config, prefitting_model, feature_names=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [TF Lattice Premade Models](https://www.tensorflow.org/lattice/tutorials/premade_models) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `model_config` | Model configuration object describing model architecture. Should be a `tfl.configs.CalibratedLatticeEnsemble` instance. |
| `prefitting_model_config` | Model configuration object describing prefitting model architecture. Should be a `tfl.configs.CalibratedLatticeEnsemble` insance constructed using [`tfl.premade_lib.construct_prefitting_model_config`](https://www.tensorflow.org/lattice/api_docs/python/tfl/premade_lib/construct_prefitting_model_config). |
| `prefitting_model` | A trained [`tfl.premade.CalibratedLatticeEnsemble`](https://www.tensorflow.org/lattice/api_docs/python/tfl/premade/CalibratedLatticeEnsemble), `tfl.estimators.CannedEstimator`, `tfl.estimators.CannedClassifier`, or `tfl.estiamtors.CannedRegressor` instance. |
| `feature_names` | A list of feature names. If not provided, feature names will be extracted from the feature configs contained in the model_config. |

<br />