ml_logistic_regression 0.0.1 copy "ml_logistic_regression: ^0.0.1" to clipboard
ml_logistic_regression: ^0.0.1 copied to clipboard

A lightweight, stable and trainable Logistic Regression package in pure Dart. Supports sigmoid prediction, L2 regularization, and classification thresholds.

example/main.dart

import 'package:ml_logistic_regression/ml_logistic_regression.dart';

void main() {
  final model = LogisticRegression(
    learningRate: 0.1,
    iterations: 1000,
    regularization: 0.01,
    threshold: 0.5,
  );

  final inputs = [
    [0.0, 0.0],
    [0.0, 1.0],
    [1.0, 0.0],
    [1.0, 1.0],
  ];
  final labels = [0, 0, 0, 1];

  model.fit(inputs, labels);
  print(model);

  final preds = model.predict(inputs);
  final probs = model.predictProba(inputs);

  for (int i = 0; i < inputs.length; i++) {
    print('Input: ${inputs[i]} → Label: ${labels[i]} → Predicted: ${preds[i]} → Prob: ${probs[i].toStringAsFixed(3)}');
  }
}
0
likes
130
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight, stable and trainable Logistic Regression package in pure Dart. Supports sigmoid prediction, L2 regularization, and classification thresholds.

Repository (GitHub)
View/report issues

Topics

#dart #machine-learning #logistic-regression #ai #classification

Documentation

API reference

License

MIT (license)

More

Packages that depend on ml_logistic_regression