关键词 > COMP3430/COMP8430

COMP3430/COMP8430 – Data Wrangling – 2022

发布时间:2022-10-31

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMP3430/COMP8430 – Data Wrangling – 2022

Setup necessary software to use in practical labs

Overview

This course will have seven (7) practical labs (both online and in-person) which enable you to get familiarise with different tools that can be used for data wrangling, where we will use the Python programming language to develop a complete record linkage program. All required programs are installed on the computers in the ANU CSIT lab rooms . However, when the labs are conducted online, you need to install the necessary software on the machine you will be using for your lab work before starting the labs.  This document provides some general advice for installing the necessary software which we will be using in the labs.

Note: The lecturers and tutors cannot provide individual technical support for problems with your own computer.

IMPORTANT: If you have never logged into a CSIT lab machine, you need to first log into ANU StReaMS system to get your university ID registered. Go to the https://cs.anu.edu.au/streams/login.php and log in using your ANU university ID number and password. Once logged in your university ID number will get registered.

Software we use in labs

R/Rattle: In this course we will be using the open source data wrangling and mining tool Rattle.   Rattle is a freely available software tool that provides a graphical user interface on top of the R statistical programming language.  Rattle provides access to many of the data wrangling, data mining and statistical functionalities in R.

Python: In this course we use the Python programming language to develop a complete record linkage program and also as a data wrangling tool. We will be using the Python programming language version 3. Apart from the standard libraries we will also be using following Python libraries in the labs.

Pandas is an open source library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.  Pandas enables you to carry out your entire data analysis workflow in Python without having to switch to a more domain specific language like R. We use Pandas as a data wrangling tool.

Numpy defines the fundamental data structures (so called ndarrays, N-dimensional arrays), fast mathematical op- erations on these arrays, and other routines which are used in numerical computations  (linear algebra and matrix operations, Fourier transform, random number generators etc). We use the numpy library to implement functionalities in our record linkage program.

Scikit-learn (also known as sklearn) is an open source machine learning library for the Python programming language. The sklearn library contains many efficient functions for machine learning and statistical modelling including classifi- cation, regression, clustering and dimensionality reduction. We use the sklearn library to implement functionalities in our record linkage program.

Matplotlib is a 2D (and some 3D) plotting (and some animation) library; it has a package pyplot which simplifies its usage. We use matplotlib for plotting different graphs in our labs.

Bitarray is an array data structure that compactly stores bits.  We use bitarray to implement functionalities in a privacy-preserving record linkage program.

Anaconda: is a free and open-source distribution of the Python and R programming languages for scientific computing, such as data science. The main advantage of using the Anaconda distribution is that it comes with not only the Python standard library, but also a number of extra Python modules that we will be using in the labs.  Hence, it reduces the requirement of installing individual Python packages by  yourself.  Throughout the labs we will be using the Anaconda distribution to implement Python programs. Therefore, we highly recommend using the Anaconda Python distribution.

Using the SOCO virtual desktop infrastructure (VDI) (Recommended)

