{"id":21352146,"url":"https://github.com/kennethleungty/statsassume","last_synced_at":"2025-07-12T20:32:07.100Z","repository":{"id":57471233,"uuid":"446473257","full_name":"kennethleungty/StatsAssume","owner":"kennethleungty","description":"Automating Assumption Checks for Regression Models (Work in Progress, Currently Paused)","archived":false,"fork":false,"pushed_at":"2022-07-26T08:38:41.000Z","size":20830,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-18T21:01:54.237Z","etag":null,"topics":["assumption-check","assumption-checks","assumptions","binary-logistic-regression","data-analytics","data-science","linear-regression","logistic-regression","machine-learning","ml","multilinear-regression","multinomial-logistic-regression","multinomial-regression","python","regression","regression-models","statistics","stats","statsassume","statsmodels"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kennethleungty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-10T15:15:02.000Z","updated_at":"2023-08-12T07:12:33.000Z","dependencies_parsed_at":"2022-09-10T02:11:52.555Z","dependency_job_id":null,"html_url":"https://github.com/kennethleungty/StatsAssume","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethleungty%2FStatsAssume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethleungty%2FStatsAssume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethleungty%2FStatsAssume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethleungty%2FStatsAssume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kennethleungty","download_url":"https://codeload.github.com/kennethleungty/StatsAssume/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225834368,"owners_count":17531471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assumption-check","assumption-checks","assumptions","binary-logistic-regression","data-analytics","data-science","linear-regression","logistic-regression","machine-learning","ml","multilinear-regression","multinomial-logistic-regression","multinomial-regression","python","regression","regression-models","statistics","stats","statsassume","statsmodels"],"created_at":"2024-11-22T03:12:47.995Z","updated_at":"2024-11-22T03:12:48.651Z","avatar_url":"https://github.com/kennethleungty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/kennethleungty/statsassume/main/media/logo_v1.png\" alt=\"StatsAssume\" width=\"350\"\u003e\u003c/h2\u003e\n\u003ch3 align=\"center\"\u003eAutomating Assumption Checks for Regression Models (WORK IN PROGRESS)\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003c!-- \u003ca href=\"https://img.shields.io/badge/Build-Passing-green\"\u003e\u003cimg src=\"https://img.shields.io/badge/Build-Passing-green?style=for-the-badge\"\u003e\u003c/a\u003e --\u003e\n  \u003ca href=\"#\"\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/workflow/status/kennethleungty/statsassume/PyTest%20and%20Code%20Coverage?style=for-the-badge\"\u003e\u003c/a\u003e \n  \u003c!-- \u003ca href=\"#\"\u003e\u003cimg alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/kennethleungty/statsassume?label=CODECOV\u0026style=for-the-badge\u0026token=4RJ4QXIHMH\"\u003e\u003c/a\u003e  --\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-v3.7+-blue.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"#\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/statsassume?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#download\"\u003eDownload\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#motivation\"\u003eMotivation\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#upcoming\"\u003eUpcoming\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\nStatsAssume automates the assumption checks of regression models (e.g., linear and logistic regression) on your data and displays the results in an elegant dashboard. \n\n\u003cimg src=\"https://raw.githubusercontent.com/kennethleungty/statsassume/main/media/demo.gif\"/\u003e\n\n- Automatically detects regression task (and relevant assumption checks) based on the target variable of dataset.\n\n- Automatically executes statistical tests and visual plots of assumption checks relevant to the regression task.\n\n- Generates clear visual output of results in a beautiful dashboard (built on [Jupyter-Dash](https://github.com/plotly/jupyter-dash)).\n\n- Displays insightful information on assumption concepts and possible fixes for assumption violations.\n\n- Able to automatically encode categorical variables to create dataset suitable for regression modelling (unless specified otherwise).\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Download\n```python\npip install statsassume\n```\n\u003cbr\u003e\n\n## Usage\n\n### Quickstart\n```python\nfrom statsassume import Check\nfrom statsassume.datasets import load_data\n\ndf = load_data('Fish_processed')  # Get toy dataset (pre-processed)\n\nassume = Check(df, target='Weight')  # Initiate Check class and define target variable\nassume.report()  # Run assumption checks and generate dashboard report\n```\n\nNOTE: Data should ideally be pre-processed before running StatsAssume assumption checks.  \n\nToy datasets available in StatsAssume can be found [**HERE**](https://github.com/kennethleungty/StatsAssume/blob/main/datasets/SOURCE.MD)\n\u003cbr\u003e\n\u003cbr\u003e\n\n### Comprehensive Usage\n- While pre-processing should ideally be performed prior, StatsAssume comes with automatic encoding of categorical variables so that we can quickly commence model runs and assumption checks\n- Here's how to put the `Check` class (core object of StatsAssume) to its best use:\n\n```python\ndf = load_data('Fish')  # Get toy dataset (raw)\n\nassume = Check(df=df, \n               target='Weight',\n               task='linear regression',\n               predictors=['Height', 'Width', 'Length1', 'Species'],\n               keep=True,\n               categorical_features=['Species'],\n               categorical_encoder='ohe',\n               mode='inline')\n```\n#### Attributes\n- `df`: *pd.DataFrame*\n\u003cbr\u003e Dataset (in pandas DataFrame format)\n\n- `target`: *str*\n\u003cbr\u003e Column name of target (dependent) variable\n\n- `task`: *str*\n\u003cbr\u003e Type of regression task to be performed. Options include: ***'linear regression'***(More tasks to come soon). If None specified, task will be automatically determined based on `target` variable. \n\n- `predictors`: *list*\n\u003cbr\u003e List of column names of predictor (independent) features. If None specified, all columns other than `target` will be regarded as predictors\n\n- `keep`: *bool*\n\u003cbr\u003e If ***True***, variables in `predictors` list will be kept as predictor variables, and other non-target variables will be dropped. If ***False***, variables in `predictors` list will be dropped, and other non-target variables will be retained. Default is ***True***.\n\n- `categorical_features`: *list*\n\u003cbr\u003e List of column names deemed categorical, so that appropriate encoding can be performed. If None specified, the categorical variables will be automatically detected and encoded into numerical format for regression modelling. Default is ***None***.\n\n- `categorical_encoding`: *str*\n\u003cbr\u003e Type of encoding technique to be performed on categorical variables. Options include: ***ohe*** (i.e. one-hot encoding) and ***ord*** (i.e. ordinal encoding). Default is ***ohe***.\n\n- `mode`: *str*\n\u003cbr\u003e Type of display for dashboard report. Options include ***inline*** (displayed as output directly in Jupyter notebook), ***external*** (displayed in a new full-screen browser tab), or ***jupyterlab*** (displayed in separate tab right inside JupyterLab). Default is ***inline***.\n\n#### Notes\n- Only `df` and `target` attributes are compulsory\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Motivation\n- Tedious to perform assumption checks manually\n- Lack of rigour and consistency in references and notebooks online\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003c!-- ## Credits\n- [Kenneth Leung](https://github.com/kennethleungty)\n- Contributor 2\n- Contributor 3\n- Contributor 4\n --\u003e\n\n## Contributing\n1. Have a look at the existing [Issues](https://github.com/kennethleungty/statsassume/issues) and [Pull Requests](https://github.com/kennethleungty/statsassume/pulls) that you would like to help with. \n2. Clone repo and create a new branch: `$ git checkout https://github.com/kennethleungty/statsassume -b name_of_new_branch`.\n3. Make changes and test\n4. Submit **Pull Request** with comprehensive description of changes\n\nIf you would like to request a feature or report a bug, please [create a GitHub Issue](https://github.com/kennethleungty/statsassume/issues).\n\n[See full contribution guide →](https://github.com/kennethleungty/statsassume/blob/main/CONTRIBUTING.md)\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Upcoming\n- Assumption checks for Logistic Regression (meanwhile, take a look at this [article on logistic regression assumptions](https://towardsdatascience.com/assumptions-of-logistic-regression-clearly-explained-44d85a22b290))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethleungty%2Fstatsassume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennethleungty%2Fstatsassume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethleungty%2Fstatsassume/lists"}