Skip to main content

A collection of 12 educational Machine Learning experiments for learning and demonstration.

Project description

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

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

mlcode-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

mlcode-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file mlcode-0.1.1.tar.gz.

File metadata

  • Download URL: mlcode-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for mlcode-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a537437dafebb5b67a5c77b0b2e9e64acd614ee017da11f5e5a587eade730d9c
MD5 95bf935e787d9b5c1eb69875aa4acd45
BLAKE2b-256 4106bf0215201633271f01b8c79050b1712b728e79eec57078ffe35aad33ec80

See more details on using hashes here.

File details

Details for the file mlcode-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mlcode-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for mlcode-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47a457c7f97fb098a0822d926e7fb7498111e378315fe63dc1790244ee6b6022
MD5 5861c76dfc90e79f416dcc5285c05e96
BLAKE2b-256 c5c211bf92b45831d0aa589e46a83508e1f2434a22bf6de357fcd30c4a89e64f

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