Skip to content

Instantly share code, notes, and snippets.

View vene's full-sized avatar
🏴
ahoy

Vlad Niculae vene

🏴
ahoy
View GitHub Profile
"""
(C) August 2013, Mathieu Blondel
# License: BSD 3 clause
Custom group support by Vlad Niculae (vlad@vene.ro)
This is a Numba-based reimplementation of the block coordinate descent solver
(without line search) described in the paper:
Block Coordinate Descent Algorithms for Large-scale Sparse Multiclass
@vene
vene / lang_sim.ipynb
Last active December 30, 2015 22:09
Simple language similarity with character n-grams
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / nls_solvers.ipynb
Last active May 5, 2025 07:33
Non-negative least squares in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / nmf_faces.ipynb
Created October 29, 2013 15:54
Comparison of NMF solvers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vene
vene / compare_nmf.ipynb
Last active December 26, 2015 18:48
Compare NMF solvers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / 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 / bench_eucl.py
Created August 9, 2012 16:44
Benchmark euclidean_distances
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse import issparse
from sklearn.utils import atleast2d_or_csr
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.metrics.pairwise import check_pairwise_arrays, euclidean_distances
from sklearn.metrics.euclidean_fast import dense_euclidean_distances, sparse_euclidean_distances
@vene
vene / magic_memit.py
Created June 30, 2012 06:55
memit: magic memory usage benching for IPython
# Author: Vlad Niculae <vlad@vene.ro>
# Makes use of memory_profiler from Fabian Pedregosa
# available at https://github.com/fabianp/memory_profiler
from IPython.core.magic import Magics, line_magic, magics_class
class MemMagics(Magics):
@line_magic
def memit(self, line='', setup='pass'):