/scikit-mobility

scikit-mobility: mobility analysis in Python

Primary LanguageJupyter NotebookOtherNOASSERTION

DOI

scikit-mobility - mobility analysis in Python

scikit-mobility is a library for human mobility analysis in Python. The library allows to:

  • represent trajectories and mobility flows with proper data structures, TrajDataFrame and FlowDataFrame.

  • manage and manipulate mobility data of various formats (call detail records, GPS data, data from Location Based Social Networks, survey data, etc.);

  • extract human mobility metrics and patterns from data, both at individual and collective level (e.g., length of displacements, characteristic distance, origin-destination matrix, etc.)

  • generate synthetic individual trajectories using standard mathematical models (random walk models, exploration and preferential return model, etc.)

  • generate synthetic mobility flows using standard migration models (gravity model, radiation model, etc.)

  • assess the privacy risk associated with a mobility dataset

Documentation

https://scikit-mobility.github.io/scikit-mobility/html/index.html

Paper

if you use scikit-mobility please cite the following paper: https://arxiv.org/abs/1907.07062

Install

First, clone the repository - this creates a new directory ./scikit_mobility.

    git clone https://github.com/scikit-mobility/scikit-mobility scikit_mobility

with conda - miniconda

  1. Create an environment skmob and install pip

     conda create -n skmob pip
    
  2. Activate

     conda activate skmob
    
  3. Install skmob

     cd scikit_mobility
     python setup.py install
    

    If the installation of a required library fails, reinstall it with conda install.

  4. OPTIONAL to use scikit-mobility on the jupyter notebook

    • Install the kernel

      conda install ipykernel
      
    • Open a notebook and check if the kernel skmob is on the kernel list. If not, run the following:

      env=$(basename `echo $CONDA_PREFIX`)
      python -m ipykernel install --user --name "$env" --display-name "Python [conda env:"$env"]"
      

without conda (python >= 3.6 required)

  1. Create an environment skmob

     python3 -m venv skmob
    
  2. Activate

     source skmob/bin/activate
    
  3. Install skmob

     cd scikit_mobility
     python setup.py install
    
  4. OPTIONAL to use scikit-mobility on the jupyter notebook

    • Activate the virutalenv:

        source skmob/bin/activate
      
    • Install jupyter notebook:

        pip install jupyter 
      
    • Run jupyter notebook

        jupyter notebook
      
    • (Optional) install the kernel with a specific name

        ipython kernel install --user --name=skmob
      

Test the installation

> source activate skmob
(skmob)> python
>>> import skmob
>>>