Data Visualization
2024-03-31
1 / 2
Data Visualization
Plot multiple countries on the world map
Yang Liu
/
2023-05-29
This post will show it’s quite easy to download and plot the administrative areas of multiple countries on the world map. I will also showcase a bug that puzzled me for a long time and I recently figured out: strange connecting lines among countries! […] (You may download the world map from Github) suppressPackageStartupMessages({ library("data.table") library("ggplot2")…
Data Visualization
US and China Admin1 COVID19 mortality and incidence rate
Yang Liu
/
2020-06-14
Similar to the last heatmap post I just revised, here I wrapped up the function and showing COVID-19 data just downloaded from JHU CSSE Github page. The function can take a given dataset and plot designated variable. Code hosted on my Github repo. […] # major function, can download from Github repo Blogdown/hugo-xmag/Code source(here::here("Code/COVID_make_map.R")) # US dt_JUH_US…
Data Visualization
ggplot US state and China province heatmap
Yang Liu
/
2020-06-12
(Updated on 2020-06-12, First posted on 2019-04-17) It sounds easy but turned out not as straight-forward as I thought. I will show: […] 50-state (including Alaska and Hawaii) United States thematic map, with map scale and with state abbreviations […] China thematic map, with map scale, with names of provinces in either English or Chinese […] The dt1 below can be used by both…
R package
SHAP for XGBoost in R: SHAPforxgboost
Yang Liu
/
2019-07-18
I wrote the R package SHAPforxgboost to cover all the plotting functions illustrated in this post. This post serves as the vignette for the package. Please install from CRAN or Github. install.packages("SHAPforxgboost") # or devtools::install_github("liuyanguu/SHAPforxgboost") Why SHAP values SHAP’s main advantages are local explanation and consistency in global model…
Data Visualization
Shiny in Blogdown
Yang Liu
/
2019-02-24
Since Blogdown is for static websites, it cannot run Shiny in rmarkdown directly. According to discussion here and document here. The only way to do it is using iframe and write outside the chunk: <iframe src="https://liuyanguu.shinyapps.io/bcl_app/" width=1000 height=800"></iframe> There is also a built-in function in knitr to do the same thing and write in the chunk. The only…
Machine Learning
SHAP Visualization in R (first post)
Yang Liu
/
2018-10-14
Update 19/07/21: Since my R Package SHAPforxgboost has been released on CRAN, I updated this post using the new functions and illustrate how to use these functions using two datasets. For more information, please refer to: SHAP visualization for XGBoost in R […] This is the example I used in the package SHAPforxgboost # Example use iris suppressPackageStartupMessages({…
««
«
1
2
»
»»