Git Product home page Git Product logo

citybike_example's Introduction

Please find the cluster analysis of CityBikes, ran by Andrea Agostinelli ([email protected])

In order to produce the html files stored in the results folder, please make sure to 
use the same Python3 environment as summarised in cityBike_clustering/python/requirements.txt

Once the same environment and package config is guaranteed, please move to:

$ cd cityBike_clustering/python/scripts

and run from the command line, the following line:

$ python runBikeClustering.py arg1

where arg1 is an integer parameter representing the minimum number of desired components in the HDBscan clustering.
The script will output an html file in  
 
$ cd cityBike_clustering/results 

Its output file name contains an integer label referring to the free parameter used when running the script. 


---- Notes on the analysis ----- 

1) In the notebook folder, there is a test notebook in which I implemented the analysis flow 

3) Instead of using a standard kmeans with  the euclidean distance I applied an HDBscan with the Harvesine metrics. The Haversine metric as implemented supports coordinates in radians. That means I needed to convert latitude and longitude data into radians before passing it in to HDBSCAN. Conceptually, it would be wrong to apply an euclidean metrics to data on a sphere (Long, Lat). Of course, for the purpose of this exercises and when comparing the size of a city with respect to the earth surface, there is no significance difference in the evaluation of these distances. Nevertheless, in this way we obtained a more general approach for bigger distances. 

4) In order to run the HDBscan, training & test sets are required, as I recalled with the Warning message. Due to the purpose of this exercise, with clear results, I decided to overfit the observation by running hdbscan.fit_predict() on the same data 

5) A different minimum number of cluster components causes a different clustering. At this level I did not implemented the performance metrics (silhouette score, compactness) since the results are pretty stable by eyes. 

citybike_example's People

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.