AI PHP is a wrapper for rubix ml to make AI very approachable

Overview

AI PHP Rubix Wrap

A wrapper for Rubix ML to make it very approachable

Example:

    $report = RubixService::train($data, 'column_with_label');

Where column_with_label is the key of the multi dimensional array $data that contains the value that you want to predict.

Let's make a simple example:

$apartment_data = [
        ['space_m2' =>  10, 'price' => 100],
        ['space_m2' =>  20, 'price' => 200],
        ['space_m2' =>  30, 'price' => 300],
        ['space_m2' =>  40, 'price' => 400],
        //...
        ['space_m2' => 280, 'price' => 2800],
        ['space_m2' => 290, 'price' => 2900],
        ['space_m2' => 300, 'price' => 3000],
];

$report = RubixService::train($apartment_data, 'price');

var_export($report);

/* 
  array (
    'mean absolute error' => 68.88888888888889,
    ...
    'r squared' => 0.9796739130434783,
    ...
  )
*/ 

$prediction = RubixService::predict(['space_m2' => 250]);
//$prediciton ~2440
    

See full example of above code here

Reports / Errors / Accuracy

Mean absolute error is basically the actual error you can expect in average. So in average if trying to predict an apartment given the space, you'd be off, in average, by 68.88$

r squared on the other hand gives more of a feeling how good the algorithm is in %. A high r squared means it works well. For categorical features like cat or dog a different report is returned

Estimators / Machine Learning Algorithm

RubixService::train() will use a default estimator (machine learning algorithm) depending on the data. If you want to choose a different estimator I recommend reading here

rubix ml choosing an estimator

Notice: Neural network is called Multilayer Perceptron in Rubix. Linear regression is called Ridge.

Per default it uses K-d Neighbors or K-d Neighbors Regressor

RubixService::train() takes as well transformers

In detail RubixService:train() does

  1. shuffle of $data
  2. train against 70% of $data
  3. test against 30% of $data

You can change that behaviour by using the argument train_part_size e.g. if you want to train on 80%, and test on 20% you would do RubixService::train(... train_part_size: 0.8).

You might also like...
A very simple way to handle self-hosted WordPress plugin updates

Simple WP Plugin Update handling A very simple way to handle self-hosted WordPress plugin updates This uses the "update_plugins_{$hostname}" filter in

Run your WP site on github pages, php innovation award winner  https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html
Run your WP site on github pages, php innovation award winner https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Gitpress Run wordpress directly on github pages Gitpress won the innovation award for may 2021 Read more about this https://naveen17797.github.io/gitp

Sslurp is a simple library which aims to make properly dealing with SSL in PHP suck less.

Sslurp v1.0 by Evan Coury Introduction Dealing with SSL properly in PHP is a pain in the ass and completely insecure by default. Sslurp aims to make i

PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

📢 Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Make your PHP arrays sweet'n'safe

Mess We face a few problems in our PHP projects Illogical type casting (PHP's native implementation is way too "smart") Pointless casts like array =

A PHP package to make the Chronopost API easier to use.

Chronopost API A PHP package to make the Chronopost API easier to use. Table of Contents Requirements Installation Usage Testing Requirements PHP 7.3,

meterN is a lightweight set of PHP/JS files that make a " Home energy metering & monitoring " solution.

meterN - Home energy monitor - (PHP/JS Energy Metering & Monitoring) What can meterN do for you ? meterN is a lightweight set of PHP/JS files that mak

This library uses GD and EXIF (optional) PHP extensions so make sure you have them installed.

simple and fast image processing class that can downscale, compress and convert images using php-gd native functions

Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in php .
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in php .

Ultramsg.com WhatsApp Bot using WhatsApp API and ultramsg Demo WhatsApp API ChatBot using Ultramsg API with php. Chatbot tasks: The output of the comm

Releases(0.9.1.1)
Owner
null
Rubix ML - A high-level machine learning and deep learning library for the PHP language.

A high-level machine learning and deep learning library for the PHP language. Developer-friendly API is delightful to use 40+ supervised and

Rubix 1.7k Jan 6, 2023
Very easy to use a current limiting component, the code is very simple, based on the webman framework.

Very easy to use a current limiting component, the code is very simple, based on the webman framework.

nsp-team 13 Dec 29, 2022
The best announcer for PocketMine-MP 4.0 servers, make messages for your users very easily

BroadcastACM The best announcer for PocketMine-MP 4.0 servers, make messages for your users very easily. Make the best announcements for your server w

fernanACM 3 May 30, 2022
This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT

ADMS-Real-time-project This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT Advance_

Nitya parikh 1 Dec 1, 2021
Very flexible git hook manager for php developers

CaptainHook CaptainHook is an easy to use and very flexible git hook library for php developers. It enables you to configure your git hook actions in

CaptainHook 812 Dec 30, 2022
This PHP class uploads files and manipulates images very easily

This PHP class uploads files and manipulates images very easily. It is in fact as much as an image processing class than it is an upload class. Compatible with PHP4, 5 and 7. Supports processing of local files, uploaded files, files sent through XMLHttpRequest.

Colin Verot 795 Dec 21, 2022
Very soykaf IB+BBS software. Work_In_Progress demo below.

ImoutoIB - Terrible imageboard software. But anon-san — if it's so terrible, Why should I use it? You probably shouldn't. It's not equipped to handle

ithrts 5 Jan 13, 2022
X1 - A very simple web based note solution that's designed to serve as my second brain.

X1 A very simple web based note solution that's designed to serve as my second brain. Starting Server To start the tool simply clone the repo and then

Joel Dare 118 Dec 28, 2022
Echo your public IP address with a very simple cURL request

Echo your public IP address with a very simple cURL request

Lucas Burlingham 13 Apr 10, 2022
Leaf's very own high-speed, high-performance server

[WIP] Leaf Eien Server Eien is Leaf's implementation of a high-speed, high-performance server based on powerful tools like Open Swoole and Swoole. Eie

Leaf Framework 8 Dec 28, 2022