Skip to content

KSComplement can be unstable for constant float values #652

@fealho

Description

@fealho

Environment Details

  • SDMetrics version: 0.16.0

Error Description

The KSComplement may return a score of 0.0 when passed seemingly identical float values.

Steps to reproduce

from sdmetrics.single_column.statistical.kscomplement import KSComplement
import pandas as pd

vals1 = pd.Series([.2 - .1])
vals2 = pd.Series([.3 - .2])
print(KSComplement.compute(vals1, vals2)) # This prints 0.0 

Expectation

The KSComplement is expected to return 1.0 for such cases.

Additional context

This seems to be the default behavior of scipy's ks_2samp, which KSComplement uses to compute the KS test statistic.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions