Metadata-Version: 2.5
Name: mlextend
Version: 0.1.0
Summary: Ready-to-copy source code of 10 machine learning practicals (EDA, regression, KNN, decision tree, K-Means, PCA, Apriori, Q-Learning).
License-Expression: MIT
License-File: LICENSE
Keywords: education,lab,machine learning,practicals,scikit-learn,source code
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# mlextend

Ready-to-copy source code for 10 machine learning practicals.

`mlextend` does **not** run anything. Each experiment only gives you its complete
Python code as plain text. Copy it into Jupyter Notebook, VS Code or any other
Python environment and run it there.

## Installation

```bash
pip install mlextend
```

The package itself has no dependencies. Each practical lists the libraries it needs
in its first comment lines, for example:

```bash
pip install numpy pandas matplotlib seaborn scikit-learn statsmodels mlxtend
```

## Usage

```python
import mlextend

mlextend.list_experiments()   # list all experiments

mlextend.exp1.print()         # print the complete code of Experiment 1
```

Or import single experiments:

```python
from mlextend import exp3, exp7

exp3.print()
```

| Call | What it does |
|---|---|
| `exp1.print()` | Prints the complete code as plain text, ready to copy |
| `exp1.code` | Returns the complete code as a Python string |
| `exp1.show()` | Shows syntax-highlighted code in Jupyter (plain text elsewhere) |
| `exp1.save("exp1.py")` | Saves the code to a `.py` file (default name: `exp1.py`) |

`save()` will not replace an existing file unless you pass `overwrite=True`:

```python
mlextend.exp1.save("exp1.py", overwrite=True)
```

None of these calls execute, import or compile the practical code.

## Using your own dataset

Where a practical reads a file, the line just above it is marked:

```python
# CHANGE THIS PATH TO YOUR DATASET
data = pd.read_csv("heart_disease.csv")
```

Replace the file name with the path to your own CSV, and make sure the column names
match the ones used in the code. No datasets are bundled with this package.

| Experiment | File needed | Required columns |
|---|---|---|
| exp4 | `heart_disease.csv` | `Age, Resting_Blood_Pressure, Cholesterol, Maximum_Heart_Rate, Exercise_Induced_Angina, Heart_Disease` |
| exp7 | `Mall_Customers.csv` | `Age, Annual Income (k$), Spending Score (1-100)` |

All other experiments generate their own data or use a dataset built into scikit-learn.
exp1 and exp2 also show where to plug in your own CSV.

## Experiments

| Name | Topic | Libraries |
|---|---|---|
| `exp1` | Data Pre-processing and Exploratory Data Analysis (EDA) | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp2` | Simple Linear Regression | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp3` | Multiple Linear Regression (House Price Prediction) | numpy, pandas, matplotlib, seaborn, scikit-learn, statsmodels |
| `exp4` | Logistic Regression for Heart Disease Prediction | pandas, matplotlib, scikit-learn |
| `exp5` | K-Nearest Neighbors (KNN) Classifier for Credit Risk Rating | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp6` | Decision Tree Classifier for Multi-Class Credit Risk Assessment | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp7` | K-Means Clustering for Customer Profiling | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp8` | Dimensionality Reduction using PCA | numpy, pandas, matplotlib, seaborn, scikit-learn |
| `exp9` | Apriori Algorithm for Association Rule Mining | pandas, mlxtend |
| `exp10` | Q-Learning Algorithm for Grid World Environment | numpy, pandas |

## License

MIT
