# Module: tfdf.keras.core

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/decision-forests/blob/main/tensorflow_decision_forests/keras/core.py) |

Core wrapper.

This file contains the Keras model wrapper around an Yggdrasil model/learner.
While it can be used directly, the helper functions in keras.py /
wrapper_pre_generated.py should be preferred as they explicit more directly the
learner specific hyper-parameters.

#### Usage example:

    # Indirect usage
    import tensorflow_decision_forests as tfdf

    model = tfdf.keras.RandomForestModel()
    train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(...)
    model.fit(train_ds)

    # Direct usage
    import tensorflow_decision_forests as tfdf

    model = tfdf.keras.CoreModel(learner="RANDOM_FOREST")
    train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(...)
    model.fit(train_ds)

See "CoreModel" for more details

## Classes

[`class AdvancedArguments`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/AdvancedArguments): Advanced control of the model that most users won't need to use.

[`class CoreModel`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/CoreModel): Keras Model V2 wrapper around an Yggdrasil Learner and Model.

[`class FeatureSemantic`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/FeatureSemantic): Semantic (e.g.

[`class FeatureUsage`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/FeatureUsage): Semantic and hyper-parameters for a single feature.

[`class HyperParameterTemplate`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/HyperParameterTemplate): Named and versionned set of hyper-parameters.

[`class InferenceCoreModel`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/InferenceCoreModel): Keras Model V2 wrapper around an Yggdrasil Model.

[`class Monotonic`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/Monotonic): Monotonic constraint between a feature and the model output.

[`class MultiTaskItem`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/MultiTaskItem): A single task in a multi-task configuration.

[`class NodeFormat`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/NodeFormat): Node format of a model.

[`class YggdrasilDeploymentConfig`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/YggdrasilDeploymentConfig): A ProtocolMessage

[`class YggdrasilTrainingConfig`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/YggdrasilTrainingConfig): A ProtocolMessage

[`class datetime`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/datetime): datetime(year, month, day\[, hour\[, minute\[, second\[, microsecond\[,tzinfo\]\]\]\]\])

## Functions

[`get_worker_idx_and_num_workers(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/get_worker_idx_and_num_workers): Gets the current worker index and the total number of workers.

[`no_automatic_dependency_tracking(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/no_automatic_dependency_tracking): Disables automatic dependency tracking on attribute assignment.

[`pd_dataframe_to_tf_dataset(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/pd_dataframe_to_tf_dataset): Converts a Panda Dataframe into a TF Dataset compatible with Keras.

[`yggdrasil_model_to_keras_model(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/yggdrasil_model_to_keras_model): Converts an Yggdrasil model into a TensorFlow SavedModel / Keras model.

## Type Aliases

[`HyperParameters`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/HyperParameters)

[`MonotonicConstraint`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/core/MonotonicConstraint)

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| ONLY_WARN_ON_DATASET_CONFIGURATION_ISSUES | `False` |
| Task | Instance of `google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper` |
| TaskType | `'abstract_model_pb2.Task'` |
| WEIGHTS | `'__WEIGHTS'` |
| absolute_import | Instance of `__future__._Feature` |
| division | Instance of `__future__._Feature` |
| print_function | Instance of `__future__._Feature` |

<br />