Is there a Tutorial to use the API on a free dataset?

This tutorial provides an end-to-end walkthrough of the internal endpoints of the Crossing Minds API. Almost all Crossing Minds customers do not need to follow these steps. Instead it is more common to leverage a CDP integration, or share raw data files with your dedicated machine learning engineer.

Nevertheless, it is useful to read through these steps to get familiar with the internal concepts.

Setup

You can start by downloading the MovieLens dataset from the GroupLens Research Project at the University of Minnesota: ml-25m.zip

If the quality of the recommendations is not important at this point, prefer the smaller dataset: ml-small.zip

This tutorial is using our python client. Be sure you have the python package installed with:

Title
Copied to clipboard!
pip install xminds

Create a client and login to your account, and create a new database using the POST databases/ and POST login/individual/ endpoints:

Then we can create the item properties using the POST items-properties/ endpoint: the year, genres and tags.

We use unicode18 (U18 in numpy) for the property genres as all MovieLens genres are at most 18 characters. Similarly, we use unicode20 (U20 in numpy) for the property tags, as after cleaning of tags strings, we keep only the strings with at most 20 characters. See properties to find all supported types.


Parsing MovieLens Dataset

Before we can upload all the items with their tag information, we need to load, extract and clean the data. In the MovieLens dataset, some values like the year or genres need to be parsed from strings. This requires some cleanup steps we will perform using pandas (≥1.0.0).

Because we are using the python client, we can use the array-optimized format to represent tags and genres. This avoids building millions of python dict, and gives a significant speed-up from vectorized operations.

Parsing the Movie File

We start by loading the item file movies.csv, and extract year and genres data.


Parsing the Tag File

We then load the tags file tags.csv, apply simple cleaning on strings, and convert the movieId into index in the items array.


Parsing the Ratings File

We then load the user/item interactions file ratings.csv.


Uploading the Items and the Ratings

Get started with Crossing Minds recommendation API

Crossing Minds Recommendation API is the easiest way to integrate personalized recommendation to your website & mobile apps

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We use cookies (and other similar technologies) to collect data in order to improve our site. You have the option to opt-in or opt-out of certain cookie tracking technologies.To do so, click here.

Beam

API Documentation Center,
please wait a bit...