Data Sciences Using R Notes
Subject Overview
The second Business Analytics group elective, covering the components and business applications of data science with R software basics, probability theory and regression/
Subject at a glance
4
Units
25
Topics
4
Credits
4
Infographics
Unit-wise Syllabus
4 units — open any unit for detailed topic-wise notes, diagrams and important exam questions
- Components and roles in data science
- big data/data pre-processing/supervised and unsupervised learning concepts
- business applications of data science
- introduction to R software installation and basic elements
- R data interfaces
- charts
- graphs and statistics
- mean/median/SD/variance/correlation/covariance through R
- Vector
- c(1, 2, 3)
- Data frame
- data.frame(x, y) or read.csv("file.csv")
- Summary
- summary(df), mean(), sd(), cor()
- Plot
- plot(), hist(), boxplot()
- Packages
- install.packages("ggplot2"); library(ggplot2)
Study guide
This unit covers data science components and roles, big data, preprocessing, learning types, business applications and R installation, interfaces, charts and statistics. Install R and RStudio and plot a data set.
- Probability theory for data science (Bayes theorem)
- linear/multiple/logistic regression
- decision tree and Support Vector Machine (SVM)
- Linear regression
- lm(y ~ x1 + x2, data = df)
- Logistic regression
- glm(y ~ x, family = binomial)
- Decision tree
- rpart(y ~ ., data = df)
- SVM
- svm(y ~ ., data = df) from e1071
- Predict
- predict(model, newdata)
Study guide
You study probability and Bayes, linear, multiple and logistic regression, decision trees and SVM. Fit a regression in R and interpret it.
- Bagging
- random forests
- boosting
- K-means clustering
- K-medoids
- agglomerative and hierarchical clustering
- X-means
- DBSCAN
Random forest
Many trees on bootstrap samples
randomForest()
Boosting
Trees in sequence fixing errors
gbm, xgboost
K-means
Assign to nearest centre
kmeans()
Hierarchical
Merge clusters into a dendrogram
hclust()
DBSCAN
Density-based clusters
dbscan package
Study guide
You study bagging, random forests, boosting and clustering with K-means, K-medoids, hierarchical, X-means and DBSCAN. Compare methods on the same data.
- Methods for estimating classifier performance — cross-validation
- holdout method
- bootstrap method
- confusion matrix
- assessing statistical significance of data mining results
- advanced topics (scalable ML, big data techniques, stream data mining, social networks)
Holdout
Single train/test split, e.g. 70:30
Fast; result depends on the split
k-fold cross-validation
Train on k − 1 folds, test on 1, repeat
Reliable; standard choice
Bootstrap
Resample with replacement
Good for small data
Confusion matrix
TP, FP, TN, FN counts
Basis for accuracy, precision, recall
Study guide
You study classifier evaluation with cross-validation, holdout, bootstrap, confusion matrix, statistical significance and advanced topics. Report accuracy, precision and recall.
Why Data Sciences Using R Matters
R is widely used for statistics and analytics, and data science skills are among the best-rewarded in the job market.
How to Prepare for Data Sciences Using R
- Practise on open data sets such as those on Kaggle.
- Learn tidyverse and ggplot2.
- Document analyses in R Markdown.
Data Sciences Using R: Frequently Asked Questions
What is R used for?
R is a programming language for statistical computing, data analysis and visualisation.
