{"id":19482597,"url":"https://github.com/axegon/sklite-dart","last_synced_at":"2025-10-17T20:29:20.702Z","repository":{"id":41300902,"uuid":"205865277","full_name":"axegon/SkLite-dart","owner":"axegon","description":"Transpile scikit-learn models to Flutter","archived":false,"fork":false,"pushed_at":"2023-02-24T20:25:09.000Z","size":48,"stargazers_count":34,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-08-20T23:08:24.986Z","etag":null,"topics":["dart","flutter","scikit-learn"],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/axegon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-02T13:39:30.000Z","updated_at":"2023-06-09T07:01:23.000Z","dependencies_parsed_at":"2022-09-11T13:30:54.486Z","dependency_job_id":null,"html_url":"https://github.com/axegon/SkLite-dart","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axegon%2FSkLite-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axegon%2FSkLite-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axegon%2FSkLite-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axegon%2FSkLite-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axegon","download_url":"https://codeload.github.com/axegon/SkLite-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224007933,"owners_count":17240294,"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":["dart","flutter","scikit-learn"],"created_at":"2024-11-10T20:11:22.653Z","updated_at":"2025-10-17T20:29:15.655Z","avatar_url":"https://github.com/axegon.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SkLite-dart\n\n[![SkLite Demo App](http://img.youtube.com/vi/K5D1T1VJBR8/0.jpg)](http://www.youtube.com/watch?v=K5D1T1VJBR8 \"SkLite-dart demo\")\n\n* Porting Scikit-Learn models to Flutter *\n\n## Getting Started\n\nThe library uses pre-trained models using scikit-learn and [sklite](https://github.com/axegon/SkLite) for python. Once built and exported, the models can be used in Flutter with ease. You need to load them inside your application and use them accordingly to your case:\n\nYou need to setup a local static directory where you can store the generated JSON file using [sklite](https://github.com/axegon/SkLite).\n\nPut sklite in your pubspec.yaml file, import whichever model it is you intend to use and use the `predict` method as you would in scikit-learn. Use the\n`loadModel` in utils/dart.io for your application, the other functions are for development and testing only.\n\n## Supported models\n\n| IMPLEMENTATION                     | STATUS |\n|------------------------------------|--------|\n| KNeighborsClassifier               | ✓      |\n| SVC                                | ✓      |\n| GaussianProcessClassifier          |        |\n| DecisionTreeClassifier             | ✓      |\n| RandomForestClassifier             | ✓      |\n| MLPClassifier                      | ✓      |\n| AdaBoostClassifier                 |        |\n| GaussianNB                         | ✓      |\n| QuadraticDiscriminantAnalysis      |        |\n| BernoulliNB                        | ✓      |\n| LinearSVC                          | ✓      |\n\n## Usage\n\nYou first need to add the library to your project's pubspec.yaml. For the time being the library hasn't been published to pub.dev (should be soon enough though).\n\n```\ndependencies:\n  sklite: ^0.0.1\n```\n\n\nAdd a static assets directory inside your Flutter project:\n\n```\nflutter:\n  uses-material-design: true\n  assets:\n    - assets/\n```\n\nPut the generated model using [sklite for python](https://github.com/axegon/SkLite) in the specified directory\n\nImport the library in your application and load the model:\n\n```\nimport 'package:flutter/material.dart';\nimport 'package:sklite/SVM/SVM.dart';\nimport 'package:sklite/utils/io.dart';\nimport 'dart:convert';\n\nvoid main() =\u003e runApp(new MaterialApp(\n  home: new HomePage(),\n  debugShowCheckedModeBanner: false)\n);\n\nclass HomePage extends StatefulWidget {\n  @override\n  _HomePageState createState() {\n    return new _HomePageState();\n  }\n}\n\nclass _HomePageState extends State\u003cHomePage\u003e {\n  SVC svc;\n\n  _HomePageState() {\n    loadModel(\"assets/svcmnist.json\").then((x) {\n      this.svc = SVC.fromMap(json.decode(x));\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n        // add any widget with svc.predict() callback\n    );\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxegon%2Fsklite-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxegon%2Fsklite-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxegon%2Fsklite-dart/lists"}