Tools for user trajectories analysis in the app (python package)
Fistly you need to download c++ compiler
Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then you should install gcc
brew install gcc
You also need python if you haven't it
brew install python3
And git
brew install git
Install Microsoft Visual Studio Build tools. You can find it at Инструменты для Visual Studio 2017 > Build Tools для Visual Studio 2017
.
If you need python then install it from here. Please, be sure that you select Add python to path
in the bottom of installer.
And git from here.
- To install Python package from github, you need to clone our repository:
git clone https://github.com/appintheair/retentioneering-framework.git
- Then, install dependencies from the requirements.txt file from that directory:
pip install -r requirements.txt --user
or if previous command don't work
pip3 install -r requirements.txt --user
- Then just run the setup.py file from that directory
python setup.py install --user
or if previous command don't work
python3 setup.py install --user
- Put path to your google cloud credentials and your project name in settings yaml (example).
---
settings:
service_account_path: "../credentials.yaml"
project: project
- Now you are ready to do examples.
There are 3 examples in this project you can play with. All of them are in "Examples" directory.
- First of them is "delete account prediction" in directory delete_account_prediction. With this example one can compare users who have deleted their account with those who don't, plot graphs with their transitions between events and use our ML alghoritm to predict their behaviour at the first steps. To start you should correct settings.yaml to fit the project to your app: you should select event which is responsible for account deletion, times in user's history you are interesting, destination table for your data in BigQuery and parameters for filtering raw data.
- Second is "new_users lost prediction" in directory new_users_lost_prediction. With this example one can compare users behavior who started using your app with those who stopped doing it after severeal steps. You mast correct settings.yaml to fit the project to your app: you should select filters with parameters from BigQuery to choose suitable users and also filter their events, data you are interesting to investigate, destination_table and parameters for filtering raw data at the preprocessing steps.
- Third one is "new users lost prunned visualization" in directory new_users_lost_prunned_visualization. This example provides simple code for graph visualization. Graph presents users avereged path for the cases described for second example. You should correct settings.yaml in same way as for the second case. For all graphs we offer our own graph plotter api that can provide nice-looking graphs for better visualisation your results. Of course you can use default visualization python tools to plot your results.
You can use retentioneering.analysis toolset with your data.
Data should have at least three columns event_name
, user_pseudo_id
, event_timestamp
.
You can put empty dict as settings
for analysis. It is needed here only to set experiment folder. By default it will be experiments
folder in you current directory. For each new experiment (kernel restart) new folder with experiment results named with current datetime will be created.
import pandas as pd
from retentioneering import analysis
# your data import
df = pd.read_csv('path to your data')
settings = dict()
analysis.get_desc_table(df, settings=settings)