Skip to content

Machine learning Algorithms in multiple languages

License

Notifications You must be signed in to change notification settings

brucetruth/ml-idea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ml-idea - Machine Learning library / algorithms

Minimum PHP Version GitHub issues GitHub license

The World is filled with Data, a lot of data [pictures, videos, text, music,... ] Machine learning provides means of deriving meaning from all of that data. Today not only is the data generated by people but also by phones, computers and other devices, the data is and will rapidly continue to grow. Machine learning will enable us to use this data to answer questions

Using data which will is traning, as we will inform the creation of the predictive model, and then this predictive model can then be used on unseen data to answer questions.

Machine learning uses algorithms to parse data, learn from that data, and make informed decisions based on what it has learned. Deep learning structures algorithms in layers to create an “artificial neural network” that can learn and make intelligent decisions on its own.

Installation

Install ML IDEA into your project using Composer:

$ composer require brucetruth/ml-idea

Requirements

  • PHP 7.4 or above

Classification algorithms examples

KNearestNegbours

include_once "vendor/autoload.php";

use ML\IDEA\Classifiers\KNearestNeighbors;

$samples = [[1, 3], [1, 4], [3, 4], [3, 1], [5, 1], [5, 2]];
$labels = ['a', 'a', 'b', 'b', 'c', 'c'];
$classifier = new KNearestNeighbors(6, true);
$classifier->train($samples, $labels);
$data = $classifier->predict([5, 3]);
echo "<pre>";
print_r($data);
echo "</pre>";