title: author: date: slug:
categories: tags: layout: layouts/post/single draft: no
################################################################# | |
## tidymodels ## | |
## 5 A predictive modeling case study ## | |
## url: https://www.tidymodels.org/start/case-study/ ## | |
################################################################# | |
# 1.0 INTRODUCTION ---- | |
## 1.1 General ---- | |
library(tidymodels) | |
## 1.2 Helper packages ---- |
################################################################# | |
## tidymodels ## | |
## 4 Tune model parameters ## | |
## url: https://www.tidymodels.org/start/tuning/ ## | |
################################################################# | |
# 1.0 INTRODUCTION ---- | |
## 1.1 hyperparameters ---- | |
### 1.1.1 mtry()---- | |
### 1.1.2 learn_rate()---- |
################################################################# | |
## tidymodels ## | |
## 3 Evaluate Model with Resampling ## | |
## url: https://www.tidymodels.org/start/resampling/ ## | |
################################################################# | |
# 1.0 INTRODUCTION ---- | |
#Resampling measures how well a model predicts new data | |
#predict image segmentation quality | |
## 1.1 Load tidymodels ---- |
################################################################## | |
## tidymodels ## | |
## 2 Preprocess with Recipes ## | |
## url: https://www.tidymodels.org/start/recipes/ ## | |
################################################################## | |
# 1.0 INTRODUCTION ---- | |
## 1.1 tidymodels ---- | |
library(tidymodels) | |
## 1.2 Helper packages |
################################################################# | |
## tidymodels ## | |
## 1 build a model ## | |
## url: https://www.tidymodels.org/start/models/ ## | |
################################################################# | |
# 1.0 INTRODUCTION ---- | |
## 1.1 Parsnip pkg + the rest of tidymodels ---- | |
library(tidymodels) | |
## 1.2 Helper packages ---- | |
library(readr) # for importing data |
#install.packages(x) | |
x <- c("ggmap", "rgdal", "rgeos", "maptools", "dplyr", "tidyr", "tmap", | |
"raster") | |
lapply(x, library, character.only = TRUE) | |
rm(x) | |
#read in | |
hd <- readOGR(dsn = "./data_raw/shp/HH001M01", | |
layer = "HH001M01", | |
stringsAsFactors = F | |
) |
# In case you have to reload | |
# > sessionInfo() | |
# R version 3.6.3 (2020-02-29) | |
# Platform: x86_64-apple-darwin15.6.0 (64-bit) | |
# Running under: macOS Catalina 10.15.3 | |
# | |
# Matrix products: default | |
# BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib | |
# LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib | |
# |
# Rob Wiederstein | |
# .gitignore for R projects | |
# github doesn't track empty dirs | |
# other templates: https://github.com/github/gitignore | |
# | |
# General | |
.DS_Store |
<!--load latest jquery library --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> | |
<!--load dynatable js from from https://github.com/alfajango/jquery-dynatable--> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Dynatable/0.3.1/jquery.dynatable.js"></script> | |
<!--load syntax highlighter www.highlightjs.org css + js sourced from my files--> | |
<link rel="stylesheet" href="https://dl.dropbox.com/s/ca4lzll2451pjqu/xcode.css"> | |
<script src="https://dl.dropbox.com/s/j1o79lb7r7pfc1l/highlight.pack.js"></script> | |
<!--leaflet css--> | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin="" /> | |
<!-- Make sure you put this AFTER Leaflet's CSS --> |