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
#/bin/bash | |
source $HOME/envs/cron/bin/activate | |
cd $HOME/cron/nisl | |
# clean all previous code | |
rm -rf * | |
# clean import | |
git fetch origin | |
git reset --hard origin/master |
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
from __future__ import print_function | |
import numpy as np | |
from sklearn import linear_model | |
from datetime import datetime | |
import pylab as pl | |
import pylab | |
def errorfill(x, y, yerr, color=None, alpha_fill=0.3, ax=None, label=None): | |
# helper function, stolen from http://tonysyu.github.com/plotting-error-bars.html |
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 import linalg | |
from scipy.sparse import linalg as splinalg | |
def prox_l1(a, b): | |
return np.sign(a) * np.fmax(np.abs(a) - b, 0) | |
def prox(X, t, v0, n_nonzero=1000, n=0, algo='dense', n_svals=10): | |
"""prox operator for trace norm |
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
# .. Memory benchmarks for SciPy's Singular Value Decomposition .. | |
# .. Author: Fabian Pedregosa <[email protected]> | |
import numpy as np | |
from scipy.sparse import linalg as splinalg | |
from scipy import sparse, linalg | |
import pylab as pl | |
from memory_profiler import memory_usage | |
dims = np.arange(500, 1500, 20) |
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 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 | |
# Author : Fabian Pedregosa <[email protected]> | |
# | |
# License : BSD | |
def isotonic_regression_new(w, y, x_min=None, x_max=None): | |
""" | |
Solve the isotonic regression with complete ordering model: |
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 -*- | |
""" | |
Strong rules for coordinate descent | |
Author: Fabian Pedregosa <[email protected]> | |
""" | |
import numpy as np | |
from scipy import linalg |
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 -*- | |
""" | |
Minimalistic implementation of l1 minimization via coordinate descent. | |
Reference: www.jstatsoft.org/v33/i01/paper | |
Author: Fabian Pedregosa <[email protected]> | |
""" | |
import numpy as np |
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 | |
# Author : Alexandre Gramfort | |
# license : BSD | |
def pav(y): | |
""" | |
PAV uses the pair adjacent violators method to produce a monotonic | |
smoothing of y |
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 | |
def isotonic_regression(w, y, x_min=None, x_max=None): | |
""" | |
Solve the isotonic regression model: | |
min Sum w_i (y_i - x_i) ** 2 | |
subject to x_min = x_1 <= x_2 ... <= x_n = x_max |