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 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__) |
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
| 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): |
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
| # 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 <[email protected]> |
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
| # -*- coding: utf8 -*- | |
| """Convex factorization machines | |
| Implements the solver by: Mathieu Blondel, Akinori Fujino, Naonori Ueda. | |
| "Convex factorization machines". Proc. of ECML-PKDD 2015 | |
| http://www.mblondel.org/publications/mblondel-ecmlpkdd2015.pdf | |
| """ | |
| # Author: Vlad Niculae <[email protected]> | |
| # License: Simplified BSD |
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
| """ Poisson-loss Factorization Machines with Numba | |
| Follows the vanilla FM model from: | |
| Steffen Rendle (2012): Factorization Machines with libFM. | |
| In: ACM Trans. Intell. Syst. Technol., 3(3), May. | |
| http://doi.acm.org/10.1145/2168752.2168771 | |
| See also: https://github.com/coreylynch/pyFM | |
| """ |
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
| from collections import Counter | |
| import numpy as np | |
| from sklearn.metrics import euclidean_distances | |
| from pyemd import emd as pyemd | |
| def word_movers_distance(a, b, embeddings): | |
| """Word Mover's Distance. | |
| A measure of text similarity: earth mover's distance in embedding metric space. |