Skip to content
pubscout

ml_algo

16.18.2, released 13 days ago by ml-algo.com

Native Dart implementation of machine learning algorithms and performance evaluation tools.

$ flutter pub add ml_algo
Source repository

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.

Works with

Packages commonly used together with ml_algo: ones it builds on, ones built on it, and its own family.