Metadata-Version: 2.4
Name: mlp-jupyter
Version: 0.1.0
Summary: MLP: Machine Learning Python package for Jupyter Notebook integration.
Author: MLP Contributors
License-Expression: MIT
Keywords: mlp,jupyter,machine-learning,notebooks,education
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: Operating System :: OS Independent
Classifier: Framework :: IPython
Classifier: Framework :: Jupyter
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ipython>=7.0.0
Provides-Extra: all
Requires-Dist: numpy; extra == "all"
Requires-Dist: pandas; extra == "all"
Requires-Dist: scikit-learn; extra == "all"
Requires-Dist: matplotlib; extra == "all"
Requires-Dist: seaborn; extra == "all"
Requires-Dist: mlxtend; extra == "all"
Requires-Dist: openpyxl; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Dynamic: license-file

# MLP

A Python package for Jupyter Notebook integration and Machine Learning program execution.

## Overview

**MLP** provides seamless access to 18 Machine Learning practical programs and a shared dataset directly inside Jupyter Notebook cells. Programs are inserted directly into the next cell for inspection and manual execution without automatic execution.

---

## Installation

### Core Package (Lightweight)

To install MLP with only core Jupyter/IPython dependencies:

```bash
pip install mlp-jupyter
```

### Full Machine Learning Dependencies

To install MLP along with all dependencies required to execute the machine learning algorithms (`numpy`, `pandas`, `scikit-learn`, `matplotlib`, `seaborn`, `mlxtend`, `openpyxl`):

```bash
pip install "mlp-jupyter[all]"
```

### Development Installation

To install for local development and testing:

```bash
pip install -e ".[dev]"
```

---

## Python Version Compatibility

- Supported Python versions: **Python 3.8+** (including 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14).

---

## Jupyter Notebook Setup

1. Launch your Jupyter environment:
   ```bash
   jupyter notebook
   # or
   jupyter lab
   ```
2. Open a new or existing Python notebook.
3. Import the package:
   ```python
   import MLP
   ```

*(Note: The PyPI distribution name is `mlp-jupyter`, while the Python import name is strictly `MLP`).*

---

## Public API Reference

### 1. `MLP.list()`

Displays all 18 available programs in Part A and Part B order:

```python
import MLP

MLP.list()
```

Output:

```text
AVAILABLE MLP

PART A
DV-A   Data Visualization
AP-A   Apriori Algorithm
KNN-A  K-Nearest Neighbors
LR-A   Linear Regression
NB-A   Naive Bayes
DT-A   Decision Tree
RF-A   Random Forest
MM-A   Multiple Regression

PART B
CEB-B  Data Interfaces
DP-B   Data Preprocessing
DDD-B  Data Exploration
FPG-B  Frequent Pattern Growth
SV-B   Support Vector Machine
R-B    Regression
KM-B   K-Means Clustering
AC-B   Agglomerative Clustering
DBC-B  DBSCAN
NN-B   Neural Network
```

### 2. `MLP.get(program_id)`

Inserts the complete, unaltered source code of the specified program into the next notebook cell:

```python
MLP.get("LR-A")
```

- Accepts identifiers with or without `.py` extension (e.g. `"LR-A"` or `"LR-A.py"`).
- Uses `set_next_input(replace=False)` to create a new cell below the current one.
- Preserves all indentation, comments, and structure.
- **Never executes automatically**; the inserted cell is ready for manual review and execution.

### 3. `MLP.info(program_id)`

Displays metadata for any program:

```python
MLP.info("LR-A")
```

Output:

```text
Program ID:          LR-A
Program filename:    LR-A.py
Program description: Linear Regression
Part:                Part A
Program number:      4
```

### 4. `MLP.dataset(copy_to=None)`

Retrieves the absolute path to the bundled `common_dataset.csv`, or optionally copies it locally:

```python
# Get absolute path to the bundled dataset
path = MLP.dataset()
print(path)

# Copy the dataset into your current working directory
local_copy = MLP.dataset(copy_to=".")

# Or copy to a specific folder or file path
custom_copy = MLP.dataset(copy_to="data/common_dataset.csv")
```

The original package dataset remains untouched.

---

## Complete Program Catalog

| Part | Program ID | Filename | Description | Program Number |
| :--- | :--- | :--- | :--- | :---: |
| **Part A** | `DV-A` | `DV-A.py` | Data Visualization | 1 |
| **Part A** | `AP-A` | `AP-A.py` | Apriori Algorithm | 2 |
| **Part A** | `KNN-A` | `KNN-A.py` | K-Nearest Neighbors | 3 |
| **Part A** | `LR-A` | `LR-A.py` | Linear Regression | 4 |
| **Part A** | `NB-A` | `NB-A.py` | Naive Bayes | 5 |
| **Part A** | `DT-A` | `DT-A.py` | Decision Tree | 6 |
| **Part A** | `RF-A` | `RF-A.py` | Random Forest | 7 |
| **Part A** | `MM-A` | `MM-A.py` | Multiple Regression | 8 |
| **Part B** | `CEB-B` | `CEB-B.py` | Data Interfaces | 9 |
| **Part B** | `DP-B` | `DP-B.py` | Data Preprocessing | 10 |
| **Part B** | `DDD-B` | `DDD-B.py` | Data Exploration | 11 |
| **Part B** | `FPG-B` | `FPG-B.py` | Frequent Pattern Growth | 12 |
| **Part B** | `SV-B` | `SV-B.py` | Support Vector Machine | 13 |
| **Part B** | `R-B` | `R-B.py` | Regression | 14 |
| **Part B** | `KM-B` | `KM-B.py` | K-Means Clustering | 15 |
| **Part B** | `AC-B` | `AC-B.py` | Agglomerative Clustering | 16 |
| **Part B** | `DBC-B` | `DBC-B.py` | DBSCAN | 17 |
| **Part B** | `NN-B` | `NN-B.py` | Neural Network | 18 |

---

## Troubleshooting

### `Notice: MLP.get(...) requires an active IPython or Jupyter Notebook environment`
- **Cause**: `MLP.get()` was called from a standard headless script or standard terminal instead of Jupyter.
- **Resolution**: Run `MLP.get()` from inside a Jupyter Notebook cell or interactive IPython shell.

### `ModuleNotFoundError: No module named 'pandas'` (or `sklearn`, `matplotlib`)
- **Cause**: The specific ML program requires third-party packages that are not yet installed in your environment.
- **Resolution**: Install the complete dependency bundle using:
  ```bash
  pip install "mlp-jupyter[all]"
  ```

### `common_dataset.csv not found in DV-A`
- **Cause**: Running `DV-A` from a directory without the dataset.
- **Resolution**: Simply enter `common_dataset.csv` when prompted by `DV-A`; it automatically resolves to the bundled dataset via `MLP.dataset()`. Alternatively, provide the full path or copy it locally with `MLP.dataset(copy_to=".")`.

---

## License

This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
