{"id":20224992,"url":"https://github.com/adwaith-rajesh/linearml","last_synced_at":"2025-07-19T16:08:47.864Z","repository":{"id":186383196,"uuid":"675091403","full_name":"Adwaith-Rajesh/LinearML","owner":"Adwaith-Rajesh","description":"A Linear Algebra and Machine Learning \"Library\"  in C","archived":false,"fork":false,"pushed_at":"2024-05-04T16:16:51.000Z","size":1017,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T23:23:28.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://adwaith-rajesh.github.io/LinearML/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adwaith-Rajesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["Adwaith-Rajesh"]}},"created_at":"2023-08-05T18:40:08.000Z","updated_at":"2023-11-13T09:48:42.000Z","dependencies_parsed_at":"2024-05-04T17:38:53.914Z","dependency_job_id":null,"html_url":"https://github.com/Adwaith-Rajesh/LinearML","commit_stats":null,"previous_names":["adwaith-rajesh/linearml"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2FLinearML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2FLinearML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2FLinearML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2FLinearML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adwaith-Rajesh","download_url":"https://codeload.github.com/Adwaith-Rajesh/LinearML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241670063,"owners_count":20000323,"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":[],"created_at":"2024-11-14T07:10:17.926Z","updated_at":"2025-03-03T12:43:55.550Z","avatar_url":"https://github.com/Adwaith-Rajesh.png","language":"C","funding_links":["https://github.com/sponsors/Adwaith-Rajesh"],"categories":[],"sub_categories":[],"readme":"![LinearML Logo](/docs/assets/linear_ml_banner.png)\n\nA Linear Algebra and Machine Learning \"Library\" in C\n\n---\n\n# Why.....\n\nWell, I'm currently doing my bachelors in AI\u0026DS so it just appropriate that I try out\nevery machine learning algo I learn. And not just try these algorithms but also package\nthem in such a way that I can use these Algo's instead of third-party ones.\n\nThis package, even if I try for the next 10 years, will not be anywhere close to the the\nthird party packages. This is just a learning experience for me. This package is meant\nto grow with me as I learn new Machine Learning Algo or anything similar\n\n## Some goals\n\n- All the algo will be written in C\n- There will be compilation options to\n  - Compile everything to a single shared object file.\n  - Compile individual packages. eg just the Vec package, ML ..etc\n- Have nice API's to interact with Python\n\n### Example\n\n```c\n#define INCLUDE_MAT_CONVERSIONS\n#include \"ds/mat.h\"\n#include \"ml/logisticregress.h\"\n#include \"model/metrics.h\"\n#include \"model/train_test_split.h\"\n#include \"parsers/csv.h\"\n\nint main(void) {\n    CSV *csv_reader = csv_init(569, 31, ',');\n    csv_parse(csv_reader, \"data/bcancer.csv\");\n\n    Mat *X = csv_get_mat_slice(csv_reader, (Slice){1, 31});\n    Mat *Y = csv_get_mat_slice(csv_reader, (Slice){0, 1});\n    Mat *X_train, *X_test, *Y_train, *Y_test;\n\n    train_test_split(X, Y, \u0026X_train, \u0026X_test, \u0026Y_train, \u0026Y_test, 0.3, 101);\n\n    logregress_set_max_iter(2000);\n    LogisticRegressionModel *model = logregress_init();\n    logregress_fit(model, X_train, Y_train);\n\n    Array *preds = logregress_predict_many(model, X_test);\n    Array *true = mat_get_col_arr(Y_test, 0);\n\n    logregress_print(model);\n\n    printf(\"confusion matrix: \\n\");\n    Mat *conf_mat = model_confusion_matrix(true, preds);\n    mat_print(conf_mat);\n\n    arr_free(true);\n    arr_free(preds);\n    logregress_free(model);\n    mat_free_many(7, X, Y, X_test, X_train, Y_test, Y_train, conf_mat);\n    csv_free(csv_reader);\n}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOutput\u003c/summary\u003e\n\n```console\nLogisticRegressionModel(bias: 0.5159147, loss: -12.4263621, weights: 0x5556e8a732c0)\nweights:\n1546.6922009\n1139.6829595\n8552.1648900\n2522.0044946\n11.8724211\n-19.3345598\n-44.9646156\n-18.4984994\n23.8378678\n10.1676564\n0.2338315\n103.3839701\n-139.7864354\n-4498.8563443\n0.2662770\n-6.5798244\n-8.6158697\n-1.6938180\n1.6508702\n-0.3857419\n1650.7843571\n1445.0283208\n8312.7672485\n-4024.9280673\n13.2972726\n-72.4527931\n-111.8298475\n-26.6204266\n28.0612275\n5.4099162\nconfusion matrix:\n  57.00   10.00\n  2.00   101.00\n\n```\n\n\u003c/details\u003e\n\nThe dataset used can be found [here](https://gitlab.com/adwaithrajesh/linear-ml-test/-/blob/main/data/bcancer.csv?ref_type=heads). which is a modified version of [this](https://www.kaggle.com/datasets/uciml/breast-cancer-wisconsin-data) dataset\n\n### Docs\n\nDocs for LinearML can be found [here](https://adwaith-rajesh.github.io/LinearML/)\n\n## Bye...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwaith-rajesh%2Flinearml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadwaith-rajesh%2Flinearml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwaith-rajesh%2Flinearml/lists"}