Skip to content

Instantly share code, notes, and snippets.

@inactivist
inactivist / lps.py
Last active December 16, 2015 02:39
"Quick and dirty" Python script for counting the lines per second pulled from stdin.
#!/usr/bin/python
"""Print stats about stdin per-line timings."""
import signal
import sys
import time
start = time.time()
count = 0
try:
@MLnick
MLnick / sklearn-lr-spark.py
Created February 4, 2013 14:29
SGD in Spark using Scikit-learn
import sys
from pyspark.context import SparkContext
from numpy import array, random as np_random
from sklearn import linear_model as lm
from sklearn.base import copy
N = 10000 # Number of data points
D = 10 # Numer of dimensions
ITERATIONS = 5