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, Split

# 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()

# Split data
split = Split()
dataset = split.split(data.get("X"), data.get("Y"), test_size=0.4)

# Fit model on train set
model = SimpleLinearRegressor()
model.fit(dataset["X_train"], dataset["y_train"])

# Test model on hold-out set
test_results = model.test(dataset["X_test"], dataset["y_test"])

# View results
print(model.equation())
print(test_results)
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.

Split Class — Split X and Y lists into train and test sets.

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).

Contributing

Contributions are welcome. You reach out via Email: vinnyamonde@gmail.com

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.5.tar.gz (9.3 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.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_learnkit-0.1.5.tar.gz
  • Upload date:
  • Size: 9.3 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.5.tar.gz
Algorithm Hash digest
SHA256 5117b42e4edd079a95af0880a204707c8cd662c73f4d5701b304fadb0d3a659f
MD5 1f711e1941f9f20569fc792c8932e1df
BLAKE2b-256 749ead1bb5d2d0ddad666c3863b51f65f310b1f9727085407060ecd45bb8e8b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ml_learnkit-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 667bee706796745f54578a7f19d09e72f3165d44bb0abe259bf779d899f64a72
MD5 87e7c6fd2ac8859bb458e22f91719239
BLAKE2b-256 8b4213fbe0ec806e5682e17520b0e3605078ed24f867ca30f6a5e7e045a569b3

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