Git Product home page Git Product logo

inferhotspot's Introduction

inferhotspot

Infer information about local hotspots.

Plot examples

The examples below were created using a collection of 196,318 tweets within Denton County from Tue Feb 12 to Wed Apr 10. The data was collected using bwbaugh/twitter-corpus.

Map

map

User map

user map

user check-ins

Heat map

heat map

Time

time

Usage

Configuration file

The first time you run any script it will create a configuration file named inferhotspot.ini, and you will be asked to edit it.

Filtering the tweets

Because of the way Twitter matches location bounding boxes, we must first filter the tweets as part of a preprocessing step in order to make sure every tweet has a geocoded-point and is within our defined bounding box.

Run using the command: python -m inferhotspot.filter

Configuration file settings:

  • Section: [filter]
    • process_directory: The directory containing bz2-archive files. Each line of the uncompressed file must be a JSON encoded tweet.
    • output: The filename of the uncompressed file to save the combined tweets. This file will be saved to the current working directory.
  • Section: [place]
    • box: JSON encoded flat-list containing a pair of longitude and latitude pairs, with the southwest corner of the bounding box coming first.

Making the plots

Run using the command: python -m inferhotspot.plot

If the data hasn't been preprocessed to include only those tweets that are geocded with using a coordinates-point---and that point falls within the bounding box---then you will first need to use the filter.py script to preprocess your data.

  • Section: [place]
    • box: JSON encoded flat-list containing a pair of longitude and latitude pairs, with the southwest corner of the bounding box coming first.
    • name: The place name of the bounding box.
  • Section: [plot]
    • path: The directory containing bz2-archive file of filtered tweets.
    • archive: The filename of the bz2-archive of filtered tweets. Each line of the uncompressed file must be a JSON encoded tweet.

Installation

You do not need to install the package in order to use it, however if you choose to install then use one of the options below. Otherwise your current working directory must be the parent of the inferhotspot package.

Using distribute

Standard install

python setup.py install

Development install

To install in development mode, which creates a symlink to the current directory so that the source can be modified or updated in-place, use:

python setup.py develop

And to remove the symlink:

python setup.py develop -u

Using pip

pip install .

To uninstall:

pip uninstall inferhotspot

inferhotspot's People

Contributors

bwbaugh avatar

Stargazers

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