The School of Computing (SOCO) offers a virtualisation option to run its standard Linux lab environment on your own computer.  This allows you to run a standard Ubuntu Linux desktop on an ANU server with the desktop visible on your computer as if it were running locally on your computer. To use the SOCO VDI you must carefully follow these steps (also available at https://cs.anu.edu.au/courses/comp1730/labs/remote-login/ ).

Before you can connect to the VDI, you first need to connect to the ANU internal network. To connect to the ANU network you must connect via the GlobalProtect VPN. If you have not already installed GlobalProtect, you should follow the instructions  (available at https://services.anu.edu.au/information-technology/login-access/remote-access) provided by the university.

Once you connected to GlobalProtect, you can access the VDI either directly via a browser (using the URL https://linuxvdi.anu.edu.au/) or by installing the VDI client software, VMWare Horizon. However, since you can run into connectivity issues if your Internet connection is slower, we recommend you to install the VDI client in your own machine rather than accessing the environment directly via a browser. Follow the instructions provided by the university (available at https://services.anu.edu.au/information-technology/software-systems/anu-virtual-information-commons) to install the VDI client software appropriate for your operating system.

IMPORTANT: Note that the university instructions will set you up to use the standard ANU Microsoft Windows client (which we do not use in our course).  Therefore, once you have the VMWare Horizon client installed and working, then you need to add the SOCO VDI as a server.  The way to do this varies depending on your operating system (see the ITS instructions available at https://cs.anu.edu.au/docs/student-computing-environment/linuxlabs/VDI/).  The server address you need to add is linuxvdi.anu.edu.au.

Now you should be able to create a connection and you will see a login screen just like in the CSIT physical labs.                Use your ANU ID and password to login and you will see the standard Ubuntu image. If you just see a blank screen that may be due to you using a second monitor.

Finally, make sure your VMWare Horizon client is running in full screen mode, you will probably want to move it into a single window. This step may be important in order to screen share with your tutor, which will be important in the labs.   To move out of full screen mode move your mouse to the top edge of the VDI screen.  The VMWare Horizon menu should appear. Once it does, you can choose the Window menu and uncheck the Full Screen” option. If you are still seeing blank screens, move to another application in your machine and then move your mouse pointer back to VDI.

If you have troubles or get any errors when installing this virtual machine image, which is unlikely, you should contact and seek help from the CECS IT technical support staff.

Using the SOCO student virtual machine (Recommended)

If you find it difficult to connect to the  SOCO VDI, alternatively you can run an image of the lab machines through virtual box.  See https://cs.anu.edu.au/docs/student-computing-environment/linuxlabs/softwareaccess/virtualmachine/ for more details.

You will first need to install Virtual Box (see instructions available at https://www.virtualbox.org/manual/), which is a free general-purpose full virtualiser for x86 hardware, targeted at server, desktop, and embedded use.  Once you install Virtual Box, download the vm Ubuntu 20.04 cecs-student.ova (2.2G) file (available at https://cs.anu.edu.au/courses/ images/cecs- student-20.04.ova) and then using Virtual Box click File  >  Import  Appliance to create the virtual machine on your own hardware.

The Virtual Box Ubuntu 20.04 image is a pre-configured lab image that mimics lab environment for students’ convenience.  Once the lab VM image is imported, click Start to launch the VM instance.  The machine will auto login as user student, which has sudo access to install additional software. The password if you need sudo access is also student” .

To install the course package into the Virtual Box, open a Terminal and type the following.

sudo  apt-get  update

sudo  apt-get  install  comp3430

This will install the complete development environment as used in the computer labs for the data wrangling course.            If you have troubles or get any errors when installing this virtual machine image you should contact and seek help from the CECS IT technical support staff.

Manual installation of software in your machine (Not recommended, but encouraged)

Next, we provide details on how you can install the software required for the data wrangling course on your machine.

Important: Note we only provide a general description on installing these software packages. Some steps for installing these software can change depending on the characteristics of your machine, such as its operating system.

Installing R and Rattle

You should have a look at the Rattle documentation at http://datamining.togaware.com/survivor/Rattle Data.html.  Note that both Rattle and its documentation are under development, and currently not all functionality and chapters are complete. Any feedback on errors, typos, and other issues is much appreciated (you can tell us and we will contact the Rattle developer Graham Williams).

To install Rattle, first you need to install R. Follow the instruction given at https://cloud.r-project.org/.

Once you successfully install R you can start the installation of Rattle.  First start a Terminal (Konsole) in your machine. For Ubuntu users, this can be done by clicking on the Main Menu (round orange-red icon on the left top menu panel), select Accessories, then Terminal. If you are using the alternative interface to Ubuntu, it can be found by clicking on Applications, then System Tools, then Terminal.

A new window will pop-up with a cursor that allows text input. Type the upper-case letter R followed by Enter’ . This will start the R statistical language. The prompt (character at the beginning of the line where the cursor is) should have changed to ‘>’ . Now type the following into the terminal window:

install.packages("rattle",  repos="https://cran.r-project.org/ ")

This will install the latest development version that is available directly from Togaware. For more details on how to install Rattle, see the instructions available at https://togaware.com/datamining/survivor/Installing Rattle.html.

As you use Rattle you will find it will need other packages installed in response to commands you execute. Rattle will prompt you for this, but you will need to be network-connected for the installs to work.

Once the installation is finished start up Rattle by first starting the R interpreter,  then,  at the R prompt  (‘>’),  type library(rattle), then rattle() followed by Enter’ to see the Rattle GUI.

Installing Python

You can install the core Python implementation, available from https://www.python.org/downloads/.

Once you successfully installed Python, you can use the standard package management system pip, which by default comes with Python 3.4 and later, to install the required Python library packages. Type the following into the terminal window to install each package.

pip  install  package name

For example, to install the Python library pandas type the following:

pip  install  pandas

Installing Anaconda

As we mentioned above, we recommend you to install the Anaconda distribution on your machine to enable work with Python.  The Anaconda distributions for download are available at https://www.anaconda.com/products/individual.  Once you download the correct Anaconda distribution that is applicable to your machine see the instructions available at: https://docs.anaconda.com/anaconda/install/ to install Anaconda distribution in your machine.

Once the Anaconda distribution is installed, start a Terminal (Konsole) as described above under installing R. A new window will pop-up with a cursor that allows text input. Type anaconda followed by Enter’ to start the Anaconda distribution. The prompt (character at the beginning of the line where the cursor is) should have changed to yourusername@anaconda:/$’ . Now type the following into the terminal window to start Python:

python

followed by ‘Enter’ . The prompt (character at the beginning of the line where the cursor is) should have changed to ‘>>>’ . By default, the complete installation of the Anaconda distribution should provide all the packages you need.   However, if you find any of the required Python packages are not available within your machine, you can use the standard package management system pip to install the required Python library package. To install a Python package simply type the following within an Anaconda terminal.

pip  install  package name