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
library(glmnet) | |
x_var <- data.matrix(mtcars[, c("hp", "wt", "drat")]) | |
y_var <- mtcars[, "mpg"] | |
fit_lambda_specified <- cv.glmnet(x_var, y_var, alpha = 0, lambda = 10^seq(5, -5, by = -.1)) | |
fit_lambda_automatic <- cv.glmnet(x_var, y_var, alpha = 0) | |
plot(fit_lambda_specified, xvar="lambda") | |
plot(fit_lambda_automatic, xvar="lambda") |
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
corpus <- readr::read_csv("corpus.csv") | |
# Work with | |
#t <- corpus$text[1:100] | |
t <- corpus$text[124] | |
spacyr::spacy_tokenize(t) |
We can't make this file beautiful and searchable because it's too large.
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
text,label | |
Stuning even for the non-gamer: This sound track was beautiful! It paints the senery in your mind so well I would recomend it even to people who hate video game music! I have played the game Chrono Cross but out of all of the games I have ever played it has the best music! It backs away from crude keyboarding and takes a fresher step with grate guitars and soulful orchestras. It would impress anyone who cares to listen! ^_^,__label__2 | |
" The best soundtrack ever to anything.: I'm reading a lot of reviews saying that this is the best 'game soundtrack' and I figured that I'd write a review to disagree a bit. This in my opinino is Yasunori Mitsuda's ultimate masterpiece. The music is timeless and I'm been listening to it for years now and its beauty simply refuses to fade.The price tag on this is pretty staggering I must say, but if you are going to buy any cd for this much money, this is the only one that I feel would be worth every penny.",__label__2 | |
" Amazing!: This soundtrack is my favorite musi |
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
g <- rasterGrob(greens, width = unit(1, "npc"), height = unit(1, "npc"), interpolate = TRUE) | |
test <- ggplot(mtcars, aes(x = mtcars$hp, y = mtcars$mpg)) + | |
theme(plot.background = element_blank(), | |
panel.background = element_blank()) + | |
annotation_custom( | |
grob = g, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf | |
) + geom_point() | |
plot_grid(test, labels = c('A')) |
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
errors <- vector() | |
for ( i in seq(from = 1, to = 50) ) { | |
print(paste('Bagging with',i,'trees')) | |
ames_bag_i <- bagging( formula = Sale_Price ~ ., data=ames_training, nbagg = i, control = rpart.control(minsplit = 2, cp = 0)) | |
errors <- c(errors, ames_bag_i$err) | |
} | |
error_df <- as.data.frame(errors) | |
error_df$n_trees <- 1:nrow(error_df) | |
ggplot(data = error_df, aes(x = n_trees, y = errors)) + geom_line() |
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
# A example on how to use slice in tensorflow, simple but important to remember. | |
import tensorflow as tf | |
x = tf.constant([[[1., 2.], [3., 4. ], [5. , 6. ]], | |
[[7., 8.], [9., 10.], [11., 12.]]]) | |
# All first elements | |
# [[[ 1.],[ 3.],[ 5.]], [[ 7.],[ 9.],[11.]]] | |
res = tf.slice(x, [0, 0, 0], [2, 3, 1]) |
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
import requests | |
import re | |
from bs4 import BeautifulSoup | |
#<a href="salud-mental/" class="boton">Ver reportaje</a> | |
#http://multimedia.laprensa.com.ni/ | |
def trade_spider(max_pagina): | |
pagina=1; | |
while pagina <=max_pagina: | |
url='http://multimedia.laprensa.com.ni/index.html' | |
crap= requests.get(url) |
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
<string-array name="currencies" translatable="false"> | |
<item name="USD">Dollar - $</item> | |
<item name="MXN">Mexico Peso - $</item> | |
<item name="COP">Colombian Peso - $</item> | |
<item name="ARS">Argentine Peso - $</item> | |
<item name="NIO">Cordoba - C$</item> | |
<item name="GTQ">Quetzales - Q</item> | |
<item name="CRC">Colones - ₡</item> | |
<item name="HNL">Lempira - L</item> | |
<item name="EUR">Euro - €</item> |
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
final class PrintDialogJavaScriptInterface { | |
public String getType() { | |
return cloudPrintIntent.getType(); | |
} | |
public String getTitle() { | |
return cloudPrintIntent.getExtras().getString("title"); | |
} | |
public String getContent() { |
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
#Ignore sass cache | |
.sass-cache/ | |
#ignore tmp | |
tmp/ | |
sites/all/default/files/* | |
#Ignore CSS files from theme (they all autogenerated from sass) | |
sites/all/themes/ayerdis/css/* |