https://github.com/nimeshrawanage/ml-model-comparison-r
π ML Model Comparison | Predictive Analysis of the Wisconsin Dataset - Evaluating Random Forest, KNN, and SVM for breast cancer classification in R.
https://github.com/nimeshrawanage/ml-model-comparison-r
classification data-science knn machine-learning r random-forest svm
Last synced: about 1 month ago
JSON representation
π ML Model Comparison | Predictive Analysis of the Wisconsin Dataset - Evaluating Random Forest, KNN, and SVM for breast cancer classification in R.
- Host: GitHub
- URL: https://github.com/nimeshrawanage/ml-model-comparison-r
- Owner: NimeshRawanage
- License: mit
- Created: 2025-02-20T00:23:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-20T00:32:11.000Z (over 1 year ago)
- Last Synced: 2025-02-20T01:32:03.354Z (over 1 year ago)
- Topics: classification, data-science, knn, machine-learning, r, random-forest, svm
- Language: R
- Homepage:
- Size: 98.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Predictive Analysis of the Wisconsin Dataset
A Comparative Study of Random Forest, K-Nearest Neighbours, and Support Vector Machines
-------------------------
## Project Overview
This project presents a comparative analysis of three popular machine learning modelsβRandom Forest (RF), K-Nearest Neighbours (KNN), and Support Vector Machines (SVM)βusing the Wisconsin Breast Cancer Dataset. The goal is to determine which model provides the highest prediction accuracy for breast cancer diagnosis.
-------------------------
## Project Structure
ML-Model-Comparison-R/
βββ data/ # Contains the dataset (wisconsin.csv)
βββ models/ # Stores trained model files (e.g., knn_model.RData)
βββ results/ # Stores evaluation results and plots
βββ src/ # Source code folder
β βββ preprocess.R # Data Preprocessing
β βββ train_knn.R # KNN Model Training
β βββ train_rf.R # Random Forest Model Training
β βββ train_svm.R # SVM Model Training
β βββ evaluate.R # Model Evaluation and Metrics
β βββ visualize.R # Data Visualization
β βββ main.R # Master Script (Runs all steps)
βββ README.md # Project documentation
βββ LICENSE # Open-source license
-------------------------
## Dataset Information
- **Dataset Name:** Wisconsin Breast Cancer Dataset
- **Source:** [Kaggle Dataset](https://www.kaggle.com/datasets/uciml/breast-cancer-wisconsin-data)
- **License:** CC BY-NC-SA 4.0
-------------------------
## Machine Learning Models
- **Random Forest (RF):** Ensemble method using 100 decision trees.
- **K-Nearest Neighbours (KNN):** Implemented with `k=5` neighbors.
- **Support Vector Machines (SVM):** Default hyperparameters with a linear kernel.
-------------------------
## How to Run This Project
### Prerequisites
- R installed (version >= 4.0)
- Required libraries: `ggplot2`, `caret`, `randomForest`, `class`, `e1071`, `dplyr`
### Clone and Set Up the Repository
git clone https://github.com/NimeshRawanage/ML-Model-Comparison-R.git
cd ML-Model-Comparison-R
### Install Required R Packages
install.packages(c("ggplot2", "caret", "randomForest", "e1071", "class", "dplyr"))
### Run the Project
source("src/main.R")
-------------------------
## Future Improvements
- Implement hyperparameter tuning for all models.
- Introduce additional machine learning algorithms for comparison.
- Develop a web-based interface using Shiny for interactive model testing.
-------------------------
## License
This project is licensed under the MIT License. See the LICENSE file for details.
-------------------------
## Author
**Nimesh Rawanage**
- GitHub: https://github.com/NimeshRawanage
- LinkedIn: https://www.linkedin.com/in/nimeshrawanage/
-------------------------