Skip to content

Instantly share code, notes, and snippets.

View tmkasun's full-sized avatar
🕶️

Kasun Thennakoon tmkasun

🕶️
View GitHub Profile
@amueller
amueller / mlp.py
Created March 17, 2012 15:59
Multi-Layer Perceptron for scikit-learn with SGD in Python
import numpy as np
import warnings
from itertools import cycle, izip
from sklearn.utils import gen_even_slices
from sklearn.utils import shuffle
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.preprocessing import LabelBinarizer
@lukemarsden
lukemarsden / httpRequest.py
Created February 27, 2011 21:11
Simple function to do an HTTP POST using Twisted Agent
from twisted.web.iweb import IBodyProducer
from twisted.internet import defer
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
import urllib
class StringProducer(object):
implements(IBodyProducer)
def __init__(self, body):