Metadata-Version: 2.4
Name: ml-lab-codes
Version: 0.1.0
Summary: Educational library providing complete source codes for Machine Learning Laboratory experiments (1a to 5b).
Author: Sriram
License-Expression: MIT
Keywords: machine-learning,ml-lab,education,syllabus,linear-regression,logistic-regression,naive-bayes,decision-tree,id3,cart,svm,knn
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: ml
Requires-Dist: numpy; extra == "ml"
Requires-Dist: pandas; extra == "ml"
Requires-Dist: scikit-learn; extra == "ml"
Requires-Dist: matplotlib; extra == "ml"
Requires-Dist: networkx; extra == "ml"
Dynamic: license-file

# ml-lab-codes

An educational Python library that provides instant access to complete source codes for Machine Learning Laboratory experiments (Experiments 1a to 5b).

Designed for students, educators, and developers to easily view, inspect, and copy verified lab experiment programs directly in the Python shell, terminal, or Jupyter/Colab notebooks without having to execute the scripts or download datasets.

---

## Features

- **Zero-Dependency Code Inspection**: Display verified machine learning lab programs without downloading datasets or running heavy training loops.
- **Single Function API**: Use `show_code(program_number)` to print the full source code for any program (1 to 5).
- **All Experiments Covered**: Includes all sub-experiments (e.g. 1a & 1b, 3a & 3b, 4a & 4b, 5a & 5b) mapped into 5 self-contained programs.

---

## Installation

Install via `pip`:

```bash
pip install ml-lab-codes
```

If you plan to run and execute the machine learning models locally, you can also install the optional ML dependencies:

```bash
pip install "ml-lab-codes[ml]"
```

---

## Usage

### Display Program Code

```python
import ml_lab_codes

# Print the complete code for Experiment 1 (1a & 1b)
ml_lab_codes.show_code(1)
```

You can also import `show_code` directly:

```python
from ml_lab_codes import show_code

# Display Experiment 3 (ID3 & CART Decision Trees)
show_code(3)
```

### List All Available Programs

```python
import ml_lab_codes

ml_lab_codes.list_programs()
```

---

## Programme Mapping

| Number | Source File | Experiments Covered | Dataset Used |
| :---: | :---: | :--- | :--- |
| **1** | `prog1.py` | **Ex.No 1a**: Linear Regression<br>**Ex.No 1b**: Logistic Regression | Student Performance Dataset<br>Breast Cancer Wisconsin Dataset |
| **2** | `prog2.py` | **Ex.No 2**: Naive Bayes Classifier | Wine Recognition Dataset |
| **3** | `prog3.py` | **Ex.No 3a**: Decision Tree (ID3 Algorithm)<br>**Ex.No 3b**: Decision Tree (CART Algorithm) | Play Tennis Dataset<br>Iris Dataset |
| **4** | `prog4.py` | **Ex.No 4a**: Linear SVM Classifier<br>**Ex.No 4b**: Non-Linear SVM Classifier (RBF Kernel) | Online Food Ordering Dataset<br>Online Food Ordering Dataset |
| **5** | `prog5.py` | **Ex.No 5a**: k-Nearest Neighbor Classification<br>**Ex.No 5b**: k-Nearest Neighbor Regression | Iris Dataset<br>Iris Dataset |

---

## Error Handling

If an invalid or out-of-range program number is passed:

```python
from ml_lab_codes import show_code

try:
    show_code(6)
except ValueError as e:
    print(e)
    # Output: Invalid program number '6'. Please choose a number from 1 to 5.
```

---

## License

MIT License. See [LICENSE](LICENSE) for details.
