Shortcuts

get_target_formatter

class flash.core.data.utilities.classification.get_target_formatter(targets, labels=None, num_classes=None, add_background=False)[source]

Get the TargetFormatter object to use for the given targets.

Parameters
  • targets (List[Any]) – The list of targets to format.

  • labels (Optional[List[str]]) – Optionally provide labels / num_classes instead of inferring them.

  • num_classes (Optional[int]) – Optionally provide labels / num_classes instead of inferring them.

  • add_background (bool) – If True, a background class will be inserted as class zero if labels and num_classes are being inferred.

Return type

TargetFormatter

Returns

The target formatter to use when formatting targets.

Read the Docs v: latest
Versions
latest
stable
0.8.1
0.8.0
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.