Skip to content

Commit

Permalink
fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
kwinkunks committed Sep 4, 2023
1 parent 80df3f7 commit f962322
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/redflag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,23 +355,23 @@ def is_standardized(a: ArrayLike, atol: float=1e-3) -> bool:
return bool((np.abs(μ) < atol) and (np.abs(σ - 1) < atol))


def is_standard_normal(a: ArrayLike, confidence: float=0.95) -> bool:
def is_standard_normal(a: ArrayLike, confidence: float=0.8) -> bool:
"""
Performs the Kolmogorov-Smirnov test for normality. Returns True if the
feature appears to be normally distributed, with a mean close to zero and
standard deviation close to 1.
Args:
a (array): The data.
confidence (float): The confidence level of the test, default 0.95
(95% confidence).
confidence (float): The confidence level of the test, default 0.8
(80% confidence).
Returns:
bool: True if the feature appears to have a standard normal distribution.
Example:
>>> a = np.random.normal(size=2000)
>>> is_standard_normal(a, confidence=0.9)
>>> a = np.random.normal(size=2500)
>>> is_standard_normal(a, confidence=0.8)
True
>>> is_standard_normal(a + 1)
False
Expand Down

0 comments on commit f962322

Please sign in to comment.