Skip to content

Instantly share code, notes, and snippets.

View vene's full-sized avatar
🏴
ahoy

Vlad Niculae vene

🏴
ahoy
View GitHub Profile
@vene
vene / grouped_score.py
Created November 2, 2012 23:56
Grouped score in scikit-learn proof of concept
import numpy as np
from sklearn.metrics import zero_one_score
# Input data corresponds to 4 words:
# - descalcarea (des-cal-ca-rea, predicted: de-s-cal-ca-rea)
# - somnolezi (som-no-lezi, predicted: som-no-lezi)
# - salandere (sa-lan-de-re, predicted: sa-lan-de-re)
y_pred = np.array(
[False, True, True, False, False, True, False, True, False,
@vene
vene / lbfgs_nnls.py
Last active December 10, 2015 11:48 — forked from mblondel/lbfgs_nnls.py
# (C) Mathieu Blondel 2012
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.utils.extmath import safe_sparse_dot
class LbfgsNNLS(BaseEstimator, RegressorMixin):
@vene
vene / UncertainEnglish
Last active December 24, 2015 14:59
temporal text classification
{
"metadata": {
"name": "EnglishDating"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@vene
vene / compare_nmf.ipynb
Last active December 26, 2015 18:48
Compare NMF solvers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / lang_sim.ipynb
Last active December 30, 2015 22:09
Simple language similarity with character n-grams
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / lrbilinear.py
Last active May 30, 2016 18:11
low-rank bilinear regression using theano
# low-rank bilinear regression using theano (supports sparse inputs)
# predicts f(x_left, x_right) = x_left' UV' x_right
# Reference:
# Generalised Bilinear Regression
# K. Ruben Gabriel
# Source: Biometrika, Vol. 85, No. 3 (Sep., 1998), pp. 689-700
# Stable URL: http://www.jstor.org/stable/2337396
# Author: Vlad Niculae <vlad@vene.ro>
@vene
vene / AttentiveGRU.ipynb
Last active July 21, 2016 00:42
Attentive GRU for classification of text dyads
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / trollplot.ipynb
Created August 4, 2016 15:02
The Trolliest Plot Ever
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / check_if_delegate_has_method.py
Created June 7, 2017 08:33
if_delegate_has_method adds explicit self
from sklearn.utils.metaestimators import if_delegate_has_method
from sklearn.utils.fixes import signature
class Test(object):
def hi(self, what):
return 1 + what
class Kid(object):
@vene
vene / check.py
Last active June 9, 2017 08:32
lightning multiprocessing failure in python 3.6
import sys
import numpy as np
import sklearn
import lightning
print("python", sys.version)
print("numpy", np.__version__)
print("scikit-learn", sklearn.__version__)
print("lightning", lightning.__version__)