# Module: tfdf.inspector

<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/component/inspector/inspector.py) |

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`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/AbstractInspector): Abstract inspector for all Yggdrasil models.

[`class Evaluation`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/Evaluation): Evaluation of a model.

[`class IterNodeResult`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/IterNodeResult): Value returned by node iterator methods. See "iterate_on_nodes".

[`class SimpleColumnSpec`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/SimpleColumnSpec): Simplified representation of a column spec.

[`class TrainLog`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/TrainLog): One entry in the training logs of a model.

## Functions

[`detect_model_file_prefix(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/detect_model_file_prefix): Auto-detects the model's file prefix if possible.

[`make_inspector(...)`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/inspector/make_inspector): Creates an inspector for a model.

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| 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 | <br /> { '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'> } <br /> |
| 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` |

<br />