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
# Simulando probabilidades | |
# Teste | |
simula_eleicoes <- function(sd) { | |
ns <- seq(0.25, 0.75, 0.001) | |
v <- purrr::map_dbl(ns, ~ mean( | |
ifelse( | |
rnorm(n = 100000, mean = .x, sd = sd) > .5 | |
, 1, 0 ) | |
) | |
) |
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 os | |
from itertools import repeat | |
import requests | |
import json | |
from multiprocessing.dummy import Pool as ThreadPool | |
def le_json(): | |
""" Carrega arquivo de dados json para leitura | |
""" | |
if os.path.isfile('./dados.json') is False: |
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(tidyverse) | |
# Colliders | |
x1 <- rnorm(1000) | |
y <- 1.2 + 1.6 * x1 + rnorm(1000) | |
z <- 0.6 + 1.3*x1 + 1.5*y + rnorm(1000) |
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
from PIL import Image, ImageFilter | |
import os | |
import requests | |
import numpy as np | |
import hashlib | |
import pickle | |
def classifica_arquivo(): | |
url = 'http://www.cmc.pr.gov.br/wspl/jcaptcha.jpg' | |
content = 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
from keras.models import Model, Input,Sequential | |
from keras.layers import Dense | |
from keras.optimizers import Adam # not important as there's no training here. | |
import numpy as np | |
from sklearn.datasets import load_digits | |
import numpy as np | |
digits = load_digits() |
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 | |
from bs4 import BeautifulSoup | |
import json | |
import sys | |
class Crawler: | |
def __init__(self, uf): | |
self.url = "http://www.cnj.jus.br/bnmp/rest/pesquisar" | |
self.uf = uf | |
input("teste uf: " + uf + " pode ir?") |
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 urllib.request | |
import json | |
jsondata = json.loads(urllib.request.urlopen('https://reddit.com/.json').read()) | |
# Dicionario guarda numero de cada estrutura de dados | |
count = { 'n_dicts': 0, 'n_lists': 0 } | |
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
lookback <- 50 | |
model <- keras_model_sequential() | |
model %>% | |
layer_lstm(units = lookback,input_shape=c(1,lookback), activation = "relu") %>% | |
layer_dense(units = 1, activation = "linear") | |
# try using different optimizers and different optimizer configs | |
model %>% compile( |
- Encontrar o ponto de acesso para o banco da Digesto
- Achar lista de envolvidos no banco da Digesto
NewerOlder