Skip to content

Instantly share code, notes, and snippets.

import PropTypes from "prop-types";
import { PureComponent } from "react";
class Delayed extends PureComponent {
constructor(props) {
super(props);
this.state = { hidden: true };
}
componentDidMount() {
model = Sequential()
model.add(Dense(5, input_shape = (10,)))
model.add(Dense(1))
model.add(Activation('sigmoid'))
model.compile(loss='binary_crossentropy',
optimizer= 'sgd',
metrics=['binary_accuracy', 'fmeasure', 'precision', 'recall'])
history = model.fit(X_train, Y_train,
ebony chris
gotta go okay i
ok i en.wikipedia.org wiki
my boss https en.wikipedia.org
my mum my mom
ok i'm okay i'm
this shit wonderful human
https youtu.be ebony i
my bro mean that's
ebony chris
gotta go okay i
ok i en.wikipedia.org wiki
my boss https en.wikipedia.org
my mum my mom
ok i'm okay i'm
this shit wonderful human
https youtu.be ebony i
my bro mean that's
ebony chris
in other news https en.wikipedia.org wiki
in the states on my way
ok i'm going yeah i mean
gotta go x wonderful human being
told me to the same way
i actually don't i mean that's
i feel so but i also
tell you about my god i
data <- readLines('~/Downloads/_chat.txt')
remove <- vector(mode = 'logical', length = length(data))
for (i in 1:length(data)){
if (!str_detect(data[i], ': Christopher Grainger: |: Ebony Ruggero: ')) {
data[i-1] <- str_c(data[i-1], data[i], sep = ' ')
remove[i] <- TRUE
} else {
remove[i] <- FALSE
}
}
i <- seq(1, numberguesses)
result <- apply(i, function(x){
a = random(1,10000000)
b = random(a,10000001)
cond_exp <- CONEXP(a,b)
cond_exp <- cond_exp[cond_exp is within .1% of actual expected value]
return (cond_exp)
}
)
library(readr)
library(dplyr)
df <- read_csv('~/desktop/guns.csv')
library(ggplot2)
library(ggthemes)
df %>%
arrange(desc(guns_per_100_people)) %>%
top_n(n = 20, wt = guns_per_100_people) %>%
ggplot(aes(x = country,
library(quanteda)
library(dplyr)
library(tidyr)
library(networkD3)
load(url("http://www.kenbenoit.net/files/presDebateCorpus2016seg.RData"))
candidates <- subset(presDebateCorpus2016seg, speakertype == 'candidate')
dfm <- dfm(candidates, groups = c("tag"), ngrams = 1:3,
ignoredFeatures = c('people','go','going','will','know','think',
'country','get','applause','want','need',
temp_precip = []
for i,p in enumerate(correct_precip):
if i % 6 == 0:
temp_precip.append(p)
else:
temp_precip.append(p-correct_precip[i-1])
if i % 10000 == 0:
print i