ml_helper 0.0.3 copy "ml_helper: ^0.0.3" to clipboard
ml_helper: ^0.0.3 copied to clipboard

A lightweight Dart library for machine learning, with linear regression, preprocessing, and metrics.

ML Helper #

pub version license

ML Helper is a lightweight Dart library for machine learning. It provides tools for linear regression, metrics, and data preprocessing, fully offline and Flutter-friendly.


Features #

  • πŸ“ˆ Linear Regression: A simple and easy-to-use implementation of the linear regression algorithm.
  • 🧼 Preprocessing: Essential tools for preparing your data, including normalization and train/test split.
  • πŸ“Š Metrics: Evaluate your model's performance with key metrics like accuracy, recall, f1-score, and Mean Squared Error (MSE).
  • πŸ”’ Math Utilities: A collection of helpful math functions such as mean, standard deviation, sigmoid, and softmax.
  • ⚑ Lightweight: Built with zero dependencies to keep your project lean.
  • πŸ“± Offline & Flutter-Friendly: Works seamlessly in your Dart and Flutter projects without needing an internet connection.

Getting Started #

1. Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  ml_helper: ^0.0.1

Then, run flutter pub get in your terminal.


Usage #

Import the package in the file where you want to use it:

import 'package:ml_helper/ml_helper.dart';

Here’s a quick example of how to use the LinearRegression model:

Code #

void main() {
  // 1. Sample data
  final X = [[1.0], [2.0], [3.0], [4.0]];
  final y = [2.0, 4.0, 6.0, 8.0];

  // 2. Create and train the model
  final model = LinearRegression();
  model.fit(X, y);

  // 3. Make predictions
  final predictions = model.predict([[5.0], [6.0]]);

  // The model learned y = 2x, so it should predict [10.0, 12.0]
  print('Predictions: $predictions');
}

Additional Information #

Feel free to file issues or suggest features on the GitHub repository's Issues tab, For any other inquiries, you can reach me at lutherbanze@gmail.com

3
likes
160
points
12
downloads

Documentation

API reference

Publisher

verified publisherlutherbanze.com

Weekly Downloads

A lightweight Dart library for machine learning, with linear regression, preprocessing, and metrics.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on ml_helper