Module: tfdf.inspector

Model inspector.

Utility to access the structure and meta-data (e.g. variable importance, training logs) of a model.

Usage:

model = keras.RandomForest().
model.fit(...)
inspector = model.make_inspector()

# Or
inspector = make_inspector(<model directory>)

print(inspector.name())
print(inspector.num_trees())
# Note: "inspector"'s accessors depends on the model type (inspector.name()).

Classes

class AbstractInspector: Abstract inspector for all Yggdrasil models.

class Evaluation: Evaluation of a model.

class IterNodeResult: Value returned by node iterator methods. See "iterate_on_nodes".

class SimpleColumnSpec: Simplified representation of a column spec.

class TrainLog: One entry in the training logs of a model.

Functions

detect_model_file_prefix(...): Auto-detects the model's file prefix if possible.

make_inspector(...): Creates an inspector for a model.

BASE_FILENAME_DATASPEC 'data_spec.pb'
BASE_FILENAME_DONE 'done'
BASE_FILENAME_GBT_HEADER 'gradient_boosted_trees_header.pb'
BASE_FILENAME_HEADER 'header.pb'
BASE_FILENAME_MULTITASKER_HEADER 'multitasker.pb'
BASE_FILENAME_NODES_SHARD 'nodes'
BASE_FILENAME_RANDOM_FOREST_HEADER 'random_forest_header.pb'
ColumnType Instance of google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper
MODEL_INSPECTORS

{
 'GRADIENT_BOOSTED_TREES': <class 'tensorflow_decision_forests.component.inspector.inspector._GradientBoostedTreeInspector'>,
 'MULTITASKER': <class 'tensorflow_decision_forests.component.inspector.inspector._MultitaskerInspector'>,
 'RANDOM_FOREST': <class 'tensorflow_decision_forests.component.inspector.inspector._RandomForestInspector'>
}

Task Instance of google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper
absolute_import Instance of __future__._Feature
division Instance of __future__._Feature
print_function Instance of __future__._Feature