How to use

Instructions for using the application.

Next

How to use

Hello! We are very happy you have decided to use our application, here we are going to show you how.

First of all, you need:
  • AWS(Amazon Web Services) account to launch an instance.
  • Linux OS or Mac OS to connect the remote instance (in case you are using Windows, you can download a VM).
  • Step 1. Launch an instance m4.xlarge.

    Assure you have selected “Ubuntu Server” as AMI and then choose m4.xlarge as instance type.

    Finally, connect the instance to the MV through SSH command:

    # ssh -i "keyPairFile.pem" ubuntu@PublicIP
    $ ssh -i "keypair.pem" ubuntu@31.145.32.255

    Step 2. Download dataset and upload to your new VM.

    Download the followings datasets through the urls included on this web:
  • sexo_edad_provincia_anyo.csv
  • casos_diagnostico_provincia.csv

  • You also need the Application folder located on our Github Repository.
  • Application

  • Enter the downloaded datasets by overwriting the old ones you can find in the Application folder

  • Now it is time to upload these files to your bucket (previously created with Amazon S3) using the following command:

    $ aws s3 cp Application s3://mybucket/Application --recursive

    Step 3. Spark installation.

  • 3.1 Install Java:
  • $ sudo apt-add-repository ppa:webupd8team/java
    $ sudo apt-get update
    $ sudo apt install openjdk-8-jdk
  • 3.2 Install Scala:
  • $ sudo apt install scala
  • 3.3 Install Python:
  • $ sudo apt install python
  • 3.4 Install Spark:
  • $ sudo curl -O
    http://d3kbcqa49mib13.cloudfront.net/spark-2.2.0-bin-hadoop2.7.tgz
    $ sudo tar xvf ./spark-2.2.0-bin-hadoop2.7.tgz
    $ sudo mkdir /usr/local/spark
    $ sudo cp -r spark-2.2.0-bin-hadoop2.7/* /usr/local/spark
  • 3.5 Install Pandas:
  • $ pip3 install pandas
  • 3.6 Install Matplotlib:
  • $ pip3 install matplotlib
  • 3.7 Install Numpy:
  • $ pip3 install numpy
  • 3.8 Configure the enviroment:
    a) Add /usr/local/spark/bin to PATH in .profile. To do so, add the following line to the end of the ~/.profile file with a text editor, for example with vi ~/.profile.
    export PATH="$PATH:/usr/local/spark/bin"
    b) Execute source ~/.profile to update PATH in your current session

  • c) Include the internal hostname and IP to /etc/hosts with a text editor, for example with
    $ sudo vi /etc/host

    Step 4. Execute run.sh

    We’ve almost got to the interesting part, but first run the following commands:

    $ cd into /Application/src/
    $ sh run.sh

    Step 5. Run the application.

    Now it is time to try the commands to get the results:

  • Number of cases per community compared with population density:
  • $ python3 results.py 0
  • Number of cases per popoluation compared with population density:
  • $ python3 results.py 1
  • Cases by age range:
  • $ python3 results.py 2
  • Cases by community (men vs women):
  • $ python3 results.py 3

    Step 6. Investigate your results.

    A window should appear on your screen displaying a chart like the following one: