This file contains hidden or 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
Single-round, multiple person Prisoner's Dilemma. | |
I want to maximize my payout. | |
If I choose `c` and everyone else choses `d` then I get `0`. | |
```{r} |
This file contains hidden or 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
[core] | |
pager = less -F -X | |
[alias] | |
lg = log --first-parent --graph --pretty=format:'%C(yellow)%h%Creset -%C(auto)%d%Creset %s %C(cyan)(%cr) %Cresetby %C(bold blue)%aN%Creset' --abbrev-commit |
This file contains hidden or 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
# source: https://www.r-bloggers.com/lotka-volterra-model%C2%A0%C2%A0intro/ | |
library(deSolve) | |
LotVmod <- function (Time, State, Pars) { | |
with(as.list(c(State, Pars)), { | |
dx = x * (alpha - beta * y) | |
dy = -y * (gamma - delta * x) | |
return(list(c(dx, dy))) | |
}) | |
} |
This file contains hidden or 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
from siuba.siu import strip_symbolic, _ | |
import pandas as pd | |
d = pd.DataFrame({'a':[1], 'b':[1]}) | |
call = _.a + _.b | |
call(d) |
This file contains hidden or 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
# dynamically objects to completion | |
class Shape3(): | |
area = 1 | |
perimeter = 1 | |
location = 1 | |
shape_dict = {} | |
def __getitem__(self, key): | |
if hasattr(self, key): |
This file contains hidden or 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
# References: | |
# https://ipython.readthedocs.io/en/stable/config/integrating.html | |
# https://stackoverflow.com/questions/17974777/tab-complete-dictionary-keys-in-ipython | |
class Shape2(): | |
area = 1 | |
perimeter = 1 | |
location = 1 | |
def __getitem__(self, key): |
This file contains hidden or 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: "test" | |
output: rmarkdown::html_vignette | |
vignette: > | |
%\VignetteIndexEntry{test} | |
%\VignetteEngine{knitr::rmarkdown} | |
%\VignetteEncoding{UTF-8} | |
--- | |
```{r, include = FALSE} |
This file contains hidden or 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
library(dplyr) | |
library(janeaustenr) | |
library(tidytext) | |
library(tidylo) | |
library(ggplot2) | |
tidy_bigrams <- austen_books() %>% | |
unnest_tokens(bigram, text, token = "ngrams", n = 2) | |
# bigrams across books |
This file contains hidden or 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
library(sagemaker) | |
s3_bucket() | |
#> [1] "sagemaker-us-east-2-495577990003" | |
tune <- sagemaker_attach_tuner("xgboost-191114-1954") | |
sagemaker:::model_artifact_s3_path(tune$model_name) | |
#> [1] "s3://sagemaker-us-east-2-495577990003/models/xgboost-191114-1954-002-e66e00d3/output/model.tar.gz" |
This file contains hidden or 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
# https://github.com/tmastny/sagemaker/blob/4d64375bdf4019cc0bf82a7ff4d6d97ea134f103/R/install.R#L29 | |
library(stringr) | |
library(git2r) | |
library(magrittr) | |
print.github_url <- function(x, ...) { | |
cat(x) | |
invisible(x) | |
} |
NewerOlder