dart_ml 0.0.4 copy "dart_ml: ^0.0.4" to clipboard
dart_ml: ^0.0.4 copied to clipboard

outdated

A Dart package to leverage your apps by introducing Machine Learning to it. ML is now easy to implement in dart applications.

dart_ml #

Introduce machine machine learning to your dart supported apps from Android till Linux #

Contents #

  • Algorithms

    • Classification
      • K-Nearest-Neigbor In statistics, the k-nearest neighbors algorithm (k-NN) is a non-parametric classification method
      • Logistic Regressor Logistic regression is a supervised learning classification algorithm generally used where we have to classify the data into two or more classes
    • Regression
      • Coming soon!

Example #

Import package #

    import 'package:dart_ml/dart_ml.dart';

Load dataset #

    //Minimal dataset where each columns define the feature and the last row is the target class
    var dataset = [
               [2.7810836, 2.550537003, 0],
               [1.465489372, 2.362125076, 0],
               [3.396561688, 4.400293529, 0],
               [1.38807019, 1.850220317, 0],
               [3.06407232, 3.005305973, 0],
               [7.627531214, 2.759262235, 1],
               [5.332441248, 2.088626775, 1],
               [6.922596716, 1.77106367, 1],
               [8.675418651, -0.242068655, 1],
               [7.673756466, 3.508563011, 1]
                    ];

Using KNN algorithm #

    var predicted = knn(dataset, dataset[0], 3); // (train, test, num_neighbors)
    print(predicted); //{0:5} 0 is the target class and 5 is the num of neigbors of the same class that is 0

Using Logistic regression #

    var predicted = logreg(dataset, dataset[0], 0.3, 100)); // (train, test, l_rate, n_epoch)
    print(predicted); //0, returns the predicted class

Using Stline_forecast #

	var x = [1990, 1991, 1992, 1993, 1994]; //year
	var y = [28, 38, 46, 40, 56]; // sales for the corresponsing year
	var predicted = stline_forecast(x, y, 1995); // 59.0 predicted sales for the year 1995

Next Goals #

  • ⬜️ Regression Algorithms
  • ⬜️ Neural Networks
  • ⬜️ Model Evaluations
  • ⬜️ Dataset tools

Contact #

If you have questions, feel free to write me on

7
likes
0
pub points
36%
popularity

Publisher

unverified uploader

A Dart package to leverage your apps by introducing Machine Learning to it. ML is now easy to implement in dart applications.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on dart_ml