{"id":13800924,"url":"https://github.com/retraigo/la-classy","last_synced_at":"2025-10-25T13:32:02.114Z","repository":{"id":168510374,"uuid":"644236184","full_name":"retraigo/la-classy","owner":"retraigo","description":"Machine Learning Module for Single Layer Perceptron ML models, written in Rust for Typescript.","archived":false,"fork":false,"pushed_at":"2024-04-01T06:10:58.000Z","size":730,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-04T00:05:37.261Z","etag":null,"topics":["classification","deno","machine-learning","regression","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/retraigo.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":"retraigo","patreon":"retraigo","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-05-23T05:30:17.000Z","updated_at":"2024-04-18T12:03:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e563c71-cbd9-4798-a6fc-8c6fc3efd8ae","html_url":"https://github.com/retraigo/la-classy","commit_stats":null,"previous_names":["retraigo/classy-lala","retraigo/la-classy"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retraigo%2Fla-classy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retraigo%2Fla-classy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retraigo%2Fla-classy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retraigo%2Fla-classy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retraigo","download_url":"https://codeload.github.com/retraigo/la-classy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865554,"owners_count":16555929,"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":["classification","deno","machine-learning","regression","rust","typescript"],"created_at":"2024-08-04T00:01:17.698Z","updated_at":"2025-10-25T13:32:01.770Z","avatar_url":"https://github.com/retraigo.png","language":"Rust","funding_links":["https://github.com/sponsors/retraigo","https://patreon.com/retraigo"],"categories":["Modules"],"sub_categories":["Machine learning"],"readme":"\u003cimg src=\"/assets/lala.webp\" alt=\"La Lala\" height=\"256px\" width=\"auto\"\u003e\n\n\u003ch1\u003eLa Classy\u003c/h1\u003e\n\nSingle Layer Perceptron (SLP) library for Deno.\n\nThis library is written TypeScript and Rust and it uses FFI.\n\n## Why Classy?\n\n- It's fast.\n- It gives you some freedom to experiment with different combinations of loss functions, activation functions, etc.\n- It's easy to use.\n\n## Features\n\n- Optimization Algorithms:\n  - Gradient Descent\n  - Stochastic Average Gradients\n  - Ordinary Least Squares\n- Optimizers for updating weights:\n  - RMSProp\n  - ADAM\n- Schedulers for learning rate:\n  - One-cycle Scheduler\n  - Decay\n- Regularization\n- Activation Functions:\n  - Linear (regression, SVM, etc.)\n  - Sigmoid (logistic regression)\n  - Softmax (multinomial logistic regression)\n  - Tanh (it's just there)\n- Loss Functions:\n  - Mean Squared Error (regression)\n  - Mean Absolute Error (regression)\n  - Cross-Entropy (multinomial classification)\n  - Binary Cross-Entropy / Logistic Loss (binary classification)\n  - Hinge Loss (binary classification, SVM)\n\n## Quick Example\n\n### Regression\n\n```ts\nimport { Matrix } from \"jsr:@lala/appraisal@0.7.5\";\nimport {\n  GradientDescentSolver,\n  adamOptimizer,\n  huber,\n} from \"jsr:@lala/classy@1.2.1\";\n\nconst x = [100, 23, 53, 56, 12, 98, 75];\nconst y = x.map((a) =\u003e [a * 6 + 13, a * 4 + 2]);\n\nconst solver = new GradientDescentSolver({\n  // Huber loss is a mix of MSE and MAE\n  loss: huber(),\n  // ADAM optimizer with 1 + 1 input for intercept, 2 outputs.\n  optimizer: adamOptimizer(2, 2),\n});\n\n// Train for 700 epochs in 2 minibatches\nsolver.train(\n  new Matrix(\n    x.map((n) =\u003e [n]),\n    \"f32\"\n  ),\n  new Matrix(y, \"f32\"),\n  { silent: false, fit_intercept: true, epochs: 700, n_batches: 2 }\n);\n\nconst res = solver.predict(\n  new Matrix(\n    x.map((n) =\u003e [n]),\n    \"f32\"\n  )\n);\n\nfor (let i = 0; i \u003c res.nRows; i += 1) {\n  console.log(Array.from(res.row(i)), y[i]);\n}\n```\n\nThere are other examples in [retraigo/deno-ml](https://github.com/retraigo/deno-ml).\n\n## Documentation\n\n[JSR](https://jsr.io/@lala/classy)\n\n## Maintainers\n\nPranev ([retraigo](https://github.com/retraigo))\n\nDiscord: [Kuro's ~~Chaos Abyss~~ Graveyard](https://discord.gg/A69vvdK)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretraigo%2Fla-classy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretraigo%2Fla-classy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretraigo%2Fla-classy/lists"}