Kivike / nlp-project

Project for University of Oulu course Natural Language Processing
0 stars 0 forks source link

Implemented a simple demo with plotly #1

Closed ppeerttu closed 4 years ago

ppeerttu commented 4 years ago

Details

Implemented a simple demo with Plotly and the crime data.

EDIT: Moved the logic in to a class and removed the demo file as we're probably not needing demos in the repository (demos can be done ad-hoc anyways).

Steps to try it out

  1. Install dependencies from requirements.txt
  2. Extract the crime data into ~../data~ datasets directory (~outside of~ inside the repository)
    • Or just change the directory path directly from the file
  3. Place the following code in the root directory e.g. demo.py:

    from app.file.utils import read_csv_directory
    from app.map.heat_map import HeatMap
    
    COLUMNS = [HeatMap.LAT, HeatMap.LON]
    DATA_DIRECTORY = './datasets/data.police.uk/2016-11'
    
    crimes = read_csv_directory(
        DATA_DIRECTORY,
        COLUMNS,
        30 # Limit of files to read
    )
    heat_map = HeatMap(crimes)
    heat_map.show()

newplot

Limitations

ppeerttu commented 4 years ago

Btw, in case we want (or need) to implement unit tests, we can use the new Github Actions service for automated testing.

Kivike commented 4 years ago

Btw, in case we want (or need) to implement unit tests, we can use the new Github Actions service for automated testing.

I don't think we really need them at all. I just wanted to check how they are done for python for learning purposes. But good to know in any case!