Skip to content

Instantly share code, notes, and snippets.

View VictorGarritano's full-sized avatar

Victor Garritano VictorGarritano

  • Rio de Janeiro, Brazil
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import requests
import pandas as pd
from bs4 import BeautifulSoup
url = "http://www.maisbolao.com.br/bolao/classificacao/31858/bolao-da-twist"
class HTMLTableParser:
def parse_url(self, url):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
n = 50
Xtest = np.linspace(-5, 5, n).reshape(-1,1)
def kernel(a, b, param):
sqdist = np.sum(a**2, 1).reshape(-1,1) + np.sum(b**2, 1) - 2*np.dot(a, b.T)
return np.exp(-0.5 * (1/param) * sqdist)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@VictorGarritano
VictorGarritano / hamming.py
Created November 6, 2017 19:35
helper function to calculate hamming distance between two binary lists
hamming = lambda x,y: (1.0/len(x))*sum([a != b for a,b in zip(x,y)])
@VictorGarritano
VictorGarritano / discretization.py
Last active November 1, 2017 22:59
updating __init__ documentation
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Usage:
>>> from sklearn.datasets import load_iris
>>> data = load_iris()
>>> obj = disc.Discretization(data.data, {0:7,1:3, 2:10, 3:4})
>>> X_t = obj.fit_transform()
>>> sample = X_t[65,:]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.