# tf.keras.callbacks.History

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L1184-L1221) |

Callback that records events into a `History` object.

Inherits From: [`Callback`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/keras/callbacks/Callback)

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

\`tf.compat.v1.keras.callbacks.History\`

<br />

    tf.keras.callbacks.History()

This callback is automatically applied to
every Keras model. The `History` object
gets returned by the `fit` method of models.

#### Example:

    model = tf.keras.models.Sequential([tf.keras.layers.Dense(10)])
    model.compile(tf.keras.optimizers.SGD(), loss='mse')
    history = model.fit(np.arange(100).reshape(5, 20), np.zeros(5),
                        epochs=10, verbose=1)
    print(history.params)
    {'verbose': 1, 'epochs': 10, 'steps': 1}
    # check the keys of history object
    print(history.history.keys())
    dict_keys(['loss'])

## Methods

### `set_model`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L694-L695)

    set_model(
        model
    )

### `set_params`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L691-L692)

    set_params(
        params
    )