This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r include=F} | |
options(width=120) | |
set.seed(3874) | |
options(error=function() {save.image(file="error.rmd.RData")}) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Untitled" | |
output: html_document | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Nightmare = require ("nightmare"); | |
const vo = require("vo"); | |
function scrape (url: string, dataScraper: Function, urlScraper: Function, | |
injectJQuery: boolean = true, validate: Function = null) | |
{ | |
var item : any = null, urls: any = null; | |
// do not show window, do not load images (reduce time to ready()) | |
var nightmare = Nightmare({show: false, pollInterval: 800, webPreferences: {images: false}}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
# save document's environment (replaces existing one) | |
save.image(file="housePrices.rmd.RData") | |
# archive (optional) | |
save.image(file=paste0("housePrices_", format(Sys.time(),"%d%m%y_%H%M"), ".rmd.RData")) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reset current environment (optional) | |
rm(list=ls()) | |
# load environment from file | |
load("housePrices.rmd.RData") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reset current environment (optional) | |
rm(list=ls()) | |
# load environment from file | |
load("housePrices.rmd.RData") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
options(error=function() {save.image(file="error.rmd.RData")}) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
eval.trainModels=T | |
eval.pcaOptimization=T | |
``` | |
```{r eval=eval.pcaOptimization, include=eval.pcaOptimization} | |
# code applying PCA optimization | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r rf, cache=T} | |
# train random forest model | |
``` | |
```{r cache=T, dependson=”rf”} | |
# predict using random forest model | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unlink('housePrices_cache', recursive = TRUE) |
OlderNewer