F1Score metric
Bases: FBetaScore
Computes F-1 Score.
Formula:
This is the harmonic mean of precision and recall.
Its output range is [0, 1]. It operates at a word level
and can be used for QA systems.
If y_true and y_pred contains multiple fields
The JSON object's fields are flattened and the score
computed for each one independently before being averaged.
Example:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
average
|
str
|
Type of averaging to be performed across per-field results
in the multi-field case.
Acceptable values are |
None
|
name
|
str
|
(Optional) string name of the metric instance. |
'f1_score'
|
in_mask
|
list
|
(Optional) list of keys to keep to compute the metric. |
None
|
out_mask
|
list
|
(Optional) list of keys to remove to compute the metric. |
None
|
in_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are kept (combined with |
None
|
out_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are dropped (combined with |
None
|
Source code in synalinks/src/metrics/f_score_metrics.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |
get_config()
Return the serializable config of the metric.
Returns:
| Type | Description |
|---|---|
dict
|
The config dict. |