This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Newton interpolation and numerical differentiation | |
Created on Sun Apr 10 01:22:46 2011 | |
@author: vene | |
""" | |
from __future__ import division | |
from copy import copy |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
http://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf | |
parametrization by error is still in progress | |
""" | |
from time import time | |
import numpy as np | |
from scipy import linalg | |
import matplotlib.pyplot as pl |
This file contains 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 os | |
import numpy as np | |
import matplotlib.pylab as pl | |
from sklearn.svm import SVR | |
from sklearn.metrics import mean_squared_error | |
X = np.array([[13.], # This is dataset no. 3 from Anscombe's quartet. | |
[10.], # I moved the outlier to the first position for | |
[8.], # prettier code. This toy dataset illustrates |
This file contains 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 <[email protected]> | |
# 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'): |
This file contains 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 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 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 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": [ | |
{ |
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.
OlderNewer