Skip to content

Repository files navigation

🧠 Prediction-Model_oral_cancer_prediction

A machine learning project dedicated to early oral cancer detection using patient data.

Version License Stars Forks

Project Preview Image

✨ Features

  • 📊 Data-Driven Diagnostics: Leverages comprehensive patient data including risk factors, symptoms, and treatment information for accurate predictions.
  • 🤖 Dual Model Approach: Implements both Logistic Regression and Random Forest algorithms for robust model comparison and performance evaluation.
  • 🎯 Early Detection Focus: Designed to support early diagnosis of oral cancer, enabling timely intervention and improved patient outcomes.
  • 📈 Performance Evaluation: Includes metrics and visualizations to assess model accuracy, precision, recall, and F1-score.
  • 🧪 Reproducible Analysis: Provided as a Jupyter Notebook for easy execution, modification, and exploration of the predictive models.

⚙️ Installation Guide

Follow these steps to set up and run the project locally.

1. Clone the Repository

First, clone the project repository to your local machine:

git clone https://github.com/the-first-lady/Prediction-Model_oral_cancer_prediction.git
cd Prediction-Model_oral_cancer_prediction

2. Set Up Python Environment

It is highly recommended to use a virtual environment to manage dependencies:

# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate

3. Install Dependencies

Install all necessary Python packages using pip:

pip install pandas numpy scikit-learn matplotlib seaborn jupyter

🚀 Usage Examples

To run the prediction models and explore the analysis:

1. Launch Jupyter Notebook

Navigate to the project directory and launch Jupyter Notebook:

jupyter notebook Prediction Model_oral_cancer_prediction.ipynb

2. Execute the Notebook

  • Open Prediction Model_oral_cancer_prediction.ipynb in your web browser.
  • Run all cells sequentially to load the dataset, preprocess data, train both Logistic Regression and Random Forest models, and evaluate their performance.
  • Observe model predictions, performance metrics, and visualizations.

Example Code Snippet (from the notebook)

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, confusion_matrix

# Load the dataset
df = pd.read_csv('oral_cancer_prediction_dataset.csv')

# Assuming 'target' is the column to predict
X = df.drop('target', axis=1)
y = df['target']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Train Logistic Regression
lr_model = LogisticRegression(random_state=42, solver='liblinear') # Added solver for clarity
lr_model.fit(X_train, y_train)
lr_predictions = lr_model.predict(X_test)
print("Logistic Regression Report:")
print(classification_report(y_test, lr_predictions))

# Train Random Forest
rf_model = RandomForestClassifier(random_state=42)
rf_model.fit(X_train, y_train)
rf_predictions = rf_model.predict(X_test)
print("\nRandom Forest Report:")
print(classification_report(y_test, rf_predictions))

Output Preview

![Model Performance Screenshot Placeholder][preview-image] [preview-image]: /preview_example.png "Screenshot of model performance metrics or visualizations"

🗺️ Project Roadmap

Our vision for the project includes the following enhancements and future goals:

  • v1.0.0 - Initial release with Logistic Regression and Random Forest models.
  • v1.1.0 - Implement additional machine learning models (e.g., SVM, Gradient Boosting).
  • v1.2.0 - Incorporate hyperparameter tuning and cross-validation for improved model robustness.
  • v1.3.0 - Develop a simple web interface (e.g., using Streamlit or Flask) for interactive predictions.
  • v2.0.0 - Explore deep learning approaches for enhanced prediction accuracy.
  • Future - Integrate more diverse and larger datasets for training and validation.

🤝 Contribution Guidelines

We welcome contributions to enhance this project! To contribute, please follow these guidelines:

  • Fork the repository and create your branch from main.
  • Code Style: Adhere to PEP 8 for Python code.
  • Branch Naming: Use descriptive branch names such as feature/add-svm-model or bugfix/fix-data-preprocessing.
  • Pull Requests:
    • Ensure your code is well-commented and easy to understand.
    • Provide a clear and concise description of your changes in the PR.
    • Reference any issues your PR addresses.
  • Testing: If adding new features or fixing bugs, include relevant unit tests to ensure functionality and prevent regressions.

📄 License Information

This project is currently unlicensed. This means that while you are free to fork and modify it for personal use, there are no explicit permissions or restrictions regarding distribution, commercial use, or further modification. Please be aware of the implications of using unlicensed software.

© 2024 the-first-lady. All rights reserved.

About

Proyek ini bertujuan untuk membangun model prediktif dalam mendiagnosis kanker mulut menggunakan data pasien. Dua algoritma pembelajaran mesin digunakan dalam proyek ini: Logistic Regression dan Random Forest. Dataset mencakup faktor risiko, gejala, dan informasi pengobatan untuk mendukung deteksi dini dan pengambilan keputusan.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages