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": [ | |
{ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# low-rank bilinear regression using theano (supports sparse inputs) | |
# predicts f(x_left, x_right) = x_left' UV' x_right | |
# Reference: | |
# Generalised Bilinear Regression | |
# K. Ruben Gabriel | |
# Source: Biometrika, Vol. 85, No. 3 (Sep., 1998), pp. 689-700 | |
# Stable URL: http://www.jstor.org/stable/2337396 | |
# Author: Vlad Niculae <vlad@vene.ro> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from sklearn.utils.metaestimators import if_delegate_has_method | |
from sklearn.utils.fixes import signature | |
class Test(object): | |
def hi(self, what): | |
return 1 + what | |
class Kid(object): |
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 | |
import numpy as np | |
import sklearn | |
import lightning | |
print("python", sys.version) | |
print("numpy", np.__version__) | |
print("scikit-learn", sklearn.__version__) | |
print("lightning", lightning.__version__) |