A package that recommends similar data collections based on unstructured and explicitly provided meta information of files.
Project description
DA4RDM_RecSys_UserBased
Description
The DA4RDM_RecSys_UserBased is a python based package that recommends data collections based on matching users' behavior analysis and an explorative analysis of user-resource interactions.
Installation
The package is built using Python as a programming language and utilizes python packages such as sklearn, json etc. The complete list of dependencies could be referred to in the requirements.txt file. Please make sure the necessary packages are installed before execution. The package can be installed using the pip command provided below.
pip install DA4RDM-RecSys-UserBased
Importing the Modules
The package has one important module get_recommendation. This modules invokes the necessary functions from other modules that perform the tasks of data extraction, outlier detection, decay analysis and knn implementation to output recommendation. The module can be imported using the below command:
from DA4RDM_RecSys_UserBased import get_recommendation
Usage
The package can be used to generate resource recommendations based on the input reference user id. To do so the function get_recommendations within the module get_recommendation can be called and the respective user id should be passed along with other function parameters. In addition to that three optional arguments can also be passed namely the number of neighbours being used in the KNN Nearest neighbour algorithm by the recommender system, next is the number of recommended resources that is expected as function output and finally the outlier method to use. The function body along with default parameter values is as shown below:
def get_recommendations(datapath, dataset_resources, ref_user, num_neighbours=3, num_recommendation=3, outlier_detection_method="percentile"):
"""Outputs knn distance based recommendation
:param datapath: filepath to the csv file, a string is expected
:param dataset_resources: filepath to the resource file
:param ref_user: the user for which resources are to be recommended
:param num_neighbours: number of neighbours parameter for knn implementation
:param num_recommendation: number of recommendations desired (further filtered on zero ratings)
:param outlier_detection_method: choices available - percentile(default), zscore , iqr
:return: a json file with resource recommendation
"""
Examples
- Below is an execution of the function with all parameters provided
from DA4RDM_RecSys_UserBased import get_recommendation
get_recommendation.get_recommendations("14-08-2022.csv", "tomography.csv", "e2b383da-36d8-4825-8c6a-642af20f0412", 3, 3, "percentile")
- Below is an execution of the function with only required parameters provided
from DA4RDM_RecSys_UserBased import get_recommendation
get_recommendation.get_recommendations("14-08-2022.csv", "tomography.csv", "0f0b39a0-2b60-446e-8eb4-89cc164c7bc3")
Output
All the above computation outputs a json file that contains the dictionary of the recommended resources as shown below:
{"Recommendations": {"Ref_User_ID": "0f0b39a0-2b60-446e-8eb4-89cc164c7bc3", "Recommendation": [["fd7b5eff-de1b-4149-8eb2-c09349dc180a", 0.25779062933941843], ["ebbc5007-7cb6-44cf-8631-d23eaa675e6f", 0.02271623947631261], ["c9ad0d65-545a-4081-9eb7-bcca97b9fa9d", 0.02268728733672115]]}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for DA4RDM-RecSys-ContentBased-1.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c34cd31f9b2c2deae9600f35208229ba3da7ebfe670617f9441c82c54f108ff |
|
MD5 | f9ee38bf2c6bc50ff90eb0fccf485dbf |
|
BLAKE2b-256 | c33b838b5890be90a5f0bc68d3b9d247e09ca781dd6e6736327a18344e0db988 |
Hashes for DA4RDM_RecSys_ContentBased-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e3ae0c225ebfe3ff80c4f51566769acb6b97a70e4c386d9e766597927f73e92 |
|
MD5 | cb89f50737f98e31327ecdd6ba97721b |
|
BLAKE2b-256 | 6510cafe397eccec552178bce29d49cf2ed67ed68405fb9537c4de3a58f5cad3 |