Install working tensorflow or pytorch via standard conda environment workflow.
The recommended conda-based install process works smoothly:
$ # Create a fresh environment
library(tidyverse) | |
library(glue) | |
library(gt) | |
library(kableExtra) | |
library(espnscrapeR) | |
# use espnscrapeR to get NFL standings + QBR ratings | |
nfl_qbr <- get_nfl_qbr(2020) | |
nfl_standings <- get_nfl_standings(2020) |
import requests | |
from tqdm import tqdm | |
def download(url: str, fname: str, chunk_size=1024): | |
resp = requests.get(url, stream=True) | |
total = int(resp.headers.get('content-length', 0)) | |
with open(fname, 'wb') as file, tqdm( | |
desc=fname, | |
total=total, |
fastROC <- function(probs, class) { | |
class_sorted <- class[order(probs, decreasing=T)] | |
TPR <- cumsum(class_sorted) / sum(class) | |
FPR <- cumsum(class_sorted == 0) / sum(class == 0) | |
return(list(tpr=TPR, fpr=FPR)) | |
} | |
# Helpful function adapted from: https://stat.ethz.ch/pipermail/r-help/2005-September/079872.html | |
fastAUC <- function(probs, class) { | |
x <- probs |
<html> | |
<head> | |
<title> | |
[Visualizing Movement Data with D3.js] | |
</title> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://omid.al/Mova-Viz/MovaViz-v0.1.2.js"></script> | |
<style> | |
* { | |
box-sizing: border-box |
library(serial) | |
rm(list = ls()) # clear environment | |
graphics.off() # close all graphic windows | |
### establish a serial connection | |
con <- serialConnection(name = "get_temps", |
#!/bin/bash | |
# Install Spark on CentOS 7 | |
yum install java -y | |
java -version | |
yum install wget -y | |
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz | |
tar xvf scala-2.11.7.tgz | |
sudo mv scala-2.11.7 /usr/lib | |
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala |
--- | |
title: HTML Dependencies | |
output: html_document | |
--- | |
This example explains how HTML dependencies work in **htmltools**. Sometimes an HTML fragment may have additional dependencies to work correctly, such as JavaScript and/or CSS files. In R Markdown documents, you have to let **rmarkdown** know these dependencies, so they can be added to the HTML header when the document is rendered through Pandoc. | |
Another thing that you need to pay attention is you have to "protect" your HTML output so that Pandoc does not touch it, e.g. when you have four leading spaces, Pandoc may think this line is supposed to be a `<pre>` block whereas you only meant to indent the line for cosmetic purposes. In this case, the function `htmltools::htmlPreserve()` will be _automatically_ applied to your HTML content in R Markdown if the content is generated from `htmltools::tags` or wrapped in `htmltools::HTML()`. | |
Now we use a random CSS file in the **knitr** package to illustrate how dependencies work. The goal here is to generate a |
'a' | |
'ba' | |
'pa' | |
'ma' | |
'fa' | |
'da' | |
'ta' | |
'na' | |
'la' | |
'ga' |