{"id":20618336,"url":"https://github.com/ratikaewkam/linreg","last_synced_at":"2025-10-06T20:12:52.717Z","repository":{"id":259266631,"uuid":"877303349","full_name":"ratikaewkam/linreg","owner":"ratikaewkam","description":"Building my own C++ library for the Linear Regression","archived":false,"fork":false,"pushed_at":"2024-10-27T00:57:32.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T19:44:24.343Z","etag":null,"topics":["cpp","linear-regression","mathematics"],"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/ratikaewkam.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-10-23T12:38:30.000Z","updated_at":"2024-10-27T00:57:35.000Z","dependencies_parsed_at":"2024-10-24T01:20:05.570Z","dependency_job_id":"d2624db8-3cc1-4aa9-8332-a8e9d55665c9","html_url":"https://github.com/ratikaewkam/linreg","commit_stats":null,"previous_names":["ratikaewkam/linreg"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ratikaewkam/linreg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratikaewkam%2Flinreg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratikaewkam%2Flinreg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratikaewkam%2Flinreg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratikaewkam%2Flinreg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratikaewkam","download_url":"https://codeload.github.com/ratikaewkam/linreg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratikaewkam%2Flinreg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671792,"owners_count":26025756,"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-10-06T02:00:05.630Z","response_time":65,"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","linear-regression","mathematics"],"created_at":"2024-11-16T12:08:03.707Z","updated_at":"2025-10-06T20:12:52.690Z","avatar_url":"https://github.com/ratikaewkam.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# linreg\nBuilding my own C++ library for the Linear Regression\n\n![GitHub Release](https://img.shields.io/github/v/release/ratikaewkam/linreg)\n![GitHub contributors](https://img.shields.io/github/contributors/ratikaewkam/linreg)\n![GitHub repo size](https://img.shields.io/github/repo-size/ratikaewkam/linreg)\n![GitHub forks](https://img.shields.io/github/forks/ratikaewkam/linreg)\n\n\n## Latest Feature\n- Find a linear regression equation\n- Fix invalid track value\n- Update error handling (data size, invalid value)\n\n## Example\n```c++\n// main.cpp\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \u003clinreg.hpp\u003e\n\nint main()\n{\n    linreg::model model;\n    linreg::parameter param;\n\n    std::vector\u003cdouble\u003e x = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n    std::vector\u003cdouble\u003e y = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13};\n\n    double alpha = 0.01; // Learning rate\n    int epochs = 3333;\n    int track = 1; // Type 1 : track value\n\n    param = model.fit(x, y, param, alpha, epochs, track);\n\n    std::cout \u003c\u003c \"y = \" \u003c\u003c param.w \u003c\u003c \"x + \" \u003c\u003c param.b \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"loss: \" \u003c\u003c param.mse \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## Run\nRun the following command in the Developer CMD for VS\n```cmd\ncd build\n```\n```cmd\ncmake ..\n```\n```cmd\ncmake --build .\n```\n```cmd\ncd Debug\n```\n```cmd\nmain\n```\nor\n```cmd\ng++ -I lib/include -c lib/src/mse.cpp -o build/obj/mse.o\n\ng++ -I lib/include -c lib/src/gradient_descent.cpp -o build/obj/gradient_descent.o\n\ng++ -I lib/include -c lib/src/linreg.cpp -o build/obj/linreg.o\n\ng++ -I lib/include -o build/program/program main.cpp build/obj/mse.o build/obj/gradient_descent.o build/obj/linreg.o\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.\n\n## References\n[Gradient Descent](https://github.com/ratikaewkam/GradientDescent) | \n[Linear Regression](https://github.com/ratikaewkam/LinearRegression)\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n---\nDeveloped by [Rati Kaewkam](https://github.com/ratikaewkam)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratikaewkam%2Flinreg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratikaewkam%2Flinreg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratikaewkam%2Flinreg/lists"}