PHP-ML is a a fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feature Extraction and much more in one library.
Questions tagged [php-ml]
31 questions
3
votes
2 answers
Phpml\Exception\MatrixException Message: Matrix is singular
I'm making a program that will predict the next year's collection from
the database using php-ml.
and I'm getting this error.
Phpml\Exception\MatrixException Message: Matrix is singular
Im using this functions
use Phpml\Regression\LeastSquares;
use…

stephoroi
- 31
- 2
3
votes
3 answers
Using php-ai/php-ml with php
I am using notepad++. I have installed composer and from command line I have tried to install the php-ai/php-ml using the following line of code composer require php-ai/php-ml. My cmd tells me that this is successfully installed and everything seems…

johnfish92
- 157
- 2
- 12
2
votes
0 answers
Php-ml: PHP Machine Learning library, behavior issues
I'm using this library to predict numbers the thing is that I don't understand or don't get the problem in this piece of code, it always returns the same
>>> $SVR = new SVR(Kernel::LINEAR);
=> Phpml\Regression\SVR {#4304}
>>> $SVR->train([[1], [2],…

Christian
- 481
- 1
- 7
- 24
2
votes
0 answers
I need explanation, how the classifier is training (PHP-ML library)
Can someone explain to me how the classifier is trained and finally predicted? I have in mind the last two lines of code below. I can't understand how it is working.
I'm writing a thesis about ML and text classification and it is last one of my…

Daniel Kozina
- 69
- 2
- 7
2
votes
0 answers
How to predict with multiple features in Php-ai/Php-ml in PHP
I am using the Php-ai/Php-ml framework. In the example they give, the AI only uses one feature which is not helpful but on the main git page, they also give this example of using more than one feature:
$samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4,…

Jaquarh
- 6,493
- 7
- 34
- 86
2
votes
1 answer
How to increase the amount of features in PHP-AI in PHP?
I am building a Logistic Regression platform in PHP. The following code snippet works fine when there is only one feature inside the data frame. For example a CSV file like this:
"sample","language"
"Hello, how are you?","english",
"Je voudrais une…

Jaquarh
- 6,493
- 7
- 34
- 86
2
votes
1 answer
Recommendation Engine with PHP-ML and regression
I try to find out how to work with PHP-ML when i want to recommend some items to current customer.
My dataset (numeration is only the number of the row):
Product 1 was purchased together with Product 2
Product 1 was purchased together with…

Stefan
- 39
- 8
1
vote
0 answers
php-ml regression issues. Trying to predict price but there is an error
This was my error:
Fatal error: Uncaught TypeError:
Phpml\CrossValidation\Split::__construct(): Argument #1 ($dataset)
must be of type Phpml\Dataset\Dataset, array given, called in
C:\xampp\htdocs\490\testing2.php on line 23 and defined…

Arshado
- 41
- 5
1
vote
1 answer
php-ml regression predicts weird values
My input values are 1, 2, 3, 4, ... and my output values are 1*1, 2*2, 3*3, 4*4, ...
My code looks like this:
$reg = new LeastSquares();
$samples = array();
$targets = array();
for ($i = 1; $i < 100; $i++)
{
$samples[] = [$i];
$targets[] =…

zomega
- 1,538
- 8
- 26
1
vote
1 answer
Is any Machine Learning model appropriate for this dataset and desired output?
My dataset consists of video game titles from various websites, formatted in different ways. Here's my example:
"The Legend Of Zelda: Wind Waker, Nintendo"
"The Legend Of Zelda: The Wind Waker"
"The Legend Of Zelda: Wind Waker, Nintendo"
"The Legend…

Ethan Allen
- 14,425
- 24
- 101
- 194
1
vote
0 answers
How to use Neural Network to map keywords?
I am new to machine learning and neural network. I have a situation where, for house providing, we study the cases of a candidate and of a housing in order to predict the answer of the candidate. I have been given an exemple looking like this…

JeSuisPatate
- 5
- 4
1
vote
1 answer
PHPML library issue
I have been trying to get PHPML library to work ,
steps that I followed :
Downloaded the PHPML Library from github :
https://github.com/php-ai/php-ml
Composer install [ using PHP 7.1 ] {output} vendor folder size is
around 60MB
I wrote the…

AhMaD AbUIeSa
- 805
- 1
- 12
- 21
1
vote
0 answers
php script producing fatal error when ran as cron job but it gives correct result when ran from browser
Am working with php-ml for data manipulation. during testing from the browser the script returns data as expected. However, when I ran the same script as cron job it terminates once the KNearestNeighbors classification is called with the following…

domii
- 169
- 1
- 14
1
vote
1 answer
Running out of memory on PHP-ML
I am trying to implement a sentiment analysis with PHP-ML. I have a training data set of roughly 15000 entries. I have the code working, however, I have to reduce the data set down to 100 entries for it to work. When I try to run the full data set I…

Adonai
- 73
- 3
- 13
1
vote
1 answer
Reading in .csv file PHP-ML
I am using php-ml and taking in a .csv file with 6 columns and thousands of lines, i want every 5th element (column) of each array to be saved in $samples. I have tried the following which gives me the first element of each array.
$dataset = new…

johnfish92
- 157
- 2
- 12