Three coursework assignments covering core classical machine learning techniques: clustering, classification with dimensionality reduction, and regression. Each notebook follows the same structure — load data, explore, preprocess, train, evaluate, and interpret the result — applied to a different algorithm family and a different real-world dataset.
Customer segmentation on the Mall Customers dataset, comparing three clustering approaches on the same data:
| Notebook | Method |
|---|---|
part1_kmeans.ipynb |
Standard K-Means, with both Elbow and Silhouette methods for choosing k |
part2_kmeans_plusplus.ipynb |
K-Means with k-means++ centroid initialization |
part3_bisecting_kmeans.ipynb |
Bisecting K-Means — a divisive, hierarchical variant |
Each notebook compares StandardScaler (z-score) against MinMaxScaler
normalization before clustering, and evaluates the resulting clusters with
both the Elbow method (inertia) and Silhouette score.
Multiclass human activity recognition — classifying accelerometer/gyroscope sensor readings into activity types (walking, sitting, standing, etc.), using the Human Activity Recognition dataset.
| Notebook | Focus |
|---|---|
part1_svm.ipynb |
SVM classification with linear, RBF, and polynomial kernels, tuned via GridSearchCV |
part2_pca.ipynb |
Dimensionality reduction with PCA before SVM — comparing accuracy and training time against the full-feature model |
Predicting insurance charges from demographic and health features, using the Medical Cost Personal Datasets (insurance) dataset.
| Notebook | Method |
|---|---|
part1_polynomial_regression.ipynb |
Polynomial regression at degrees 1–5, analysing the bias-variance tradeoff |
part2_svr.ipynb |
Support Vector Regression with linear, polynomial, and RBF kernels, compared against the best polynomial regression result |
All three datasets are small, well-known public benchmarks, included directly in this repository:
| Dataset | File(s) | Source |
|---|---|---|
| Mall Customer Segmentation | Mall_Customers.csv |
Common Kaggle benchmark dataset |
| Human Activity Recognition | train.csv, test.csv |
UCI HAR Dataset |
| Medical Cost Personal Datasets | insurance.csv |
Common Kaggle benchmark dataset |
pip install -r requirements.txtOpen any notebook in Jupyter Notebook, JupyterLab, VS Code, or Google Colab, and run all cells in order — each notebook is self-contained and loads its dataset from the same folder.
Note: these notebooks were originally written in Google Colab and use
display()for formatted DataFrame previews. This works natively in Jupyter and Colab, but will raise aNameErrorif a cell is copied into a plain.pyscript run outside a notebook environment — replacedisplay(df)withprint(df)in that case.
- HW1: the standard K-Means and K-Means++ notebooks both settle on k=5 as optimal; Bisecting K-Means's Elbow plot suggests k=6, illustrating how the choice of algorithm can shift the "optimal" cluster count even on identical data.
- HW2: hyperparameter search (
GridSearchCV) is deliberately scoped to a small grid (C,gamma) to keep runtime reasonable — SVM training on the full HAR feature set is computationally expensive across a wider search space. - HW3: the SVR notebook (
part2_svr.ipynb) references the best polynomial regression result frompart1_polynomial_regression.ipynbas a fixed comparison value, carried over manually between notebooks rather than computed at runtime — a reasonable simplification for a two-part assignment, but worth knowing if reproducing the comparison table independently.
MIT — see LICENSE.
This repository contains coursework completed for AIN3001 (Machine Learning) at Bahçeşehir University, published for reference and learning. If you are taking this or a similar course, do not submit any part of this work as your own.