{"id":16277748,"url":"https://github.com/aahouzi/simple_document_classification_from_scratch","last_synced_at":"2026-04-27T17:33:53.981Z","repository":{"id":169550872,"uuid":"317658941","full_name":"aahouzi/Simple_Document_Classification_From_Scratch","owner":"aahouzi","description":"Simple Document Classification using Multi Class Logistic Regression \u0026 SVM Soft Margin from scratch","archived":false,"fork":false,"pushed_at":"2022-07-30T12:23:20.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-29T18:50:28.506Z","etag":null,"topics":["logistic-regression","momentum-optimization-algorithm","natural-language-processing","optimization","python","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/aahouzi.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":"2020-12-01T20:25:03.000Z","updated_at":"2024-08-12T09:14:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf6f1317-3b5c-4992-8d10-dba2c681ab60","html_url":"https://github.com/aahouzi/Simple_Document_Classification_From_Scratch","commit_stats":null,"previous_names":["aahouzi-intel/simple_document_classification_from_scratch","aahouzi/simple_document_classification_from_scratch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aahouzi/Simple_Document_Classification_From_Scratch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahouzi%2FSimple_Document_Classification_From_Scratch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahouzi%2FSimple_Document_Classification_From_Scratch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahouzi%2FSimple_Document_Classification_From_Scratch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahouzi%2FSimple_Document_Classification_From_Scratch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aahouzi","download_url":"https://codeload.github.com/aahouzi/Simple_Document_Classification_From_Scratch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahouzi%2FSimple_Document_Classification_From_Scratch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["logistic-regression","momentum-optimization-algorithm","natural-language-processing","optimization","python","svm-classifier"],"created_at":"2024-10-10T18:56:16.948Z","updated_at":"2026-04-27T17:33:53.963Z","avatar_url":"https://github.com/aahouzi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Document Classification using Multi Class Logistic Regression \u0026 SVM Soft Margin from scratch\n\n## :monocle_face: Description\n\nThis mini-project contains an implementation from scratch of some Multi-Class Classification Algorithms. The data is already cleaned, and doesn't need any further pre-processing, it was encoded using Tf-idf (Term Frequency Inverse Document Frequency).\u003cbr /\u003e\n**Firstly**, I implemented the Logistic Regression algorithm with One-vs-All strategy to adapt the algorithm for the multi-classification task. I used the Momentum with SGD optimizer for optimizing the Binary Cross-Entropy loss used to get the optimal weight matrix.\u003cbr /\u003e\n**Secondly**, I implemented Multi-Class SVM with the same strategy as Logistic Regression, and since I chose soft margin SVM to deal with non-linearly separable data, I used the same previous optimizer to optimize the L2 reguralized Hinge loss. \u003cbr /\u003e\n\n## :rocket: Repository Structure\n\nThe repository contains the following files \u0026 directories:\n\n- **Notebooks directory:** It contains a jupyter notebook where the main functions of the project are called, and where results are displayed.\n- **Loss directory:** It contains an implementation of the various loss functions mentioned in the description, and their corresponding gradient calculus.\n- **Algorithms directory:** This directory contains an implementation of the various ML algorithms mentioned in the description.\n- **The dataset:** This mini-project was taken from a HackerRank challenge, you can refer to [the following link](https://www.hackerrank.com/challenges/document-classification/problem), to get the dataset as well as the instructions to solve the problem.\n\n## :bulb: Next steps\n\nImplementation of SVM with the Kernel trick, to deal with non-linearly separable data using various Kernel functions (Gaussian, Polynomial, etc..).\n\n## :mailbox_closed: Contact\n\nFor any information, feedback or questions, please [contact me][anas-email]\n\n[anas-email]: mailto:ahouzi2000@hotmail.fr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faahouzi%2Fsimple_document_classification_from_scratch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faahouzi%2Fsimple_document_classification_from_scratch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faahouzi%2Fsimple_document_classification_from_scratch/lists"}