ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tfdf.inspector.AbstractInspector

Abstract inspector for all Yggdrasil models.

dataspec Gets the dataspec.
task Task solved by the model.

Methods

evaluation

View source

Model self evaluation.

The model self evaluation is a cheap alternative to the use of a separate validation dataset or cross-validation. The exact implementation depends on the model e.g. Out-of-bag evaluation, internal train-validation.

During training, some models (e.g. Gradient Boosted Tree) used this evaluation for early stopping (if early stopping is enabled).

While this evaluation is computed during training, it can be used as a low quality model evaluation.

Returns
The evaluation, or None is not evaluation is available.

export_to_tensorboard

View source

Export the training logs (and possibly other metadata) to TensorBoard.

Usage examples in Colab:

model.make_inspector().export_to_tensorboard("/tmp/tensorboard_logs")
%load_ext tensorboard
%tensorboard --logdir "/tmp/tensorboard_logs"

Note that you can compare multiple models runs using sub-directories. For examples:

model_1.make_inspector().export_to_tensorboard("/tmp/tb_logs/model_1")
model_2.make_inspector().export_to_tensorboard("/tmp/tb_logs/model_2")

%load_ext tensorboard
%tensorboard --logdir "/tmp/tb_logs"

Args
path Output directory for the logs.

features

View source

Input features of the model.

label

View source

Label predicted by the model.

label_classes

View source

Possible classes of the label.

If the task is not a classification, or if the labels are dense integers, returns None.

Returns
The list of label values, or None.

model_type

View source

Unique key describing the type of the model.

Note that different learners can output similar model types, and a given learner can output different model types.

objective

View source

Objective solved by the model i.e. Task + extra information.

training_logs

View source

Evaluation metrics and statistics about the model during training.

The training logs show the quality of the model (e.g. accuracy evaluated on the out-of-bag or validation dataset) according to the number of trees in the model. Logs are useful to characterize the balance between model size and model quality.

variable_importances

View source

Various variable importances.

Values are sorted by decreasing value/importance.

The importance of a variable indicates how much a variable contributes to the model predictions or to the model quality.

The available variable importances depends on the model type and possibly its hyper-parameters.

Returns
Variable importances.