Skip to main content

A package that recommends similar data collections based on the analysis of user-resource interaction patterns.

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 two optional arguments can also be passed namely the number of recommended resources that is expected as function output and the outlier method to use. The number of neighbours being used in the KNN Nearest neighbour algorithm by the recommender system is set to the value 3 based on preliminary analysis. The function body along with default parameter values is as shown below:

def get_recommendations(datapath, dataset_resources, ref_user, 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_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

  1. 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, "percentile")
  1. 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


Download files

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

Source Distribution

DA4RDM-RecSys-UserBased-1.0.11.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DA4RDM_RecSys_UserBased-1.0.11-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file DA4RDM-RecSys-UserBased-1.0.11.tar.gz.

File metadata

  • Download URL: DA4RDM-RecSys-UserBased-1.0.11.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for DA4RDM-RecSys-UserBased-1.0.11.tar.gz
Algorithm Hash digest
SHA256 1421cdfba841f67a0b7f8c167c4dc548023c1bbb04ade628108482341dfc1426
MD5 bc96ff516f71b1f16cfd66bedc8fb54c
BLAKE2b-256 d77d20bb2638a45efbf3b7dca83e33c9a957c3b4f008b0adeda07214b306acb0

See more details on using hashes here.

File details

Details for the file DA4RDM_RecSys_UserBased-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for DA4RDM_RecSys_UserBased-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 83d48c01a8cc24a99489b85043d21d2b77113a9b8225c853a22bed6efa42752a
MD5 3d93222d59ab0d8c4f323ab11c841d32
BLAKE2b-256 5da867a7df46659ab71c2c5e52d3a63be5c649a733ec991a7cf68ad8fc70ee37

See more details on using hashes here.

Supported by

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