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
""" | |
Ridge coefficients as a function of the regularization parameter | |
---------------------------------------------------------------- | |
And highlight in dashed lines the optimal value by cross-validation. | |
Author: Fabian Pedregosa -- <fabian@fseoane.net> | |
""" | |
print __doc__ |
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
cimport numpy as np | |
import numpy as np | |
np.import_array() | |
def chkfinite_double(np.ndarray X): | |
cdef int i, length | |
cdef np.PyArrayObject val | |
cdef np.flatiter iter |
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
""" | |
Plot memory usage of a numeric computation using numpy and scipy | |
""" | |
"""Get process information""" | |
import time, sys, os | |
import linecache | |
if sys.platform.startswith('linux'): |
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
def _solve(A, b, solver, tol): | |
# helper method for ridge_regression, A is symmetric positive | |
if solver == 'auto': | |
if hasattr(A, 'todense'): | |
solver = 'sparse_cg' | |
else: | |
solver = 'dense_cholesky' | |
if solver == 'sparse_cg': |
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
/* | |
* pidgin | |
* | |
* Pidgin is the legal property of its developers, whose names are too numerous | |
* to list here. Please refer to the COPYRIGHT file distributed with this | |
* source distribution. | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or |
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 sys, os, termios, tty | |
pid, fd = os.forkpty() | |
term_info = termios.tcgetattr(sys.stdin.fileno()) | |
if pid < 0: | |
raise ValueError("Early exit: could not fork process") | |
elif pid == 0: | |
# .. child .. |
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 <fabian@fseoane.net> | |
# | |
# License : BSD | |
def isotonic_regression_new(w, y, x_min=None, x_max=None): | |
""" | |
Solve the isotonic regression with complete ordering model: |
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
# -*- coding: utf-8 -*- | |
""" | |
Minimalistic implementation of l1 minimization via coordinate descent. | |
Reference: www.jstatsoft.org/v33/i01/paper | |
Author: Fabian Pedregosa <fabian@fseoane.net> | |
""" | |
import numpy as np |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.