All Projects → ing-bank → Sparse_dot_topn

ing-bank / Sparse_dot_topn

Licence: apache-2.0
Python package to accelerate the sparse matrix multiplication and top-n similarity selection

Programming Languages

python
139335 projects - #7 most used programming language
cython
566 projects

Labels

Projects that are alternatives of or similar to Sparse dot topn

Ghpythonremote
A two-way connector to use regular Python from IronPython in Rhino/Grasshopper, and vice-versa.
Stars: ✭ 85 (-57.92%)
Mutual labels:  scipy
Nptdms
NumPy based Python module for reading TDMS files produced by LabView
Stars: ✭ 138 (-31.68%)
Mutual labels:  scipy
Psi4numpy
Combining Psi4 and Numpy for education and development.
Stars: ✭ 170 (-15.84%)
Mutual labels:  scipy
Numba Scipy
numba_scipy extends Numba to make it aware of SciPy
Stars: ✭ 98 (-51.49%)
Mutual labels:  scipy
Optimization Python
General optimization (LP, MIP, QP, continuous and discrete optimization etc.) using Python
Stars: ✭ 133 (-34.16%)
Mutual labels:  scipy
Piecewise linear fit py
fit piecewise linear data for a specified number of line segments
Stars: ✭ 141 (-30.2%)
Mutual labels:  scipy
Harmonica
Forward modeling, inversion, and processing gravity and magnetic data
Stars: ✭ 75 (-62.87%)
Mutual labels:  scipy
Tftb
A Python module for time-frequency analysis
Stars: ✭ 185 (-8.42%)
Mutual labels:  scipy
Ml Cheatsheet
A constantly updated python machine learning cheatsheet
Stars: ✭ 136 (-32.67%)
Mutual labels:  scipy
Micropython Ulab
a numpy-like fast vector module for micropython, circuitpython, and their derivatives
Stars: ✭ 166 (-17.82%)
Mutual labels:  scipy
Pooch
A friend to fetch your data files.
Stars: ✭ 101 (-50%)
Mutual labels:  scipy
Studybook
Study E-Book(ComputerVision DeepLearning MachineLearning Math NLP Python ReinforcementLearning)
Stars: ✭ 1,457 (+621.29%)
Mutual labels:  scipy
Scipy con 2019
Tutorial Sessions for SciPy Con 2019
Stars: ✭ 142 (-29.7%)
Mutual labels:  scipy
Credit Risk Modelling
Credit Risk analysis by using Python and ML
Stars: ✭ 91 (-54.95%)
Mutual labels:  scipy
Pyhf
pure-Python HistFactory implementation with tensors and autodiff
Stars: ✭ 171 (-15.35%)
Mutual labels:  scipy
Docker Alpine Python Machinelearning
Small Docker image with Python Machine Learning tools (~180MB) https://hub.docker.com/r/frolvlad/alpine-python-machinelearning/
Stars: ✭ 76 (-62.38%)
Mutual labels:  scipy
Data Analysis
主要是爬虫与数据分析项目总结,外加建模与机器学习,模型的评估。
Stars: ✭ 142 (-29.7%)
Mutual labels:  scipy
Pybotics
The Python Toolbox for Robotics
Stars: ✭ 192 (-4.95%)
Mutual labels:  scipy
Fatiando
Python toolkit for modeling and inversion in geophysics. DEPRECATED in favor of our newer libraries (see www.fatiando.org)
Stars: ✭ 179 (-11.39%)
Mutual labels:  scipy
Symfit
Symbolic Fitting; fitting as it should be.
Stars: ✭ 167 (-17.33%)
Mutual labels:  scipy

sparse_dot_topn:

sparse_dot_topn provides a fast way to performing a sparse matrix multiplication followed by top-n multiplication result selection.

Comparing very large feature vectors and picking the best matches, in practice often results in performing a sparse matrix multiplication followed by selecting the top-n multiplication results. In this package, we implement a customized Cython function for this purpose. When comparing our Cythonic approach to doing the same use with SciPy and NumPy functions, our approach improves the speed by about 40% and reduces memory consumption.

This package is made by ING Wholesale Banking Advanced Analytics team. This blog or this blog explains how we implement it.

Example

import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse import rand
from sparse_dot_topn import awesome_cossim_topn

N = 10
a = rand(100, 1000000, density=0.005, format='csr')
b = rand(1000000, 200, density=0.005, format='csr')

# Use standard implementation

c = awesome_cossim_topn(a, b, N, 0.01)

# Use parallel implementation with 4 threads

d = awesome_cossim_topn(a, b, N, 0.01, use_threads=True, n_jobs=4)

You can also find code which compares our boosting method with calling scipy+numpy function directly in example/comparison.py

Dependency and Install

Install numpy and cython first before installing this package. Then,

pip install sparse_dot_topn

Uninstall

pip uninstall sparse_dot_topn
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].