diff --git a/medmodels/statistic_evaluations/statistical_analysis/descriptive_statistics.pyi b/medmodels/statistic_evaluations/statistical_analysis/descriptive_statistics.pyi new file mode 100644 index 00000000..a2a451e4 --- /dev/null +++ b/medmodels/statistic_evaluations/statistical_analysis/descriptive_statistics.pyi @@ -0,0 +1,18 @@ +from typing import Dict + +import polars as pl + +from medmodels.medrecord import MedRecord +from medmodels.medrecord.querying import NodeOperation +from medmodels.medrecord.schema import AttributeType + +def determine_attribute_type(attribute_values: pl.Series) -> AttributeType: ... +def get_continuos_attribute_statistics( + medrecord: MedRecord, attribute_query: NodeOperation +) -> Dict[str, float]: ... +def get_temporal_attribute_statistics( + medrecord: MedRecord, attribute_query: NodeOperation +) -> Dict[str, str]: ... +def get_categorical_attribute_statistics( + medrecord: MedRecord, attribute_query: NodeOperation +) -> Dict[str, str]: ... diff --git a/medmodels/statistic_evaluations/statistical_analysis/inferential_statistics.pyi b/medmodels/statistic_evaluations/statistical_analysis/inferential_statistics.pyi new file mode 100644 index 00000000..bf8d872d --- /dev/null +++ b/medmodels/statistic_evaluations/statistical_analysis/inferential_statistics.pyi @@ -0,0 +1,19 @@ +from typing import Dict, List, Union + +from numpy.typing import ArrayLike + +class TestHypothesis: + alpha: float + samples: List[ArrayLike] + sample_number: int + normal_distribution: bool + test: str + hypothesis: str + p_value: float + + def test_for_normal_distribution(self) -> bool: ... + def decide_hypothesis_test(self) -> Dict[str, Union[str, bool, float]]: ... + def two_tailed_t_test(self) -> float: ... + def mann_whitney_u_test(self) -> float: ... + def ANOVA(self) -> float: ... + def chi_sqare_independece_test(self) -> float: ... diff --git a/pyproject.toml b/pyproject.toml index 37a59853..5a01e418 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ dependencies = [ "pandas>=2.2.2", "polars[pandas]>=1.6.0", "scikit-learn>=1.5.0", + "scipy>=1.9.0", ] [project.optional-dependencies]