Skip to main content

Automated dataset profiling, cleaning, visualization, and XGBoost modeling for tabular datasets.

Project description

MY727XGB

Automated dataset profiling, cleaning, XGBoost modeling, evaluation, visualization, and reporting from a CSV file or pandas DataFrame.

MY727XGB provides an automated machine-learning workflow built around XGBoost. With a single analyze() call, the package can inspect a dataset, clean and preprocess features, select or use a target column, detect the machine-learning task, train an XGBoost model, evaluate performance, generate visualizations, and produce HTML and JSON reports.

Features

analyze() accepts a CSV file path or pandas DataFrame and can automatically:

  • Profile the dataset, including schema, missing values, duplicates, cardinality, and distributions.
  • Select a target column when one is not explicitly provided.
  • Detect whether the task is classification or regression.
  • Identify potential target-leakage risks.
  • Clean duplicate rows, constant columns, ID-like columns, and high-missingness columns.
  • Handle missing values and categorical features.
  • Expand supported datetime features.
  • Train an XGBoost model.
  • Optionally perform hyperparameter tuning.
  • Evaluate the trained model using task-appropriate metrics.
  • Calculate feature importance.
  • Generate exploratory data analysis charts.
  • Generate target-distribution charts.
  • Generate feature-importance charts.
  • Generate classification or regression diagnostic charts where applicable.
  • Produce HTML and JSON reports.
  • Maintain analysis warnings, data-quality information, and an audit log.
  • Save and reload trained AutoXGB pipelines.
  • Generate predictions for new data.

Supported Platform

MY727XGB version 0.1.0 currently provides a compiled wheel for:

  • CPython 3.12
  • Windows x86-64

The wheel tag is:

cp312-cp312-win_amd64

Installation

Install MY727XGB using pip:

pip install my727xgb

Verify the installation:

python -c "import my727xgb; print(my727xgb.__version__); print(my727xgb.__file__)"

Quick Start

import my727xgb


result = my727xgb.analyze(
    "data.csv",
    target="target_column",
)


print(result.summary())

MY727XGB automatically runs the analysis pipeline and returns an AnalysisResult.

Analyze a CSV Dataset

import my727xgb


result = my727xgb.analyze(
    r"C:\datasets\customers.csv",
    target="churned",
)


print(result)

print("\nTASK:")
print(result.task_type)

print("\nTARGET:")
print(result.selected_target)

print("\nMETRICS:")
print(result.metrics)

Analyze a pandas DataFrame

import pandas as pd
import my727xgb


df = pd.read_csv(
    r"C:\datasets\customers.csv"
)


result = my727xgb.analyze(
    df,
    target="churned",
)


print(result.summary())

Automatic Target Selection

The target argument may be omitted when you want MY727XGB to select a target automatically.

import my727xgb


result = my727xgb.analyze(
    "data.csv"
)


print("SELECTED TARGET:")
print(result.selected_target)

print("SELECTION METHOD:")
print(result.target_selection_method)

print("TARGET CONFIDENCE:")
print(result.target_confidence)

print("TARGET CANDIDATES:")
print(result.target_candidates)

For important production analyses, explicitly specifying the intended target column is recommended.

Configuration

MY727XGB provides configuration objects for controlling model training and report generation.

import my727xgb


config = my727xgb.AutoXGBConfig(
    model=my727xgb.ModelConfig(
        tune=False,
        n_estimators=100,
    ),
    report=my727xgb.ReportConfig(
        output_dir="./my727xgb_output",
    ),
)


result = my727xgb.analyze(
    "customers.csv",
    target="churned",
    config=config,
)


print(result.summary())

Analysis Results

analyze() returns an AnalysisResult.

Common result attributes include:

print(result.task_type)

print(result.selected_target)

print(result.metrics)

print(result.feature_importance)

print(result.data_quality_summary)

print(result.warnings)

print(result.audit_log)

print(result.artifacts)

A formatted text summary is available through:

print(result.summary())

Generated Charts and Reports

MY727XGB automatically generates charts and reports during analysis.

Generated artifact paths are available through:

print(result.artifacts)

