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
| """ | |
| (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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| { | |
| "metadata": { | |
| "name": "EnglishDating" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| # (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): |
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
| 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, |
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
| 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 | |
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
| # 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'): |