Giter Club home page Giter Club logo

behaviour_analysis's Introduction

Purchase predictor

Description

Script for prediction purchases based on Machine Learning algorithms.

Program uses:

  • Pandas;
  • Numpy;
  • Scikit-Learn.

Program separated on two parts: preprocessing and prediction. Preprocessing includes next steps:

  1. Removing duplicates from dataset.
  2. Features selection
  3. NaN Values processing: a. all missing number values replaced by 0; b. all missing text values replaced by word ‘miss’;
  4. Processing date: a. Column ‘created_at’ replaced by days between today’s date and date in dataset; b. Column ‘ccreate’ replaced by ‘1’ or ‘0’ values (‘1’ - if cell in table not empty and ‘0’ - if cell is empty).
  5. Convert categorical variable into dummy/indicator variables.

Using ML algorithms:

  • Decision Tree;
  • Random Forest;
  • Gradient Boosting;
  • Ensemble of those classifiers. All of them are binary classifiers, which at the end of script saving result to file ‘result.txt’.

Installation

Installing:

git clone https://github.com/exotikh3/behaviour_analysis.git

Then (python 2.7 required):

pip install -r requirements.txt

After this, please, sure than you have necessary datasets (‘outsource_test1.csv’ and ‘outsource_training.csv’) and then run the script. Take a coffee break). Each time model rebuilds and result writes down to ‘result.txt’.

Accuracy:

Accuracy is on level between 72% (Decision tree) up to 80% (Ensemble and Gradient Boosting).

behaviour_analysis's People

Contributors

exotikh3 avatar

Watchers

 avatar  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.