ml_algo
16.18.2, released 13 days ago by ml-algo.com
Native Dart implementation of machine learning algorithms and performance evaluation tools.
What it does
Provides native Dart implementations of popular machine learning algorithms including linear regression, logistic regression, decision trees, k-nearest neighbors, and clustering searchers. It supports cross-validation and hyperparameter tuning for Dart VM, Flutter, and web applications via WebAssembly.
AI-written summary of version 16.18.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to run machine learning models natively in Dart without relying on external native bindings.
- You are working on data science projects or lightweight predictive features in Flutter and web apps.
Skip it when
- You need complex deep learning architectures like neural networks or large language models.
- Your dataset contains non-numeric types like strings or nulls without pre-processing them first.
Strengths
- Pure Dart implementation works across mobile, desktop, and web via WebAssembly.
- Comprehensive collection of regression, classification, and retrieval algorithms.
- Built-in cross-validation and performance metric tools.
Weaknesses
- Does not support strings, booleans, or nulls natively; data must be preprocessed into numbers.
- Limited to classical machine learning algorithms rather than deep learning.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 8
Add the package to pubspec.yaml along with ml_dataframe and ml_preprocessing for data handling.
import 'package:ml_algo/ml_algo.dart';
import 'package:ml_dataframe/ml_dataframe.dart';
void main() {
final samples = getPimaIndiansDiabetesDataFrame();
final validator = CrossValidator.kFold(samples, numberOfFolds: 5);
final createClassifier = (DataFrame data) => LogisticRegressor(data, 'Outcome');
validator.evaluate(createClassifier, MetricType.accuracy);
}Alternatives
Packages that do the same job and could replace ml_algo.
- tflite_flutter
If you need to run TensorFlow Lite models on mobile devices instead of pure Dart classical algorithms.
68Compare
Works with
Packages commonly used together with ml_algo: ones it builds on, ones built on it, and its own family.
- json_annotationml_algo depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- quiverml_algo depends on itA set of utility libraries for Dart containing collections, async tools, and testing helpers.
- injectorml_algo depends on itA simple to use and lightweight dependency injection library for Dart.
- ml_linalgml_algo depends on itSIMD-based linear algebra and statistics library for Dart.
- ml_dataframeml_algo depends on itAn in-memory untyped data storage with querying and modification capabilities.
- ml_preprocessingml_algo depends on itPopular data preprocessing algorithms for machine learning in Dart.