Closed Mr-Geekman closed 1 year ago
Currently our metrics are calculated in per-segment fashion. We could fix it to optimize metric computation speed.
Add new parameter to Metric: metric_fn_signature. It could have two possible values:
Metric
metric_fn_signature
array_to_float
matrix_to_array
Rework functional metrics to work with new matrix mode by checking the input shape:
matrix
mape
smape
sign
max_deviation
wape
Rework all current metrics (except for interval metrics) to work in matrix mode. For metrics based on sklearn we should use multioutput parameter.
sklearn
multioutput
To discuss:
Sign
Width
self.kwargs
test_metrics_values
Related: #1338.
🚀 Feature Request
Currently our metrics are calculated in per-segment fashion. We could fix it to optimize metric computation speed.
Proposal
Add new parameter to
Metric
:metric_fn_signature
. It could have two possible values:array_to_float
: default, it expects two vectors and returns float,matrix_to_array
: it expects two matrices and returns vector.Rework functional metrics to work with new
matrix
mode by checking the input shape:mape
smape
sign
max_deviation
wape
Rework all current metrics (except for interval metrics) to work in
matrix
mode. For metrics based onsklearn
we should usemultioutput
parameter.To discuss:
Sign
,Width
.multioutput
parameter manually could interfere withself.kwargs
. What are we going to do about it?Test cases
test_metrics_values
Additional context
Related: #1338.