ml_decision_tree 1.0.0
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']
}