rec_endpoint: Azure product recommendations endpoint class

Description Usage Format Methods Initialization Training See Also Examples

Description

Class representing the client endpoint to the product recommendations service.

Usage

1

Format

An R6 object of class rec_endpoint.

Methods

Initialization

The following arguments are used to initialize a new client endpoint:

Note that the name of the client endpoint for a product recommendations service is not the name that was supplied when deploying the service. Instead, it is a randomly generated unique string that starts with the service name. For example, if you deployed a service called "myrec", the name of the endpoint is "myrecusacvjwpk4raost".

Training

To train a new model, supply the following arguments to the train_model method:

For detailed information on these arguments see the API reference.

See Also

az_rec_service for the service itself, rec_model for an individual recommmendations model

API reference and SAR model description at the Product Recommendations API repo on GitHub

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 

# creating a recommendations service endpoint from an Azure resource
svc <- resgroup$get_rec_service("myrec")
rec_endp <- svc$get_rec_endpoint()

# creating the endpoint from scratch -- must supply admin, recommender and storage keys
rec_endp <- rec_endpoint$new("myrecusacvjwpk4raost",
    admin_key="key1", rec_key="key2", storage_key="key3")

# upload the Microsoft store data
data(ms_usage)
rec_endp$upload_data(ms_usage)

# train a recommender
rec_model <- rec_endp$train_model("model1", usage="ms_usage.csv", support_threshold=10,
    similarity="Jaccard", user_affinity=TRUE, user_to_items=TRUE,
    backfill=TRUE, include_seed_items=FALSE)

# list of trained models
rec_endp$sync_model_list()

# delete the trained model (will ask for confirmation)
rec_endp$delete_model("model1")


## End(Not run)

SAR documentation built on May 6, 2019, 1:02 a.m.