Publications by H. K. Tseng

Statistical Learning - Week 2

21.02.2022

Installing R and RStudio R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. RStudio is an integrated development environment for R, a programming language for statistical computing and graphics. You need to download base R in order to run RStudi...

2475 sym R (16078 sym/144 pcs) 12 img

Statistical Learning: Week-4

08.03.2022

Non-normality test ## load Prestige data from the "car" package library(car) ## Loading required package: carData lm.fit <- lm(prestige ~ education, data = Prestige) plot(lm.fit) ## Shapiro test of normality shapiro.test(Prestige$prestige) ## ## Shapiro-Wilk normality test ## ## data: Prestige$prestige ## W = 0.97198, p-value = 0.0287...

1087 sym R (31308 sym/100 pcs) 15 img

Statistical Learning: Week-6

22.03.2022

set.seed(123) n = 10 xr = seq(0, n, by=.1) # generate a random data from a sin function plus some random errors yr = sin(xr/2) + rnorm(length(xr))/2 # combine x and y into a df for easy manipulation df = data.frame(x = xr, y = yr) # plot the data plot(df) lm.fit = lm(y ~ x, data = df) abline(lm.fit, col = "red") # If the degree of the...

641 sym R (24990 sym/90 pcs) 20 img

Statistical Learning: Week-14

14.05.2022

U.S. Armament Cooperation Network at a glance: 1992-2017 Structural Topic Models (STM) A gentle introduction using international armament cooperation (IAC) data # load required packages and data library(stm) ## stm v1.3.6 successfully loaded. See ?stm for help. ## Papers, resources, and other materials at structuraltopicmodel.com data_sub ...

216 sym R (7655 sym/32 pcs) 9 img

Statistical Learning: Week-12

02.05.2022

Leave-One-Out cross validation (LOOCV) Model validation using LOOCV # load required packages and data (we will be using AmesHousing data) install.packages(c("boot", "rsample", "AmesHousing")) ## Installing packages into 'C:/Users/hktse/Documents/R/win-library/3.6' ## (as 'lib' is unspecified) ## ## There is a binary version available but th...

387 sym R (18330 sym/66 pcs) 1 img

Statistical Learning: Week-13

09.05.2022

Stripping raw text Stripping raw text using unnest_tokens() # load required packages install.packages(c("tibble", "tidytext", "ggplot2", "gutenbergr", "tidyr")) ## Installing packages into 'C:/Users/hktse/AppData/Local/R/win-library/4.2' ## (as 'lib' is unspecified) ## package 'tibble' successfully unpacked and MD5 sums checked ## Warning: cann...

496 sym R (50685 sym/151 pcs) 11 img

Statistical Learning: Week-11

25.04.2022

\(K\)-means and hierarchical clustering among different types of wine Apply \(K\)-means and hierarchical clustering to wine data # load required packages and data (wine data) install.packages(c("HDclassif", "useful", "factoextra")) ## Installing packages into 'C:/Users/hktse/Documents/R/win-library/3.6' ## (as 'lib' is unspecified) ## package '...

348 sym R (15208 sym/128 pcs) 8 img

Statistical Learning: Week-10

18.04.2022

## load required packages and data library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(ggplot2) library(tidyr) library(caret) ## Loading required pack...

656 sym R (50748 sym/231 pcs) 19 img

Statistical Learning: Week-9

11.04.2022

Classifying Legendary Pokemons using SVM! Using SVM techniques to classify if a Pokemon is a legendary one. # install required packages in one-swoop install.packages(c("dplyr", "ggplot2", "tidyr", "reshape2", "caret", "skimr", "psych", "e1071", "data.table", "Matrix", "keras")) ## Installing packages into 'C:/Users/hktse/Documents/R/win-library/...

455 sym R (24478 sym/112 pcs) 3 img