Skip to content
/ ai Public

AI Class for machine learning and data mining written on PHP

License

Notifications You must be signed in to change notification settings

rfahmi/ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Machine Learning & Data Mining Class (Apriori)

This is ML and DM Class written in PHP OOP, currently only support "Apriori"

This package is made for my college research purpose. But I made it opensource, so everyone can use this class for their projects (if needed) Written by: Fahmi Rizalul

Build Status License

Installation

All you need is just install this package into your project using composer.

$ composer require rfahmi/ai

That's all.

Features

Currently only support Apriori

Usage

Initialize

$apriori = new Apriori();
$apriori->setSupport(3);
$apriori->setConfidence(0.7);

Train Model

$items = ['A', 'B', 'C', 'D', 'E'];
$transactions = [
    ['A', 'B', 'C'],
    ['A', 'C'],
    ['A', 'B', 'D'],
    ['A', 'D'],
    ['B', 'C', 'E'],
];
$apriori->train($items, $transactions);

Get Rules & Frequent Set

$apriori->getRules();
$apriori->getFrequentset();

Prediction

$apriori->predict(['A']);

Support

Reach out to me at one of the following places!

Buy me coffee and snacks

paypal

License

About

AI Class for machine learning and data mining written on PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages