This file contains hidden or 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 pymongo.connection import Connection | |
m = Connection() | |
db = m.reddit | |
votes = db.votes | |
cursor = votes.find().skip(0).limit(50000) | |
print "Setup cursor: %s" % cursor |
This file contains hidden or 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
"""Kernel K-means""" | |
# Author: Mathieu Blondel <[email protected]> | |
# License: BSD 3 clause | |
import numpy as np | |
from sklearn.base import BaseEstimator, ClusterMixin | |
from sklearn.metrics.pairwise import pairwise_kernels | |
from sklearn.utils import check_random_state |
This file contains hidden or 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
(\b((https?://|www\.)|[a-z0-9\.-]+?\.(com|co\.uk|org|net|info|ca)(?=[/ \W\b]))[^ \t\r\n<>]*?(?=(([\'\xe2\x80\x9c".?!,:;]|&(amp|lt|gt|quot);)+?)?(\.\.+|[<>]|\s|$))) |
This file contains hidden or 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
# script stolen from http://goo.gl/YbQyAQ | |
# install.packages("tm") | |
# install.packages("ggplot2") | |
# install.packages("lsa") | |
# install.packages("scatterplot3d") | |
#install.packages("SnowballC") | |
#if !(require('SnowballC')) then install.packages("SnowballC") | |
library(tm) | |
library(ggplot2) |
This file contains hidden or 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
# Create a virtual environment using conda | |
conda create -n edx_downloader python=2.7 pip | |
activate edx_downloader | |
# Install dependencies: | |
pip install youtube-dl | |
pip install beautifulsoup4 | |
# Get the script | |
git clone https://github.com/dmitrime/edx-downloader.git |
This file contains hidden or 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
# Create a virtual environment using conda | |
conda create -n coursera_dl python=2.7 pip | |
# Get the code | |
git clone https://github.com/coursera-dl/coursera.git | |
cd coursera\ | |
# Install the dependencies (using virtual environment) | |
activate coursera_dl | |
pip install -r requirements.txt |
NewerOlder