Docsity

Data Science: Data Acquisition, Cleaning, and Exploration - University of Sydney, Lecture notes of Data Acquisition

Partial preview of the text

Download Data Science: Data Acquisition, Cleaning, and Exploration - University of Sydney and more Lecture notes Data Acquisition in PDF only on Docsity!

COMP5310: Principles of

Data Science

W2: Data Acquisition and

Exploration

Presented by Dr Ali Anaissi School of IT

  • Overview of Week

Today: Data Cleaning and Exploration (via spreadsheet)

Objective Use interactive tools to explore a new data set quickly. Lecture

  • Data types, cleaning, preprocessing
  • Descriptive statistics, e.g., mean, stdev, median
  • Descriptive visualisation, e.g., scatterplots, histograms Readings - Data Science from Scratch: Ch 2 - 3 Exercises - Google Sheets: Visualisation - Google Sheets: Descriptive stats TODO in W - Grok Python modules 4 - 6 - Grok SQL modules 16 and 17 - Explore project data

Exploratory Analysis Workflow

Nominal Data

– Values are names

– No ordering is implied

– Eg jersey numbers

(^1) The mode is the number that is repeated more often than any other

Ordinal Data – Values are ordered

– No distance is implied

– Eg rank, agreement

– central tendency can be

measured by mode

1

or median

– the mean cannot be defined

from an ordinal set

– dispersion can be estimated by

the Inter-Quartile Range (IQR)

“Thermometer” by Christer Edvartsen is licenced under CC BY 2.

Interval Data

– Interval scales provide information

about order, and also possess equal

intervals

– Values encode differences

– equal intervals between values

– No true zero

– Addition is defined

– Eg Celsius temperature

– central tendency can be measured by

mode, median, or mean

Ratio Data

– Values encode differences

– Zero is defined

– Multiplication defined

– Ratio is meaningful

– Eg length, weight, income

What about text data?

– Not defined as traditional

data type in statistics

– Requires interpretation,

coding or conversion

– More in future lectures…

Data Acquisition and Cleaning

Data Acquisition – Where does data come from?

– File Access

  • You or your organisation might already have a data set, or a colleagues

provides you access to data.

  • Or: Web Download from an online data server
  • Typical exchange formats: CSV, Excel, sometimes also XML

– Programmatically

  • Scrapping the web (HTML)
  • or using APIs of Web Services (XML/JSON)
    • Cf. textbook, Ch 9

– Database Access - > Week 4 onwards

– Collect data yourself, eg. via a survey

This week: Using data from our online survey from Week 1

Acquire data

– Create new Google spreadsheet

  • Go to https://docs.google.com/spreadsheets
  • File > New > Spreadsheet
  • Rename “COMP5310 Survey analysis (NAME, UNIKEY) ”

– Download response data: https://goo.gl/mzby7z

(link on Canvas)

– Load survey data

  • File > Import
  • Click on Upload
  • Select and load: Survey COMP5310 2019s1 (Responses) - Form Responses 1.csv

Exercise: Reformat and clean data

– Groups of 6

– Review and discuss:

  • Any problems with columns in spreadsheet?
  • How should we fix those problems?

– Clean:

  • Change any text to numeric values in “Number of years…” columns

What Questions Can We Answer?