Skip to content

Instantly share code, notes, and snippets.

View dmarcelinobr's full-sized avatar
💭
I may be slow to respond

Daniel Marcelino dmarcelinobr

💭
I may be slow to respond
View GitHub Profile
@dmarcelinobr
dmarcelinobr / governismo_partidos.csv
Last active September 7, 2020 13:24
Creating The Economist plot style with the Governism Index from JOTA
date legislator_party media_mes cma tma bancada soma
2020-08-28 AVANTE 0.748039215686275 0.857352941176471 0.761019607843137 6 1916
2020-08-28 CIDADANIA 0.717086834733894 0.775210084033614 0.697221988795518 8 2574
2020-08-28 DEM 0.839740514790993 0.919870257395496 0.862903342104668 28 8380
2020-08-28 MDB 0.879152406248459 0.939576203124229 0.884653145577298 35 10992
2020-08-28 NOVO 0.705882352941177 0.852941176470588 0.782941176470588 8 3086
2020-08-28 PATRI 0.958823529411765 0.979411764705882 0.956078431372549 6 1898
2020-08-28 PCdoB 0.3203125 0.16015625 0.34015625 8 872
2020-08-28 PDT 0.519899948827285 0.445820393581163 0.464454263280975 28 4494
2020-08-28 PL 0.959809897304683 0.96767208153832 0.940172709158139 41 12792
n_random = 100
params_grid <- expand.grid(
num_leaves = c(100, 200, 500, 1000, 2000, 5000),
learning_rate = c(0.01, 0.03, 0.1),
min_data_in_leaf = c(5, 10,20, 50),
feature_fraction = c(0.6, 0.8, 1),
bagging_fraction = c(0.4, 0.6, 0.8, 1),
lambda_l1 = c(0.0, 0.0, 0.01, 0.1, 0.3),
lambda_l2 = c(0.0, 0.0, 0.01, 0.1, 0.3)
a
acerca
adeus
agora
ainda
alem
algmas
algo
algumas
alguns
words
à
a
agora
ainda
alguém
algum
alguma
algumas
alguns
@dmarcelinobr
dmarcelinobr / stopwordsbr.txt
Last active April 21, 2020 12:58
Stopwords for Aprovometro and other projects
word
de
a
o
que
e
do
da
em
um
@dmarcelinobr
dmarcelinobr / 2015-Tutorial-R-Selenium.R
Created April 2, 2019 00:01
Tutorial de uso do R e Selenium apresentado no IPEA, 2015
#Instalar e carregar pacotes de interesse
install.packages('RSelenium')
require('RSelenium')
require('XML')
#Atualiza seu aplicativo Java do Selenium
RSelenium::checkForServer()
#Abrir o servidor local
RSelenium::startServer()
remDr <- remoteDriver()
// Define functions to render linked interactive plots using d3.
// Another script should define e.g.
// <script>
// var plot = new animint("#plot","path/to/plot.json");
// </script>
// Constructor for animint Object.
var animint = function (to_select, json_file) {
function wait_until_then(timeout, condFun, readyFun) {
function checkFun() {
# boxplot: box-and-whisker plot, the data is broken up into quartiles: the box contains the middle 50% of the Ct values for each gene, the black bar is the median, the whiskers represent the top and bottom 25% of the observations. Circles represent outliers.
# standard error (of the sample mean): THINK ACCURACY - THE SD OF THE sample mean (x_bar), it describes the accuracy of the sample mean as an estimate of the population mean. an estimate of how close is my sample mean to the population mean (should decrease by increasing sample size): standard error of the mean (i.e., of using the sample mean as a method of estimating the population mean) is the standard deviation of those sample means over all possible samples (of a given size) drawn from the population.
The sample mean has 95% prob of being within 2 se of the pop mean
# standard deviation (of the sample): THINK VARIABILITY - DESCRIBES THE SPREAD OF VALUES IN THE SAMPLE: how much do the individuals within the sample differ from the sample mean (unaf
@dmarcelinobr
dmarcelinobr / interpolate.R
Created April 15, 2016 19:23
Interpolation and smoothing functions in R
# Generate data in the form of a sine wave
set.seed(1)
n <- 1e3
dat <- data.frame(
x = 1:n,
y = sin(seq(0, 5*pi, length.out = n)) + rnorm(n=n, mean = 0, sd=0.1)
)
approxData <- data.frame(
with(dat,