Skip to main content

Machine Learning and Statistical Analysis Toolkit

Project description

ml-learnkit

A lightweight Python toolkit for machine learning and statistical analysis, designed for education. It exposes every intermediate calculation so you can follow along with the maths, not just get an answer.

About the Author

Vincent Amonde

Intern, Big Data Engineering and Machine Learning at Safaricom PLC | 4th Year Student, Maseno University — Bachelor of Mathematical Sciences with IT | 3rd Year Student, The Open University of Kenya — Bachelor of Data Science

Email: vinnyamonde@gmail.com

Features

Load raw Python lists into structured data objects with tabular display. Build a simple linear regression model from first principles without black-box estimators. Access regression coefficients with standard errors, t-statistics, and p-values. Generate ANOVA tables with all sum-of-squares and mean-square decompositions. Render six diagnostic plots in a single call with 95% confidence bands, residual analysis, and influence diagnostics via seaborn.

Installation

Install from PyPI:

pip install ml-learnkit

Requires Python > 3.10.

Quick Start

from ml_learnkit import Reader, SimpleLinearRegressor

# Load data
reader = Reader()
data = reader.read_lists(
    lists=[[1, 2, 3, 4, 5], [2.1, 4.0, 5.9, 8.2, 9.8]],
    columns=["X", "Y"]
)

# Inspect
data.show()

# Fit model
model = SimpleLinearRegressor()
model.fit(data.get("X"), data.get("Y"))

# View results
print(model.equation())
model.regression_table()
model.anova()
model.plot()

Documentation

Complete documentation for each component:

Reader Class — Load data from Python lists into structured containers.

Data Class — Inspect and query tabular data with formatted output.

SimpleLinearRegressor — Fit and diagnose simple linear regression models.

Core Concepts

ml-learnkit implements ordinary least squares (OLS) regression with full transparency. Every calculation step is exposed: computation worksheets, intermediate sums of squares, standard errors, test statistics, and diagnostic plots. This educational design lets you verify each result against your own calculations or textbook examples.

The toolkit computes:

Regression coefficients (intercept b₀ and slope b₁), standard errors and t-statistics for both coefficients, two-tailed p-values from the t-distribution, ANOVA decomposition (SSR, SSE, SST, MSR, MSE, F-statistic), and six diagnostic plots (fitted line, residuals, Q-Q, scale-location, leverage, histogram).

Requirements

Package Minimum Version
Python > 3.10
numpy >= 2.0
pandas >= 2.0
matplotlib >= 3.8
scipy >= 1.13
seaborn >= 0.13
prettytable any recent

Project Structure

ml-learnkit/
├── project.toml
├── README.md
├── Regression.ipynb
├── docs/
│   ├── reader.md
│   ├── data.md
│   └── regression.md
└── ml_learnkit/
    ├── __init__.py
    ├── data.py
    ├── reader.py
    └── regression.py

Contributing

Contributions are welcome. Please open an issue before submitting a pull request so the change can be discussed first.

License

This project is licensed under the MIT License. See the LICENSE file 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 Distribution

ml_learnkit-0.1.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

ml_learnkit-0.1.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file ml_learnkit-0.1.2.tar.gz.

File metadata

  • Download URL: ml_learnkit-0.1.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for ml_learnkit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 77185be359c3a90a7ef8e48cf5e10d28acd30d52ece19e8e088516f9d569892c
MD5 a1b50dd1a00817eb8abe3f05c9f39928
BLAKE2b-256 14d91100cd10d3b34178c5f59444935d72b34931b8cffce7c7fcddd0f60624cd

See more details on using hashes here.

File details

Details for the file ml_learnkit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ml_learnkit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for ml_learnkit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c999992ea940fb7fc2d8f77e8df130dde45b7d0d6029948eba49166a8722dae
MD5 a374680b3b0f247107b3c7cb92d0af6d
BLAKE2b-256 9dc7115294a76ae2c8a93dd3630479503cc798c25b0bb08d529a0da44f9100d3

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