Skip to content
A kNN algorithm implemented in PHP, Python and Java.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
java
javascript
php
python
ruby
.gitignore
README.md
iris.csv

README.md

PHP 7 Machine Learning Comparison

This repository holds the source code for the PHP, Python, JavaScript and Java benchmarks used in the blog post, Is PHP now suitable for machine learning?

Instructions

In the blog post, the benchmarks were run on a single core php7dev Vagrant box. If you'd like to do the same, you'll need to install HHVM, PyPy, NodeJS and the default JDK.

From the location of this readme file, the following commands will run the benchmarks.

# PHP 5.6
newphp 56
php php/iris.php

# PHP 7
newphp 70
php php/iris.php

# Python 2
python python/iris.py

# Python 3
python 3 python/iris.py

# HHVM
hhvm php/iris.php

# PyPy
pypy python/iris.py

# JavaScript
nodejs javascript/iris.js

# Java
cd java
javac Iris.java
java Iris
You can’t perform that action at this time.