karafede / scikit-mobility

scikit-mobility: mobility analysis in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/

Citing

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

@ARTICLE{pappalardo2019scikit,
       author = {{Pappalardo}, Luca and {Barlacchi}, Gianni and {Simini}, Filippo and
         {Pellungrini}, Roberto},
        title = "{scikit-mobility: An open-source Python library for human mobility analysis and simulation}",
      journal = {arXiv e-prints},
     keywords = {Physics - Physics and Society},
         year = "2019",
        month = "Jul",
          eid = {arXiv:1907.07062},
        pages = {arXiv:1907.07062},
archivePrefix = {arXiv},
       eprint = {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
>>>

About

scikit-mobility: mobility analysis in Python

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Jupyter Notebook 97.7%Language:Python 2.3%