GithubHelp home page GithubHelp logo

rzarno / ml-in-php-start-templates Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 113.3 MB

This project is supposed to be a starting template for replacing business logic in PHP projects with machine learning models. I add here common use cases of how to use machine learning models in PHP projects. In order to use it in your projects you need to replace the data with your dataset and adjust data import and feature engineering stages.

License: GNU General Public License v3.0

Dockerfile 1.38% Python 2.15% PHP 19.12% Jupyter Notebook 77.35%

ml-in-php-start-templates's Introduction

ml-in-php-start-templates

This project is supposed to be a starting template for replacing business logic in PHP projects with machine learning models. I add here common use cases of how to use machine learning models in PHP projects. In order to use it in your projects you need to replace the data with your dataset and adjust data import and feature engineering stages.

Examples cover 4 use cases:

1. Regression model train and use as micorservice

Predict car sale prices based on archive results.

Python + Scikit-Learn + Flask + Gunicorn + Nginx

setup containers:

cd python-docker-regression && docker-compose -f docker-compose.yml up -d --build

request API GET:

http://127.0.0.1:1338/?data=[[22.0, 7.2500, 0, 1, 0, 3, 2.0]]

2. Classification model train and use as micorservice

Classify user agent into indexing bots and others.

Python + Scikit-Learn + Flask + Gunicorn + Nginx

setup containers:

cd python-docker-classify && docker-compose -f docker-compose.yml up -d --build

request API GET:

http://127.0.0.1:1337/?data=Googlebot-Image/1.0

3. Prognose sales from time series

Prognose sales for future dates based on sales from the past.

PHP + Rindow Neural Networks

To train and test model run:

bin/cli prognose-sales-nn-pipeline

or using docker:

docker run --rm rzarno/ml-in-php-start-templates prognose-sales-nn-pipeline

4. Recognize captcha images

Recognize characters on captcha images using convolutional neural networks

PHP + Rindow Neural Networks + Nvidia DAVE-2 CNN model architecture

To train and test model run:

bin/cli captcha-image-classification-cnn-pipeline

or using docker:

docker run --rm rzarno/ml-in-php-start-templates captcha-image-classification-cnn-pipeline

Machine learning process

Machine learning process is a universal sequence of action that you need to perform on your data in order to build prediction model. Each stage of chain can be represented as a separate class, for example: load data, split to train and test set, ... For implementation chain of responsibility pattern was used. Find below diagram showing whole process:

ml-in-php-start-templates's People

Contributors

rzarno avatar

Stargazers

 avatar Wojciech Zięciak avatar Jan Rembikowski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.