{"id":30703253,"url":"https://github.com/ayush272002/cpp-ml-toolkit","last_synced_at":"2025-09-02T16:58:03.091Z","repository":{"id":310335104,"uuid":"1039488804","full_name":"Ayush272002/CPP-ML-Toolkit","owner":"Ayush272002","description":"Collection of machine learning algorithms implemented in C++ with Python bindings via pybind11.","archived":false,"fork":false,"pushed_at":"2025-08-24T18:56:35.000Z","size":67889,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T22:54:04.735Z","etag":null,"topics":["cpp","eigen","pybind11","spdlog"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Ayush272002.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,"zenodo":null}},"created_at":"2025-08-17T10:53:34.000Z","updated_at":"2025-08-24T18:56:38.000Z","dependencies_parsed_at":"2025-08-17T13:06:30.316Z","dependency_job_id":null,"html_url":"https://github.com/Ayush272002/CPP-ML-Toolkit","commit_stats":null,"previous_names":["ayush272002/cpp-ml-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ayush272002/CPP-ML-Toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FCPP-ML-Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FCPP-ML-Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FCPP-ML-Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FCPP-ML-Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ayush272002","download_url":"https://codeload.github.com/Ayush272002/CPP-ML-Toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayush272002%2FCPP-ML-Toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273317762,"owners_count":25084037,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp","eigen","pybind11","spdlog"],"created_at":"2025-09-02T16:57:59.556Z","updated_at":"2025-09-02T16:58:03.075Z","avatar_url":"https://github.com/Ayush272002.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPP-ML-Toolkit\n\nThis project is a collection of machine learning algorithms implemented in C++ with Python bindings via pybind11. It is designed for both educational and practical use, allowing you to experiment with and extend classic ML models efficiently.\n\n## C++ Libraries Used\n\n- **Eigen** — for linear algebra and matrix operations\n- **spdlog** — for fast, modern logging and debugging\n\n## Features\n- **High-performance C++ implementations** with optimized matrix operations\n- **Python bindings** for easy experimentation and visualization\n- **Comprehensive logging** with debug and info levels for traceability\n- **Visual comparisons** with scikit-learn implementations\n- **Modern CMake build system** with automatic dependency management (Eigen, spdlog, pybind11)\n- **Organized test structure** with performance metrics and plots\n\n## Currently Implemented Algorithms\n- **Linear Regression** — Full-batch and mini-batch gradient descent with regularization\n- **Logistic Regression** — Binary classification with L1/L2 regularization support\n- **K-Nearest Neighbors (KNN)** — Supports both classification and regression, multiple distance metrics (Euclidean, Manhattan, Minkowski)\n\n\n## Directory Structure\n```\ncpp-ml-toolkit/\n├── src/                # C++ source code\n├── include/            # C++ headers\n├── test/               # Python test and demo \n├── images/             # Output images (plots etc.)\n├── data/               # Datasets\n├── CMakeLists.txt      # Build configuration\n├── .gitignore\n└── README.md\n```\n\n## Performance Comparisons\n\nThe test scripts generate detailed performance comparisons with scikit-learn:\n\n### Linear Regression\n- **Dataset**: Boston Housing (normalized features)\n- **Metrics**: Mean Squared Error (MSE)\n- **Visualizations**: Loss curve during training, Predictions vs Actual scatter plot\n\n### Logistic Regression  \n- **Dataset**: Breast Cancer (highly imbalanced)\n- **Metrics**: Accuracy and AUC (Area Under ROC Curve)\n- **Visualizations**: Loss curve during training, Predicted probabilities comparison\n\n### K-Nearest Neighbors (KNN)\n- **Datasets**: Wine Quality\n- **Metrics**: Accuracy, Mean Squared Error (MSE)\n- **Visualizations**: Accuracy vs. k plot, Predictions vs Actual scatter plot\n\n\n## Getting Started\n1. **Clone the repository**:\n    ```bash\n    git clone https://github.com/Ayush272002/CPP-ML-Toolkit.git\n    ```\n\n2. **Install Python dependencies** (in your venv):\n   ```bash\n   pip install -r requirements.txt\n   ```\n3. **Install system dependencies** (for Ubuntu/Debian):\n   ```bash\n   sudo apt-get install libeigen3-dev python3-dev\n   ```\n4. **Build the project:**\n   ```bash\n   mkdir build \u0026\u0026 cd build\n   cmake ..\n   make\n   ```\n5. **Run Python demos/tests:**\n   ```bash\n   python3 test/LinearRegression.py\n   ```\n\nThe tests will generate performance metrics and save comparison plots in the `images/` directory.\n\n## Contributing\nContributions for new algorithms, bug fixes, and improvements are welcome! Please open an issue or pull request.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush272002%2Fcpp-ml-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayush272002%2Fcpp-ml-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush272002%2Fcpp-ml-toolkit/lists"}