{"id":18075635,"url":"https://github.com/udityamerit/Breast-Cancer-Prediction-using-different-ML-models","last_synced_at":"2025-03-28T16:33:32.619Z","repository":{"id":259079567,"uuid":"870492397","full_name":"udityamerit/Breast-Cancer-Prediction-using-different-ML-models","owner":"udityamerit","description":"This project implements multiple machine learning algorithms to predict breast cancer diagnoses based on medical diagnostic data. The project compares the performance of various models, providing insights into which algorithms are most effective for this task.","archived":false,"fork":false,"pushed_at":"2024-12-18T14:03:26.000Z","size":15373,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T10:22:15.295Z","etag":null,"topics":["classification","knn-algorithm","logistic-regression","machine-learning","numpy","pandas","scikit-learn","svm-model"],"latest_commit_sha":null,"homepage":"https://breastcareai.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udityamerit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T06:30:32.000Z","updated_at":"2025-03-16T09:57:51.000Z","dependencies_parsed_at":"2024-12-13T15:43:21.261Z","dependency_job_id":null,"html_url":"https://github.com/udityamerit/Breast-Cancer-Prediction-using-different-ML-models","commit_stats":null,"previous_names":["udityamerit/all_mlpackages","udityamerit/breast-cancer-prediction-using-different-ml-models"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udityamerit%2FBreast-Cancer-Prediction-using-different-ML-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udityamerit%2FBreast-Cancer-Prediction-using-different-ML-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udityamerit%2FBreast-Cancer-Prediction-using-different-ML-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udityamerit%2FBreast-Cancer-Prediction-using-different-ML-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udityamerit","download_url":"https://codeload.github.com/udityamerit/Breast-Cancer-Prediction-using-different-ML-models/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246063278,"owners_count":20717780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","knn-algorithm","logistic-regression","machine-learning","numpy","pandas","scikit-learn","svm-model"],"created_at":"2024-10-31T11:06:45.316Z","updated_at":"2025-03-28T16:33:32.556Z","avatar_url":"https://github.com/udityamerit.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Breast Cancer Prediction Using Multiple Machine Learning Models\n\n## Overview\nThis project implements multiple machine learning algorithms to predict breast cancer diagnoses based on medical diagnostic data. The project compares the performance of various models, providing insights into which algorithms are most effective for this task. The complete code is available in the [model.ipynb](https://github.com/udityamerit/Breast-Cancer-Prediction-using-different-ML-models/blob/main/model.ipynb) file.\n\n---\n\n## Features\n- **Dataset**: Features medical data such as `radius_mean`, `texture_mean`, `perimeter_mean`, and others. The target column is `diagnosis` (malignant or benign).\n- **Algorithms**: Includes Logistic Regression, Decision Tree, Random Forest, SVM, k-NN, and more.\n- **Evaluation Metrics**: Accuracy, precision, recall, F1-score, and ROC-AUC.\n- **Visualization**: Graphs and tables illustrate model comparisons.\n- **Notebook Implementation**: Code is structured in a Jupyter notebook for easy reproducibility.\n\n---\n\n## Prerequisites\n- Python (\u003e= 3.8)\n- Required libraries:\n  ```bash\n  pip install pandas numpy scikit-learn matplotlib seaborn\n  ```\n\n---\n\n## Workflow\n1. **Data Preprocessing**:\n   - Load and clean the dataset\n   - Encode categorical variables\n   - Normalize features using `StandardScaler`\n   - Split data into training and testing sets\n\n2. **Model Training and Evaluation**:\n   - Implement multiple ML algorithms\n   - Evaluate models using metrics like accuracy and ROC-AUC\n\n3. **Visualization**:\n   - Generate comparison graphs for model performance\n\n---\n\n## Dataset Description\nThe dataset includes:\n- **Features**:\n  - Mean values: `radius_mean`, `texture_mean`, `perimeter_mean`\n  - Standard error: `radius_se`, `texture_se`, `perimeter_se`\n  - Worst values: `radius_worst`, `texture_worst`, `perimeter_worst`\n- **Target Variable**:\n  - `diagnosis`: Malignant (`M`) or Benign (`B`)\n\n---\n\n## Code Snippets\n### 1. Importing Libraries\n```python\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import classification_report, roc_auc_score\n```\n\n### 2. Data Preprocessing\n```python\n# Load dataset\ndata = pd.read_csv('breast_cancer_data.csv')\ndata['diagnosis'] = data['diagnosis'].map({'M': 1, 'B': 0})\n\n# Feature-target split\nX = data.drop(columns=['diagnosis'])\ny = data['diagnosis']\n\n# Standardize the data\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# Train-test split\nX_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2, random_state=42)\n```\n\n### 3. Training Models\n#### Logistic Regression Example\n```python\nfrom sklearn.linear_model import LogisticRegression\n\nlog_reg = LogisticRegression()\nlog_reg.fit(X_train, y_train)\n\n# Evaluation\ny_pred = log_reg.predict(X_test)\nprint(\"Accuracy:\", accuracy_score(y_test, y_pred))\n```\n\n#### Random Forest Example\n```python\nfrom sklearn.ensemble import RandomForestClassifier\n\nrf_model = RandomForestClassifier(random_state=42)\nrf_model.fit(X_train, y_train)\n\n# Evaluation\ny_pred_rf = rf_model.predict(X_test)\nprint(\"Accuracy:\", accuracy_score(y_test, y_pred_rf))\n```\n\n---\n\n## Results\n### Model Performance\n| Model               | Accuracy | Precision | Recall | F1-Score | ROC-AUC |\n|---------------------|----------|-----------|--------|----------|---------|\n| Logistic Regression | 96%      | 94%       | 95%    | 94.5%    | 97%     |\n| Random Forest       | 98%      | 97%       | 96%    | 96.5%    | 99%     |\n| SVM                 | 95%      | 93%       | 94%    | 93.5%    | 96%     |\n| k-NN                | 92%      | 90%       | 91%    | 90.5%    | 93%     |\n\n### Visualization\n![Model Comparison](performance_graph.png)\n\n---\n\n## Conclusion\nThe Random Forest classifier achieved the highest accuracy and ROC-AUC, making it the most effective model for this dataset. Logistic Regression and SVM also performed well, indicating their suitability for medical diagnostic tasks.\n\n---\n\n## Future Enhancements\n- Incorporate deep learning models for enhanced prediction accuracy\n- Perform feature selection to reduce dimensionality\n- Use cross-validation for more robust performance evaluation\n\n---\n\n## How to Run\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/udityamerit/Breast-Cancer-Prediction-using-different-ML-models\n   ```\n2. Install the dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n3. Run the Jupyter Notebook:\n   ```bash\n   jupyter notebook model.ipynb\n   ```\n\n---\n\n## Acknowledgments\n- The dataset is sourced from the [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/index.php).\n- Project inspired by real-world medical applications of machine learning.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudityamerit%2FBreast-Cancer-Prediction-using-different-ML-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudityamerit%2FBreast-Cancer-Prediction-using-different-ML-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudityamerit%2FBreast-Cancer-Prediction-using-different-ML-models/lists"}