{"id":15150512,"url":"https://github.com/idaraabasiudoh/svm_cell_classification","last_synced_at":"2026-01-19T23:02:05.911Z","repository":{"id":255044997,"uuid":"848370460","full_name":"idaraabasiudoh/SVM_cell_classification","owner":"idaraabasiudoh","description":"This repository contains code for classifying cell samples using Support Vector Machine (SVM) with Scikit-learn.","archived":false,"fork":false,"pushed_at":"2024-08-27T16:43:06.000Z","size":1333,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T07:52:46.875Z","etag":null,"topics":["machine-learning","python3","scikit-learn","svm-classifier"],"latest_commit_sha":null,"homepage":"","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/idaraabasiudoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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-08-27T16:30:09.000Z","updated_at":"2024-08-27T16:43:09.000Z","dependencies_parsed_at":"2024-08-27T18:26:40.695Z","dependency_job_id":"cc97329a-44ce-472f-9c84-acce52fc55e8","html_url":"https://github.com/idaraabasiudoh/SVM_cell_classification","commit_stats":null,"previous_names":["idaraabasiudoh/breast_cancer_classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/idaraabasiudoh/SVM_cell_classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idaraabasiudoh%2FSVM_cell_classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idaraabasiudoh%2FSVM_cell_classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idaraabasiudoh%2FSVM_cell_classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idaraabasiudoh%2FSVM_cell_classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idaraabasiudoh","download_url":"https://codeload.github.com/idaraabasiudoh/SVM_cell_classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idaraabasiudoh%2FSVM_cell_classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28588968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["machine-learning","python3","scikit-learn","svm-classifier"],"created_at":"2024-09-26T14:20:44.682Z","updated_at":"2026-01-19T23:02:05.896Z","avatar_url":"https://github.com/idaraabasiudoh.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVM Classification of Cell Samples\n\nThis repository contains code for classifying cell samples using Support Vector Machine (SVM) with Scikit-learn. The dataset used includes various features of cell samples, and the project involves preprocessing the data, training the SVM model, and evaluating its performance using metrics such as the confusion matrix, F1 score, and Jaccard index.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Dataset](#dataset)\n- [Feature Selection](#feature-selection)\n- [Modeling](#modeling)\n- [Evaluation](#evaluation)\n- [Results](#results)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n\n## Installation\n\nTo run the code in this repository, you will need to have Python installed along with the following libraries:\n\n```bash\npip install scikit-learn==0.23.1\npip install pandas\npip install matplotlib\n```\n\n## Dataset\n\nThe dataset used in this project is a collection of cell samples that includes features such as `Clump Thickness`, `Uniformity of Cell Size`, `Uniformity of Cell Shape`, `Marginal Adhesion`, `Single Epithelial Cell Size`, `Bare Nuclei`, `Bland Chromatin`, `Normal Nucleoli`, and `Mitoses`. The target variable (`Class`) indicates whether the cells are benign (2) or malignant (4).\n\n### Downloading the Dataset\n\nThe dataset can be downloaded using the following code:\n\n```python\nimport requests\n\nurl = 'https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%203/data/cell_samples.csv'\nresponse = requests.get(url)\n\nwith open('cell_samples.csv', 'wb') as file:\n    file.write(response.content)\n```\n\n## Feature Selection\n\nThe following features are selected for training the model:\n\n- `Clump Thickness`\n- `Uniformity of Cell Size`\n- `Uniformity of Cell Shape`\n- `Marginal Adhesion`\n- `Single Epithelial Cell Size`\n- `Bare Nuclei`\n- `Bland Chromatin`\n- `Normal Nucleoli`\n- `Mitoses`\n\nData preprocessing includes handling missing values in the `Bare Nuclei` column.\n\n## Modeling\n\nThe model is built using the Support Vector Machine (SVM) algorithm with an RBF kernel:\n\n```python\nfrom sklearn import svm\n\nclf = svm.SVC(kernel='rbf')\nclf.fit(X_train, y_train)\n```\n\n## Evaluation\n\nThe model is evaluated using the following metrics:\n\n- **Confusion Matrix**: Displays the true positive, false positive, true negative, and false negative counts.\n- **F1 Score**: The weighted average of precision and recall.\n- **Jaccard Index**: A similarity measure that is used to compare the actual labels with the predicted labels.\n\nThe confusion matrix can be visualized using the `plot_confusion_matrix` function:\n\n```python\nfrom sklearn.metrics import confusion_matrix\n\ncnf_matrix = confusion_matrix(y_test, yhat, labels=[2,4])\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['Benign(2)','Malignant(4)'], normalize=False, title='Confusion matrix')\n```\n\n## Results\n\n- **Jaccard Index**: The Jaccard index for the model is computed as follows:\n\n```python\nfrom sklearn.metrics import jaccard_score\nprint(jaccard_score(y_test, yhat, pos_label=2))\n```\n\n## Contributing\n\nContributions are welcome! If you have any improvements or suggestions, please feel free to create a pull request or raise an issue.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nThis project is part of the IBM Developer Skills Network's machine learning course. Special thanks to the course creators for providing the dataset and the initial framework for this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidaraabasiudoh%2Fsvm_cell_classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidaraabasiudoh%2Fsvm_cell_classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidaraabasiudoh%2Fsvm_cell_classification/lists"}