Metadata-Version: 2.4
Name: ml-learnkit
Version: 0.1.5
Summary: Machine Learning and Statistical Analysis Toolkit
Author-email: Vincent Amonde <vinnyamonde@gmail.com>
License: MIT
Keywords: machine learning,statistics,regression,linear regression,anova,data science
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=2.0
Requires-Dist: pandas>=2.0
Requires-Dist: matplotlib>=3.8
Requires-Dist: scipy>=1.13
Requires-Dist: seaborn>=0.13
Requires-Dist: prettytable

# 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:

```bash
pip install ml-learnkit
```

Requires Python > 3.10.


## Quick Start

```python
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](https://github.com/vinnie-lab/ml-learnkit/blob/main/docs/reader.md) — Load data from Python lists into structured containers.

[Data Class](https://github.com/vinnie-lab/ml-learnkit/blob/main/docs/data.md) — Inspect and query tabular data with formatted output.

[Split Class](https://github.com/vinnie-lab/ml-learnkit/blob/main/docs/split.md) — Split X and Y lists into train and test sets.

[SimpleLinearRegressor](https://github.com/vinnie-lab/ml-learnkit/blob/main/docs/regression.md) — 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



