> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects.classification instance

## ClassificationInstance Objects

```python theme={"dark"}
class ClassificationInstance()
```

#### classification\_hash

```python theme={"dark"}
@property
def classification_hash() -> str
```

A unique identifier for the classification instance.

#### classification\_name

```python theme={"dark"}
@property
def classification_name() -> str
```

Classification name from the project ontology

#### feature\_hash

```python theme={"dark"}
@property
def feature_hash() -> str
```

Feature node hash from the project ontology

#### created\_by

```python theme={"dark"}
@created_by.setter
def created_by(created_by: Optional[str]) -> None
```

Set the created\_by field with a user email or None if it should default to the current user of the SDK.

#### last\_edited\_by

```python theme={"dark"}
@last_edited_by.setter
def last_edited_by(last_edited_by: Optional[str]) -> None
```

Set the last\_edited\_by field with a user email or None if it should default to the current user of the SDK.

#### set\_for\_frames

```python theme={"dark"}
def set_for_frames(frames: Frames = 0,
                   *,
                   overwrite: bool = False,
                   created_at: Optional[datetime] = None,
                   created_by: Optional[str] = None,
                   confidence: float = DEFAULT_CONFIDENCE,
                   manual_annotation: bool = DEFAULT_MANUAL_ANNOTATION,
                   last_edited_at: Optional[datetime] = None,
                   last_edited_by: Optional[str] = None,
                   reviews: Optional[List[dict]] = None) -> None
```

Places the classification onto the specified frame. If the classification already exists on the frame and
overwrite is set to `True`, the currently specified values will be overwritten.

**Arguments**:

* `frames` - The frame to add the classification instance to. Defaulting to the first frame for convenience.
* `overwrite` - If `True`, overwrite existing data for the given frames. This will not reset all the
  non-specified values. If `False` and data already exists for the given frames,
  raises an error.
* `created_at` - Optionally specify the creation time of the classification instance on this frame. Defaults to `datetime.now()`.
* `created_by` - Optionally specify the creator of the classification instance on this frame. Defaults to the current SDK user.
* `last_edited_at` - Optionally specify the last edit time of the classification instance on this frame. Defaults to `datetime.now()`.
* `last_edited_by` - Optionally specify the last editor of the classification instance on this frame. Defaults to the current SDK
  user.
* `confidence` - Optionally specify the confidence of the classification instance on this frame. Defaults to `1.0`.
* `manual_annotation` - Optionally specify whether the classification instance on this frame was manually annotated. Defaults to `True`.
* `reviews` - Should only be set by internal functions.

#### get\_annotation

```python theme={"dark"}
def get_annotation(frame: Union[int, str] = 0) -> Annotation
```

**Arguments**:

* `frame` - Either the frame number or the image hash if the data type is an image or image group.
  Defaults to the first frame.

#### get\_annotations

```python theme={"dark"}
def get_annotations(
) -> Union[List[Annotation], List[_ClassificationAnnotation]]
```

**Returns**:

A list of `ClassificationInstance.Annotation` in order of available frames.

#### set\_answer

```python theme={"dark"}
def set_answer(answer: Union[str, NumericAnswerValue, Option,
                             Sequence[Option]],
               attribute: Optional[Attribute] = None,
               overwrite: bool = False) -> None
```

Set the answer for a given ontology Attribute. This is the equivalent of e.g. selecting a checkbox in the
UI after adding a ClassificationInstance. There is only one answer per ClassificationInstance per Attribute.

**Arguments**:

* `answer` - The answer to set.
* `attribute` - The ontology attribute to set the answer for. If not set, this will be attempted to be
  inferred.  For answers to [RadioAttribute](/sdk-documentation/sdk-references/objects.attributes#radioattribute) or
  [ChecklistAttribute](/sdk-documentation/sdk-references/objects.attributes#checklistattribute), this can be inferred automatically. For
  [TextAttribute](/sdk-documentation/sdk-references/objects.attributes#textattribute), this will only be inferred if there is only one possible
  TextAttribute to set for the entire classification instance. Otherwise, a
  [LabelRowError](/sdk-documentation/sdk-references/exceptions#labelrowerror) will be thrown.
* `overwrite` - If `True`, the answer will be overwritten if it already exists. If `False`, this will throw
  a LabelRowError if the answer already exists.

#### set\_answer\_from\_list

```python theme={"dark"}
def set_answer_from_list(answers_list: List[AttributeDict]) -> None
```

This is a low level helper function and should not be used directly.

Sets the answer for the classification from a dictionary.

**Arguments**:

* `answers_list` - The list to set the answer from.

#### get\_answer

```python theme={"dark"}
def get_answer(
    attribute: Optional[Attribute] = None
) -> Union[str, Option, Iterable[Option], None]
```

Get the answer set for a given ontology Attribute. Returns `None` if the attribute is not yet answered.

For the ChecklistAttribute, it returns None if and only if
the attribute is nested and the parent is unselected. Otherwise, if not yet answered it will return an empty
list.

**Arguments**:

* `attribute` - The ontology attribute to get the answer for.

#### delete\_answer

```python theme={"dark"}
def delete_answer(attribute: Optional[Attribute] = None) -> None
```

This resets the answer of an attribute as if it was never set.

**Arguments**:

* `attribute` - The ontology attribute to delete the answer for. If not provided, the first level attribute is
  used.

#### copy

```python theme={"dark"}
def copy() -> ClassificationInstance
```

Creates an exact copy of this ClassificationInstance but with a new classification hash and without being
associated to any LabelRowV2. This is useful if you want to add the semantically same
ClassificationInstance to multiple `LabelRowV2`s.

#### get\_all\_static\_answers

```python theme={"dark"}
def get_all_static_answers() -> List[Answer]
```

A low level helper function.

## Annotation Objects

```python theme={"dark"}
class Annotation(_ClassificationAnnotation)
```

Represents an annotation for a specific frame of a ClassficationInstance.
Allows setting or getting data for the ClassificationInstance on the given frame number.
This is deprecated, we will be using the ClassificationAnnotation that this inherits from.

#### reviews

```python theme={"dark"}
@property
def reviews() -> Optional[List[dict]]
```

A read only property about the reviews that happened for this object on this frame.
