A Python package for automatic statistical analysis and imputation
Project description
AutoStats
AutoStats is a Python library designed to simplify the process of cleaning, imputing, and analyzing datasets with minimal coding effort. It provides tools for generating exploratory reports, handling missing data, and optimizing imputation methods, making it ideal for data scientists and analysts.
Features
Report Module
- Auto Report: Automatically generates an initial exploratory report from your dataset, categorizing columns and visualizing data distributions.
- Manual Report: Allows users to specify categorical, continuous, and discrete columns for a more customized report.
Impute Module
- Data Preprocessing: Automatically preprocesses datasets by handling missing values, encoding categorical variables, and identifying column types (categorical, continuous, discrete).
- Imputation Methods:
- KNN Imputation: Uses K-Nearest Neighbors to fill missing values.
- MICE Imputation: Implements Multiple Imputation by Chained Equations.
- MissForest Imputation: Uses Random Forests to impute missing values.
- MIDAS Imputation: Leverages deep learning for advanced imputation.
- Hyperparameter Optimization: Automatically tunes imputation methods using Optuna for the best performance.
- Best Method Selection: Evaluates multiple imputation methods and selects the best-performing one for each column.
Installation
To install AutoStats, ensure you have Python 3.8 or higher and run:
pip install -r [requirements.txt](http://_vscodecontentref_/0)
Usage
To use the Auto Report feature, you can use the following code:
from report import auto_report
import pandas as pd
df = pd.read_csv("your_dataset.csv")
auto_report(df, tresh=10, output_file="auto_report.pdf", df_name="Your Dataset")
To use the Manual Report feature, specify your columns as follows:
from report import manual_report
categorical_cols = ['col1', 'col2']
continuous_cols = ['col3', 'col4']
discrete_cols = ['col5']
manual_report(df, categorical_cols, continuous_cols, discrete_cols, output_file="manual_report.pdf", df_name="Your Dataset")
To preprocess your data using the prep function from the impute module, use the following code:
from impute import prep
continuous_cols, discrete_cols, categorical_cols = prep(df)
To run the full pipeline with simulation and building options, use the run_full_pipeline function:
from impute import run_full_pipeline
best_imputed_df, summary_table = run_full_pipeline(df, simulate=True, build=True, missingness_value=10.0)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autostats-0.1.1.tar.gz.
File metadata
- Download URL: autostats-0.1.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b871264f38efcabfb2a3480fb3de66073ec61d8f00288916c7650fae57c5d9fa
|
|
| MD5 |
9d75734cd68430f538b4db4d83ce0b58
|
|
| BLAKE2b-256 |
5ee50f994b6019d2e267776ebb705f3126d8d2af3207dd734a87d129a93b14a7
|
File details
Details for the file autostats-0.1.1-py3-none-any.whl.
File metadata
- Download URL: autostats-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
149109993fe45c0473c707821858514ed96d2a017fc1559f49559e3cd807122a
|
|
| MD5 |
cdb1438bccf65de1d8003c28dce98008
|
|
| BLAKE2b-256 |
01da2010baa2b41a670c73836656d66e3fce64d80c95db80f73e77a80a1b403a
|