SlideShare a Scribd company logo
Machine Learning
In PHP
What is Data Mining and Machine Learning
Source: [1]
It’s All About Feature Extraction
Source: [2]
Users Of Websites
# page1 page2 page3 page4 produ
ct1
produ
ct2
produ
ct3
produ
ct4
produ
ct5
Buy
Status
user1 0 0 0 1 0 0 1 1 0 No
user2 1 0 0 0 0 1 1 0 0 Yes
user3 0 0 1 0 1 1 0 0 0 No
...
Type Of Machine Learning
Classification: KNN, SVM, MLP, C4.5, RandomForest
Clustering: KMeans, DBSCAN, OPTICS
How many of you, Love PHP?
PHP
Source: [3]
How many of you, ,Hate?
PHP
Source: [4]
Data Mining Is About to Matrix
Matrix
Source: [5]
A Benchmark, PHP VS Python
Problem: Fine All Prime Number Below 10000
PHP 1.39
Python 1.84
Source: [6]
Another Benchmark, PHP VS Python
Problem2: 2000000 Time Calculating MD5(N+N)
> So, PHP5 Is Not Good For Computation
PHP5 21.43
Python 9.87
Source: [6]
Languages that Companies Used Fro ML
Source: [11
Any Q Bro?
Source: [7]
But Wait, Something Change these days
Source: [8]
Comparison
Source: [6]
Source: [8]
A Little About Optimization
> You Want to Optimize IO?
1. High Level Optimization ⇒ Disk IO
2. Low Level Optimization ⇒ RAM IO
We Focus On Low Level Optimization
> You Want to Optimize IO?
1. High Level Optimization ⇒ Disk IO
2. Low Level Optimization ⇒ RAM IO
Cache Vs RAM Access Time
Source: [9]
We must Optimize these 3:
1. Memory Allocation
2. Memory Usage
3. Memory Indirection
Something Improved IN PHP7
> Ints, Floats
> Objects
> Strings
> Arrays → HashTables
Something Improved IN PHP7
> Ints, Floats
> Objects
> Strings
> Arrays → HashTables
PHP 5(Core Variables)
Behind All PHP Variables There is a ZVAL C struct:
typedef union _zvalue_value {
long lval;
double dval;
struct {
char *val;
int len;
} str;
HashTable *ht;
zend_object_value obj;
} zvalue_value;
Source: [10]
PHP 7(Core Variables)
Behind All PHP Variables There is a ZVAL C struct:
typedef union _zend_value {
zend_long lval;
double dval;
zend_refcounted *counted;
zend_string *str;
zend_array *arr;
zend_object *obj;
zend_resource *res;
zend_reference *ref;
zend_ast_ref *ast;
zval *zv;
void *ptr;
zend_class_entry *ce;
zend_function *func;
struct {
uint32_t w1;
uint32_t w2;
} ww;
} zend_value;
Source: [10]
What is The Difference In Arrays(5 vs 7)?
PHP5 PHP7
Allocations: 2 + 2 per
element
2 + 0 per
element
Size: 72 + 112 per
element
56 + 36 per
element
Now, What tools to use?
https://github.com/gburtini/Learning-Library-for-PHP
Fork: 74 Star: 246
DBScan, Kmeans, KNN, Markov Chain, Naive Bayes and ...
A Better Tool
https://github.com/php-ai/php-ml > Only For PHP 7
Fork: 493 Star: 3988
SVC, KNN, KMean, Naive Bayes, SVR, Least Square and ...
Cross Validation, Normalization, TF-IDf, Metrics and …
Hybrid Approaches
Use PHP with these services:
> Amazon Machine Learning
> Python Core with Tensorflow, Scikit and …
> Google Cloud Prediction API
> IBM Watson
Any Question Again?
Images and Contents Sources
[1] http://blog.kaggle.com/2015/04/22/scikit-learn-video-3-machine-learning-first-steps-with-the-iris-dataset/
[2] http://sebastianraschka.com/Articles/2015_pca_in_3_steps.html
[3] http://www.designbolts.com/
[4] https://openclipart.org/detail/213226/broken-heart-icon
[5] http://beirutpress.net/article/311667
[6] http://www.hurricanesoftwares.com/php-vs-python-analysis/
[7] http://www.bartarinha.ir/fa/news/332320/%D8%A7%D9%87%D9%85%DB%8C%D8%AA-%D8%A7%D8%B5%D8%BA%D8%B1-%D9%81%D8%B1%D9%87%D8%A7%D8%AF%DB%8C-%D8%A8%D9%88%D8%AF%D9%86
[8] https://owncloud.org/blog/php-7-is-here-and-owncloud-is-ready/
[9] https://www.slideshare.net/chris1adkin/sql-server-engine-cpu-cache-as-the-new-ram
[10] http://www.phpinternalsbook.com/
[11] https://www.ibm.com/developerworks/community/blogs/jfp/entry/What_Language_Is_Best_For_Machine_Learning_And_Data_Science?lang=en
Where Am I:
Website: MasoudKaviani.ir
Telegram: masoud_kaviani
Instagram: masoudkaviani
Twitter: masoud_kaviani

More Related Content

Similar to داده کاوی در زبان پی‌اچ‌پی

Intro To C++ - Class #17: Pointers!, Objects Talking To Each Other
Intro To C++ - Class #17: Pointers!, Objects Talking To Each OtherIntro To C++ - Class #17: Pointers!, Objects Talking To Each Other
Intro To C++ - Class #17: Pointers!, Objects Talking To Each Other
Blue Elephant Consulting
 
C# advanced topics and future - C#5
C# advanced topics and future - C#5C# advanced topics and future - C#5
C# advanced topics and future - C#5
Peter Gfader
 
PDC Video on C# 4.0 Futures
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futures
nithinmohantk
 
2009-02 Oops!
2009-02 Oops!2009-02 Oops!
2009-02 Oops!
terry chay
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7
Wim Godden
 
Go Native : Squeeze the juice out of your 64-bit processor using C++
Go Native : Squeeze the juice out of your 64-bit processor using C++Go Native : Squeeze the juice out of your 64-bit processor using C++
Go Native : Squeeze the juice out of your 64-bit processor using C++Fernando Moreira
 
Extending php (7), the basics
Extending php (7), the basicsExtending php (7), the basics
Extending php (7), the basics
Pierre Joye
 
Php extensions
Php extensionsPhp extensions
Php extensions
Elizabeth Smith
 
The why and how of moving to php 7.x
The why and how of moving to php 7.xThe why and how of moving to php 7.x
The why and how of moving to php 7.x
Wim Godden
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
julien pauli
 
The why and how of moving to php 7.x
The why and how of moving to php 7.xThe why and how of moving to php 7.x
The why and how of moving to php 7.x
Wim Godden
 
Cross Platform App Development with C++
Cross Platform App Development with C++Cross Platform App Development with C++
Cross Platform App Development with C++
Joan Puig Sanz
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?
Wim Godden
 
PHP in 2018 - Q1 - AFUP Limoges
PHP in 2018 - Q1 - AFUP LimogesPHP in 2018 - Q1 - AFUP Limoges
PHP in 2018 - Q1 - AFUP Limoges
✅ William Pinaud
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
Xinchen Hui
 
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
PROIDEA
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
Wim Godden
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
Kevin Pilch
 
Introduction to column oriented databases in PHP
Introduction to column oriented databases in PHPIntroduction to column oriented databases in PHP
Introduction to column oriented databases in PHP
Zend by Rogue Wave Software
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocol
Tho Q Luong Luong
 

Similar to داده کاوی در زبان پی‌اچ‌پی (20)

Intro To C++ - Class #17: Pointers!, Objects Talking To Each Other
Intro To C++ - Class #17: Pointers!, Objects Talking To Each OtherIntro To C++ - Class #17: Pointers!, Objects Talking To Each Other
Intro To C++ - Class #17: Pointers!, Objects Talking To Each Other
 
C# advanced topics and future - C#5
C# advanced topics and future - C#5C# advanced topics and future - C#5
C# advanced topics and future - C#5
 
PDC Video on C# 4.0 Futures
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futures
 
2009-02 Oops!
2009-02 Oops!2009-02 Oops!
2009-02 Oops!
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7
 
Go Native : Squeeze the juice out of your 64-bit processor using C++
Go Native : Squeeze the juice out of your 64-bit processor using C++Go Native : Squeeze the juice out of your 64-bit processor using C++
Go Native : Squeeze the juice out of your 64-bit processor using C++
 
Extending php (7), the basics
Extending php (7), the basicsExtending php (7), the basics
Extending php (7), the basics
 
Php extensions
Php extensionsPhp extensions
Php extensions
 
The why and how of moving to php 7.x
The why and how of moving to php 7.xThe why and how of moving to php 7.x
The why and how of moving to php 7.x
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
The why and how of moving to php 7.x
The why and how of moving to php 7.xThe why and how of moving to php 7.x
The why and how of moving to php 7.x
 
Cross Platform App Development with C++
Cross Platform App Development with C++Cross Platform App Development with C++
Cross Platform App Development with C++
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?
 
PHP in 2018 - Q1 - AFUP Limoges
PHP in 2018 - Q1 - AFUP LimogesPHP in 2018 - Q1 - AFUP Limoges
PHP in 2018 - Q1 - AFUP Limoges
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
 
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
4Developers 2018: Ile (nie) wiesz o strukturach w .NET (Łukasz Pyrzyk)
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
 
Introduction to column oriented databases in PHP
Introduction to column oriented databases in PHPIntroduction to column oriented databases in PHP
Introduction to column oriented databases in PHP
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocol
 

Recently uploaded

Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
GetInData
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
eddie19851
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 

Recently uploaded (20)

Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 

داده کاوی در زبان پی‌اچ‌پی

  • 2. What is Data Mining and Machine Learning Source: [1]
  • 3. It’s All About Feature Extraction Source: [2]
  • 4. Users Of Websites # page1 page2 page3 page4 produ ct1 produ ct2 produ ct3 produ ct4 produ ct5 Buy Status user1 0 0 0 1 0 0 1 1 0 No user2 1 0 0 0 0 1 1 0 0 Yes user3 0 0 1 0 1 1 0 0 0 No ...
  • 5. Type Of Machine Learning Classification: KNN, SVM, MLP, C4.5, RandomForest Clustering: KMeans, DBSCAN, OPTICS
  • 6. How many of you, Love PHP? PHP Source: [3]
  • 7. How many of you, ,Hate? PHP Source: [4]
  • 8. Data Mining Is About to Matrix Matrix Source: [5]
  • 9. A Benchmark, PHP VS Python Problem: Fine All Prime Number Below 10000 PHP 1.39 Python 1.84 Source: [6]
  • 10. Another Benchmark, PHP VS Python Problem2: 2000000 Time Calculating MD5(N+N) > So, PHP5 Is Not Good For Computation PHP5 21.43 Python 9.87 Source: [6]
  • 11. Languages that Companies Used Fro ML Source: [11
  • 13. But Wait, Something Change these days Source: [8]
  • 15. A Little About Optimization > You Want to Optimize IO? 1. High Level Optimization ⇒ Disk IO 2. Low Level Optimization ⇒ RAM IO
  • 16. We Focus On Low Level Optimization > You Want to Optimize IO? 1. High Level Optimization ⇒ Disk IO 2. Low Level Optimization ⇒ RAM IO
  • 17. Cache Vs RAM Access Time Source: [9]
  • 18. We must Optimize these 3: 1. Memory Allocation 2. Memory Usage 3. Memory Indirection
  • 19. Something Improved IN PHP7 > Ints, Floats > Objects > Strings > Arrays → HashTables
  • 20. Something Improved IN PHP7 > Ints, Floats > Objects > Strings > Arrays → HashTables
  • 21. PHP 5(Core Variables) Behind All PHP Variables There is a ZVAL C struct: typedef union _zvalue_value { long lval; double dval; struct { char *val; int len; } str; HashTable *ht; zend_object_value obj; } zvalue_value; Source: [10]
  • 22. PHP 7(Core Variables) Behind All PHP Variables There is a ZVAL C struct: typedef union _zend_value { zend_long lval; double dval; zend_refcounted *counted; zend_string *str; zend_array *arr; zend_object *obj; zend_resource *res; zend_reference *ref; zend_ast_ref *ast; zval *zv; void *ptr; zend_class_entry *ce; zend_function *func; struct { uint32_t w1; uint32_t w2; } ww; } zend_value; Source: [10]
  • 23. What is The Difference In Arrays(5 vs 7)? PHP5 PHP7 Allocations: 2 + 2 per element 2 + 0 per element Size: 72 + 112 per element 56 + 36 per element
  • 24. Now, What tools to use? https://github.com/gburtini/Learning-Library-for-PHP Fork: 74 Star: 246 DBScan, Kmeans, KNN, Markov Chain, Naive Bayes and ...
  • 25. A Better Tool https://github.com/php-ai/php-ml > Only For PHP 7 Fork: 493 Star: 3988 SVC, KNN, KMean, Naive Bayes, SVR, Least Square and ... Cross Validation, Normalization, TF-IDf, Metrics and …
  • 26. Hybrid Approaches Use PHP with these services: > Amazon Machine Learning > Python Core with Tensorflow, Scikit and … > Google Cloud Prediction API > IBM Watson
  • 28. Images and Contents Sources [1] http://blog.kaggle.com/2015/04/22/scikit-learn-video-3-machine-learning-first-steps-with-the-iris-dataset/ [2] http://sebastianraschka.com/Articles/2015_pca_in_3_steps.html [3] http://www.designbolts.com/ [4] https://openclipart.org/detail/213226/broken-heart-icon [5] http://beirutpress.net/article/311667 [6] http://www.hurricanesoftwares.com/php-vs-python-analysis/ [7] http://www.bartarinha.ir/fa/news/332320/%D8%A7%D9%87%D9%85%DB%8C%D8%AA-%D8%A7%D8%B5%D8%BA%D8%B1-%D9%81%D8%B1%D9%87%D8%A7%D8%AF%DB%8C-%D8%A8%D9%88%D8%AF%D9%86 [8] https://owncloud.org/blog/php-7-is-here-and-owncloud-is-ready/ [9] https://www.slideshare.net/chris1adkin/sql-server-engine-cpu-cache-as-the-new-ram [10] http://www.phpinternalsbook.com/ [11] https://www.ibm.com/developerworks/community/blogs/jfp/entry/What_Language_Is_Best_For_Machine_Learning_And_Data_Science?lang=en
  • 29. Where Am I: Website: MasoudKaviani.ir Telegram: masoud_kaviani Instagram: masoudkaviani Twitter: masoud_kaviani