def compute_user_vector_with_threshold(array, threshold=3.5):
    """Compute a user profile by summing only vectors from items with a
    positive review.

    Item vectors with a rating above a set threshold are included, other
    vectors are discarded. The user profile is not normalized.

    Args:
    array (rdd object): an iterator over objects of the form
        (item, ((vector), (user, rating)))
    threshold (float, default 3.5): Cut off for a good rating score, ratings
        below this value are discarded.

    Returns:
        numpy array: user profile
    """
    vec = None
    for (item, ((vector), (user, rating))) in array:
        # Allow us to weight vectors by threshold
        if rating >= threshold:
            sign = 1
        else:
            sign = 0
        # Add the vector to the user's profile
        if vec is not None:
            vec += sign * vector
        else:
            vec = sign * vector
    return vec