ClickHouse/tests/queries/0_stateless/03199_fix_auc_tie_handling.sql
2024-07-02 11:38:49 -03:00

32 lines
794 B
SQL

CREATE TABLE labels_unordered
(
idx Int64,
score Float64,
label Int64
)
ENGINE = MergeTree
PRIMARY KEY idx
ORDER BY idx;
SELECT floor(arrayAUC(array_concat_agg([score]), array_concat_agg([label])), 5)
FROM labels_unordered;
INSERT INTO labels_unordered (idx,score,label) VALUES (1,0.1,0), (2,0.35,1), (3,0.4,0), (4,0.8,1), (5,0.8,0);
SELECT floor(arrayAUC(array_concat_agg([score]), array_concat_agg([label])), 5)
FROM labels_unordered;
CREATE TABLE labels_ordered
(
idx Int64,
score Float64,
label Int64
)
ENGINE = MergeTree
PRIMARY KEY idx
ORDER BY idx;
INSERT INTO labels_ordered (idx,score,label) VALUES (1,0.1,0), (2,0.35,1), (3,0.4,0), (4,0.8,0), (5,0.8,1);
SELECT floor(arrayAUC(array_concat_agg([score]), array_concat_agg([label])), 5)
FROM labels_ordered;