# tfdf.py_tree.objective.ClassificationObjective

<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/py_tree/objective.py#L52-L118) |

Objective for classification.

Inherits From: [`AbstractObjective`](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/py_tree/objective/AbstractObjective)

    tfdf.py_tree.objective.ClassificationObjective(
        label: str,
        classes: Optional[List[str]] = None,
        num_classes: Optional[int] = None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Inspect and debug decision forest models](https://www.tensorflow.org/decision_forests/tutorials/advanced_colab) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `label` | Objective label name. |
| `classes` | List of possible class values. |
| `num_classes` | Number of classes. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `classes` | <br /> <br /> |
| `has_integer_labels` | <br /> <br /> |
| `label` | <br /> <br /> |
| `num_classes` | <br /> <br /> |
| `task` | Task value. |

<br />

## Methods

### `__eq__`

[View source](https://github.com/tensorflow/decision-forests/blob/main/tensorflow_decision_forests/component/py_tree/objective.py#L114-L118)

    __eq__(
        other
    )

Return self==value.