Depending on the dataset and task, generated visualizations can include:

  • Missing-value chart
  • Numeric distributions
  • Categorical distributions
  • Correlation heatmap
  • Target distribution
  • Feature importance
  • Confusion matrix
  • ROC curve
  • Regression diagnostics

MY727XGB also generates:

report.html
report.json

The default output directory is:

./my727xgb_output

Display Generated Charts in Jupyter Notebook

Charts are generated automatically and saved as PNG files.

They are not automatically displayed inline in Jupyter Notebook.

Use the following helper to display all generated visualization artifacts:

import os

from IPython.display import Image, display


def display_charts(value):
    """Display generated PNG charts recursively."""

    if isinstance(value, dict):

        for child in value.values():
            display_charts(child)

    elif isinstance(value, (list, tuple)):

        for child in value:
            display_charts(child)

    elif (
        isinstance(value, str)
        and value.lower().endswith(".png")
    ):

        path = os.path.abspath(value)

        if os.path.isfile(path):

            print(path)

            display(
                Image(filename=path)
            )


display_charts(
    result.artifacts["visualizations"]
)

Open the HTML Report

import os
import webbrowser


report_path = os.path.abspath(
    result.artifacts["html_report"]
)


webbrowser.open(
    "file:///" + report_path.replace("\\", "/")
)

Model Persistence

For reusable prediction pipelines, use AutoXGB.

import my727xgb


auto = my727xgb.AutoXGB(
    target="churned",
)


result = auto.fit(
    "customers.csv"
)


saved_path = auto.save(
    "saved_model"
)


print("MODEL SAVED:")
print(saved_path)

Load the saved pipeline:

import my727xgb


loaded_auto = my727xgb.AutoXGB.load(
    "saved_model"
)


predictions = loaded_auto.predict(
    "new_customers.csv"
)


print(predictions)

MY727XGB's save/load workflow has been tested by comparing predictions before saving and after loading the trained pipeline.

Credit Card Fraud Classification Example

MY727XGB has been tested on a highly imbalanced credit-card fraud dataset containing 284,807 rows.

import my727xgb


result = my727xgb.analyze(
    r"C:\datasets\creditcard.csv",
    target="Class",
)


print(result.summary())

print(result.metrics)

print(result.artifacts)

For highly imbalanced datasets, accuracy should not be interpreted alone. Review ROC AUC, precision, recall, F1 score, and the confusion matrix when evaluating model performance.

Documentation

For a beginner-focused walkthrough from installation through generated charts and reports, see:

USER_GUIDE.md

For detailed API behavior, configuration, preprocessing, model persistence, artifacts, troubleshooting, and other advanced topics, see:

docs/REFERENCE_GUIDE.md

Project Layout

The development repository separates the readable private implementation from the distributed package.

my727xgb/
│
├── README.md
├── USER_GUIDE.md
├── LICENSE
├── pyproject.toml
├── setup.py
│
├── docs/
│   └── REFERENCE_GUIDE.md
│
├── build_tools/
├── private_source/
├── public_src/
├── tests/
└── dist/

The readable implementation under private_source/ is not distributed in the release wheel.

The compiled engine is built into a platform-specific extension module for distribution.

Compilation can make casual source inspection more difficult, but it should not be considered absolute protection against reverse engineering.

Development

Install development dependencies:

pip install -e ".[dev]"

Run the test suite:

python -m pytest

Verify a built wheel:

python build_tools/verify_wheel.py dist\my727xgb-0.1.0-cp312-cp312-win_amd64.whl

Run the installed-wheel smoke test from outside the repository using the Python interpreter where the wheel was installed:

python path\to\test_installed_wheel.py

Version

Current release:

0.1.0

MY727XGB 0.1.0 is the initial public release. The public API may evolve before version 1.0.0.

Users deploying MY727XGB in production environments should pin the package version.

License

MIT License.

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

my727xgb-0.1.0-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file my727xgb-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: my727xgb-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for my727xgb-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5bc8143bdfb519923ebcb7bfea2a70f5da79976a7915fe4c065fb499d420244
MD5 77f165ac869e0088a1fd50a208eddd53
BLAKE2b-256 114bed199f26b38c35319fb102d63392f2f51c976dfe9a58a49f947482db6c78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page