Skip to main content

Wide (partial Khatri-Rao) sparse matrix product

Project description

wide-product implements a partial, column-wise Khatri-Rao product. It is fast, and works on sparse matrices.

It can be useful for engineering of cross-features for machine learning.

Definition

For a pair of scalars (~ one by one matrices), the wide product is multiplication:

wide_product ( [[a]], [[b]] ) == [[a * b]]

Where matrices are constructed by vertical stacking, the product is row-wise:

wide_product ( vstack((A, B)), vstack((C, D)) ) ==
    vstack((wide_product(A, C),
            wide_product(B, D)))

Where matrices are constructed by horizontal stacking, the product contains all the products of the subcomponents up to permutation of columns:

wide_product ( hstack((A, B)), hstack((C, D)) ) ==
    hstack((wide_product(A, C),
            wide_product(A, D),
            wide_product(B, C),
            wide_product(B, D)))

Installation

pip install wide-product

Development

To build the module:

python setup.py build

To test:

PYTHONPATH=$(echo build/lib*):. py.test

To install:

pip install .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wide-product-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distributions

wide_product-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wide_product-0.1.0-cp311-cp311-macosx_10_9_universal2.whl (14.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

wide_product-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.1 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

wide_product-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wide_product-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl (9.4 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

wide_product-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl (10.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

wide_product-0.1.0-cp310-cp310-macosx_10_9_universal2.whl (16.4 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

wide_product-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wide_product-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl (9.4 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

wide_product-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wide_product-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl (9.4 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

wide_product-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.2 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

wide_product-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl (9.4 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

Details for the file wide-product-0.1.0.tar.gz.

File metadata

  • Download URL: wide-product-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for wide-product-0.1.0.tar.gz
Algorithm Hash digest
SHA256 631d0a849f7c09f600b635fc225bc1327290252c056677e375d804c596b8dff1
MD5 6ee46b8a42ee6ad9415a768fa7ba767e
BLAKE2b-256 d66af1c6a56a4c670dceb1be9baa323cb9a6eb767aa06fe49fbd35fa9384c1b0

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d22996e218d8bf23c89b243fbce83a0d46cc1edf70d92f739399cc58f892dabe
MD5 aeed185921d872e93498b3ddfff5119b
BLAKE2b-256 e4895db2b6d6483706668b03f19edbc42b7ac837bdc561cb3c16102f1d86214b

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1e814a8592d1210a3736fef71586a8ae0b361f9d27eef5e98dffdda0f089d832
MD5 ec1c0cebc096bedcba8a2feddfc75693
BLAKE2b-256 6b2b3851a210dce890dc0d77a445676daf57d4586b2db944cf8ca683eca45864

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 991e87a8e2c9f102a383103f72df973a3945769712210d18fba4dd66ca62a7ef
MD5 93fb1c717fa160e45fc547a3ff3c2dd3
BLAKE2b-256 7414d07ebbf5d754f363f9f4f1431268d41287c7685c2d209210fd65d3ce335a

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96de59a1bb633bcc3a17fd1254d8c7bbafec3032c1adbdefea7d9fedbfd2f8b7
MD5 26306f3939d239486e1aa9e97752dc99
BLAKE2b-256 f44555c6c8e7f324a10cb810e114b381e8db62ab52f09528147b14a38bec761b

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3c7dcc27fa4b7f4891b1a1006f51ceaecaa8d9983b60a840fa959218a4ec55ad
MD5 6c24c84d1db2285ef5a1da6213c5b79e
BLAKE2b-256 06c72464ef46d097ac1a1a9b37df490248bf04fe4f94e6471f592f31e908c206

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ce4bec84bf3c27fb3da155f77fae587eae10c6195648ad40eeaa6a3bc1c1d5c5
MD5 a12607bc1789eca6b0dad6369a210ed1
BLAKE2b-256 7d26c2c5bff190a3c9ee63b5bee89f1bfddccbf346ad97398db96267bd69a642

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5f3f8ebd4867d612ba540eb348f30ba0831e531b4d1f3714f4b326076d59a9ca
MD5 13659c75f73db6ec278e808b36b408e4
BLAKE2b-256 a10f485981c8ba51d951fd4c53c6e4c0e10211f02adbf3dcf48f2d0e9c31939c

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bd07b12f4110fccf743e584a473100f6b95d5e9eac096f669c9afbff8abae10
MD5 b9a9a2d7b2fe2d9dc1bee6b9fb58a44c
BLAKE2b-256 c1b7fa0a63fe4266e15cdf458a24a1684dd8b1c0f9147c1dcd2b4a5584bce0eb

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 364d3f23df7c5d87a3091044535222dd76ac2b878417dafcf80fe6950bfdc507
MD5 1d008d5f69397e37ac2a2bf997ed2b30
BLAKE2b-256 900dc0b9dbea6964321c94339ec37a2361ff7bd837dccf041f21947333513dd2

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 712624833c980b03e6c25a479ed5cb04817de990686e3e3088c68f1c071d390f
MD5 faf86cda49bf57238a0aa70876b96fcb
BLAKE2b-256 669df851dc4af0a40929f6d437c04ae6c3d9fc579f54c2d48ad44474cf46087b

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 31556495f0be47ff23d76f6aaceaafe2457f16335fb30b98aa396b70539e944e
MD5 9919b11bf862e228802c1dc71403400c
BLAKE2b-256 b9a3c46e668ba9536e0aa758b6d39b527bbf0121db91355a447bd20c33709ce1

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b16033d427a92acadf1057bd8afe247537bb8cbe0f7df057eff526ba7bb188c
MD5 37ee0b4c9dca4259e2372ff3e4e356b0
BLAKE2b-256 30599eb0a4e96ef17ef378bc9ec7f40ad5ad371aa897993ceef441f8dc553adb

See more details on using hashes here.

File details

Details for the file wide_product-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for wide_product-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 56a56475ce5c7b8af1fd345fb892c6048943598cf9f68d0290a88ec09674fc6c
MD5 81b0b69e70ad29f071a3768988c9814f
BLAKE2b-256 79c3cbd199a2aa07022f05963bd840ecbca8f1eb115d1df14519cfa66995491b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page