This repository contains a mini machine learning project where three algorithms are implemented from scratch:
- One Rule (OneR)
- k-Nearest Neighbors (k-NN)
- Naive Bayes
The purpose of this project is to understand the foundational concepts of these algorithms by implementing them without using any external machine learning libraries.
To get started, clone the repository and install the dependencies:
git clone https://github.com/ali1sba/ML_mini_project.git
cd ML_mini_project
pip install -r requirements.txt.
├── dataset
│ └── raw_data.csv # TODO
│ └── sample_submission.csv # Sample submission data
│ └── test.csv # features related to patient, hospital. Need to predict the Length of stay for each case_id
│ └── train.csv # Features related to patient, hospital and Length of stay on case basis
│ └── train_data_dict.csv # Information of the features in train file
├── KNN
| ├── dataset
| │ └── raw_test01.csv # TODO
| │ └── raw_train01.csv # TODO
| │ └── sample_submission.csv # Sample submission data
| │ └── test.csv # features related to patient, hospital. Need to predict the Length of stay for each case_id
| │ └── train.csv # Features related to patient, hospital and Length of stay on case basis
| │ └── train_data_dict.csv # Information of the features in train file
| ├── KNN.ipynb # k-Nearest Neighbors algorithm implementation
├── Naive Bayes
│ └── ML MINI PROJET CAT_VERSION.ipynb # Naive Bayes algorithm implementation
│ └── train.csv # TODO
├── ONE RULE.ipynb # One Rule algorithm implementation
├── README.md # This README file
└── requirements.txt # TODO
A simple classification algorithm that creates a single rule based on one feature. The rule is selected by evaluating which single feature provides the highest accuracy.
A non-parametric method used for classification and regression. It classifies data points based on the majority label of their k nearest neighbors in the feature space.
A probabilistic classifier based on Bayes' theorem with strong (naive) independence assumptions between the features. Often used for text classification and spam filtering.
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
git checkout -b feature/new-feature - Commit your changes
git commit -m 'Add new feature' - Push to the branch
git push origin feature/new-feature - Open a Pull Request
This project is licensed under the MIT License.
For any questions or suggestions, please contact:
Email: HARIRI Ali
GitHub: ali1sba