ml_decision_tree 1.0.0 copy "ml_decision_tree: ^1.0.0" to clipboard
ml_decision_tree: ^1.0.0 copied to clipboard

A native decision tree classifier (ID3) for Dart.

ml_decision_tree #

A simple and native implementation of Decision Tree Classifier (ID3) for Dart.

Features #

  • Train and predict using decision trees
  • Handles categorical data
  • Lightweight and dependency-free

Usage #

import 'package:ml_decision_tree/ml_decision_tree.dart';

void main() {
  final X = [
    ['Sunny', 'Hot', 'High', false],
    ['Rain', 'Cool', 'Normal', true],
  ];

  final y = ['No', 'Yes'];

  final clf = DecisionTreeClassifier();
  clf.fit(X, y);

  final prediction = clf.predict([
    ['Sunny', 'Cool', 'High', true],
  ]);

  print(prediction); // ['No']
}
0
likes
140
points
108
downloads

Publisher

unverified uploader

Weekly Downloads

A native decision tree classifier (ID3) for Dart.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on ml_decision_tree