About this package
Collaborative Filtering is a method that is often used as a recommendation engine. Many industries have used this algorithm to recommend their products, this library can use cosine similarity or even centered cosine similarity.
Depedencies
- Python >= 3
- numpy
How to use
- cos_similarity(var1, var2, centered)
Parameters
var1 : iterable, array, np.array
The single arrray value you want to compare
var2 : iterable, array, np.array
The multi arrray values, you can convert from dataframe or table on your database
centered : bool
By default it will give true, if true you will use centered cosine similarity
Example case
- We'll try to figuring out this single matrix value, on the multi array
[4, 0, 0, 5, 1, 0, 0]
- The example dataset that we had
[[5, 5, 4, 0, 0, 0, 0],
[0, 0, 0, 2, 4, 5, 0],
[0, 3, 0, 0, 0, 0, 3]]
Example of code
from rengine.method import CollaborativeFiltering
import numpy as np
clf = CollaborativeFiltering()
print(clf.cos_similarity(np.array([5, 4, 0, 0]), [[1, 0, 3, 2], [2, 1, 1, 0], [4, 5, 0, 1]]))
Example of output
[-0.5, 0.866, -0.24] #row 2 in multi array data has more similarity
Another of output
[0.092, -0.559, nan] #nan means there's a number divided by zero
Metadata
Release files for rengine 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rengine-0.1.5.tar.gz | 3.8 kB | Without provenance | Details for rengine-0.1.5.tar.gz |
Release files / rengine-0.1.5.tar.gz
| Download URL | rengine-0.1.5.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2eb09938cdf9379828c6867bd27f841e5d310e0280aba591cd1ea98e5065073
|
|
BLAKE2b-256 checksum How to use checksums |
d6855f985f785cb7a54f91939bbb25e86c28623e183d455100e6b4e23d00f951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
|
Security for rengine 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.