Skip to content

Instantly share code, notes, and snippets.

View alep's full-sized avatar
🐙
Vamo' a calamarno

Alejandro Peralta alep

🐙
Vamo' a calamarno
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# coding: utf-8
import scipy as sp
from sklearn.feature_extraction.text import CountVectorizer, HashingVectorizer
from sklearn.naive_bayes import BernoulliNB
from sklearn.linear_model import LogisticRegression
from sklearn import cross_validation
from sklearn import metrics
datafile = open("data.tsv")
@alep
alep / id3.py
Created September 1, 2014 20:19 — forked from cmdelatorre/id3.py
"""
http://en.wikipedia.org/wiki/ID3_algorithm
http://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm
"""
from collections import namedtuple, Counter, defaultdict
from math import log2
@alep
alep / lr.py
Last active July 26, 2016 14:53
Logistic Regresion.
import numpy as np
import scipy as sp
import warnings
from sklearn import metrics
from sklearn import cross_validation
from sklearn.utils.fixes import expit as logistic_sigmoid
from sklearn.utils.extmath import log_logistic
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
import nltk
from collections import namedtuple
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction import FeatureHasher
Data = namedtuple('Data', [
'word_i_minus_2',
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by');
typeof(options) != 'undefined' || (options = {});
typeof(this.limit) != 'undefined' || (this.limit = 20);
typeof(this.offset) != 'undefined' || (this.offset = 0);
typeof(this.filter_options) != 'undefined' || (this.filter_options = {});
typeof(this.sort_field) != 'undefined' || (this.sort_field = '');