Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kwinkunks committed Sep 4, 2023
2 parents cd8a603 + f962322 commit 16f29be
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 16f29be

Please sign in to comment.