🤖 MLCode Library
A professional, modular Python library designed for educational machine learning demonstrations. This package contains 10 structured experiments covering various core ML algorithms and Python concepts, complete with an interactive command-line interface to inspect source code and execute models dynamically.
✨ Features
- 🎓 Interactive Learning: Instantly view the source code of any experiment with a single call (
ip.exp1()). - 🚀 Dynamic Execution: Run any machine learning experiment and view its plots/outputs instantly (
ip.run1()). - 📂 Clean Module Layout: Designed using standard Python packaging best practices with automatic dependency discovery.
- ⚡ Hot Reloading: Easily install in editable mode for developers.
📦 Installation
1. Local Development (Editable Mode)
To install the package locally so that any updates to the experiment files are immediately available:
cd "c:\Users\Himeshwar\Desktop\mlcodes\mlcode"
pip install -e .
2. Standard Global Installation
To install the package permanently on your machine:
pip install .
🛠️ Usage
Open a Jupyter Notebook, a VS Code Interactive Window, or a standard Python terminal and run:
import mlcode as ip
# 1. List all available experiments
ip.show()
# 2. View the source code of Experiment 1
ip.exp1()
# 3. Dynamically run Experiment 1 and show the plot
ip.run1()
📚 Educational Experiments Included
Here are the 10 experiments included in this library and what they demonstrate:
| Experiment | Focus Area / Algorithm | Description | Python Concept Shown |
|---|---|---|---|
exp1 |
📈 Linear Regression | Univariate salary prediction model. | Basic Arithmetic & Imports |
exp2 |
🛢️ LSM Regression | Fuel consumption least squares prediction model. | String Manipulation |
exp3 |
🤖 Machine Learning | Basic model training loops and data iteration. | Loops |
exp4 |
⚖️ Conditionals | Data thresholding and model routing logic. | If-Else Conditions |
exp5 |
🧱 Modular ML | Function-wrapped model training pipeline. | Functions |
exp6 |
🌳 Decision Trees | Classification and tree plotting on a custom dataset. | Lists |
exp7 |
🌀 Dimensionality Reduction | Principal Component Analysis (PCA) visualization. | Dictionaries |
exp8 |
🛡️ Robust Pipelines | Safe training wrapper with input error validation. | Error Handling |
exp9 |
🏷️ KMeans Clustering | Unsupervised K-Means clustering algorithm. | List Comprehensions |
exp10 |
🏗️ Class-based ML | Object-Oriented Random Forest / Classifier. | Basic Classes |
🚀 Publishing Globally
1. Build Package Distributions
Build the standard Wheel (.whl) and Source Archive (.tar.gz):
pip install build
python -m build
2. Upload to PyPI (Python Package Index)
Publish the compiled build artifacts so anyone in the world can run pip install mlcode:
pip install twine
python -m twine upload dist/*
(Note: If the name mlcode is already taken on PyPI, rename the name field in setup.py to something unique like mlcode-himeshwar and rebuild!)
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for mlcode 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlcode-0.1.1.tar.gz | 10.2 kB | Without provenance | Details for mlcode-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mlcode-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mlcode-0.1.1-py3-none-any.whl |
Total release size: 21.5 kB
Release files / mlcode-0.1.1.tar.gz
| Download URL | mlcode-0.1.1.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a537437dafebb5b67a5c77b0b2e9e64acd614ee017da11f5e5a587eade730d9c
|
|
BLAKE2b-256 checksum How to use checksums |
4106bf0215201633271f01b8c79050b1712b728e79eec57078ffe35aad33ec80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / mlcode-0.1.1-py3-none-any.whl
| Download URL | mlcode-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47a457c7f97fb098a0822d926e7fb7498111e378315fe63dc1790244ee6b6022
|
|
BLAKE2b-256 checksum How to use checksums |
c5c211bf92b45831d0aa589e46a83508e1f2434a22bf6de357fcd30c4a89e64f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Security for mlcode 0.1.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.