def preprocess_user_data(user_id, ratings_df):
    """
    Build a Surprise test set with book ids of the books 
    that have not been rated by a given user. 
    """
    rated_books = set(ratings_df.loc[ratings_df['user_id'] == user_id, 'book_id'])
    all_books = set(ratings_df['book_id'])
    books_unknown_rating = sorted(all_books - rated_books)

    # Create a test set for the user so that it can be used to predict unknown ratings
    user_testset = []
    for i in books_unknown_rating:
        # Some value should be passed as a true rating 
        # Here, 3.92 is used - mean rating (this value will not affect the prediction)
        user_testset.append((user_id, i, 3.92))
    
    return user_testset