Skip to main content

AutoStats

PyPI version Python versions PyPI - License

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 the following command:

pip install AutoStats

You can also view the project on PyPI.


Usage

Auto Report

To generate an automated exploratory data analysis report:

from AutoStats.report import auto_report
import pandas as pd

# Load your dataset
df = pd.read_csv("your_dataset.csv")

# Generate the report
auto_report(df, tresh=10, output_file="auto_report.pdf", df_name="Your Dataset")

Manual Report

To create a report with manually specified column types:

from AutoStats.report import manual_report
import pandas as pd

# Load your dataset
df = pd.read_csv("your_dataset.csv")

# Specify column types
categorical_cols = ['col1', 'col2']
continuous_cols = ['col3', 'col4']
discrete_cols = ['col5']

# Generate the report
manual_report(df, categorical_cols, continuous_cols, discrete_cols, output_file="manual_report.pdf", df_name="Your Dataset")

Data Imputation

To run the complete missing data imputation pipeline:

from AutoStats.impute import run_full_pipeline
import pandas as pd

# Load your dataset (with missing values)
df = pd.read_csv("your_dataset.csv")

# Run the imputation pipeline
best_imputed_df, summary_table = run_full_pipeline(df, simulate=True, build=True)

# The pipeline returns the imputed dataframe and a summary of the best methods used.
print(best_imputed_df.head())
print(summary_table)

How the imputation pipeline works:

  • simulate=True: This mode is for datasets that already have missing values. The pipeline will identify the missing data patterns and find the best imputation method for each column. This is the most common use case.
  • simulate=False: This mode is for evaluating the imputation methods on a complete dataset. You must specify a missingness_value (e.g., missingness_value=0.10 for 10%). The pipeline will artificially introduce missing values into your complete dataset and then impute them, allowing you to assess the performance of the different methods.

For a detailed technical explanation of the imputation module, please refer to the Imputation Technical Report.


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for AutoStats 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AutoStats 0.1.4
File Size Uploaded Provenance
autostats-0.1.4.tar.gz 19.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for AutoStats 0.1.4
File Interpreter ABI Platform
autostats-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 39.8 kB

Release files / autostats-0.1.4.tar.gz

Download URL autostats-0.1.4.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d5f41de0b81e3db916f30341262a8bcff2e46b341cad67e52b02c2cf14a4ffd4
BLAKE2b-256 checksum
How to use checksums
9a399fe602f485de86885211ffb8b1bdca3c3fc77e84ce0b9e299d1444384ac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release files / autostats-0.1.4-py3-none-any.whl

Download URL autostats-0.1.4-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b28070a45d0d241e32016760f025c1ab1378cdc8e33ea9011af08de423f9dbc9
BLAKE2b-256 checksum
How to use checksums
9e7a6da7f3a935c59f6a53d7a6cdf7c7c33afda70f5ed4f485ea4f8980f7bdc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Security for AutoStats 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page