# Generative AI Certificate Q&A: What type of machine learning algorithm to recommend new movies based on what customers have already seen?

## Question

Your online movie-streaming business wants to create an artificial neural network that can recommend new movies based on what customers have already seen. The team creates a series of XY diagrams of different film genres. Then it puts the film rating along the X-axis and the duration that people watch on the Y-axis. It then makes a recommendation based on how close movies are to each other on the chart. What type of machine learning algorithm is the team using?

A. Naive Bayes
B. reinforcement learning
C. Q learning
D. K-nearest neighbor

D. K-nearest neighbor

## Explanation

The correct answer is D. K-nearest neighbor.

K-nearest neighbor (KNN) is a supervised learning algorithm that is used for classification and regression tasks. It is based on the idea that similar inputs have similar outputs, or that the input is likely to belong to the same class as its closest neighbors.

KNN does not have a specific model or function to learn from the data, but rather stores the entire training data and uses it as a reference. It does so by:

• Calculating the distance between the input and each of the training data points, using a metric such as Euclidean distance, Manhattan distance, or Hamming distance.
• Finding the K nearest neighbors of the input, or the K training data points that have the smallest distance to the input.
• Assigning the output to the input based on the majority vote of its neighbors for classification, or based on the average value of its neighbors for regression.

KNN is a simple and intuitive algorithm that can perform well on many problems, especially those involving low-dimensional or structured data. However, KNN also has some drawbacks, such as:

• It can be computationally expensive and slow, as it requires calculating the distance to all training data points for each input.
• It can be sensitive to noise, outliers, or irrelevant features, as they can affect the distance calculation and the neighbor selection.
• It can suffer from the curse of dimensionality, as the distance metric becomes less meaningful and reliable in high-dimensional spaces.

In this scenario, you work for an online movie-streaming business that wants to create an artificial neural network that can recommend new movies based on what customers have already seen. The team creates a series of XY diagrams of different film genres. Then it puts the film rating along the X-axis and the duration that people watch on the Y-axis. It then makes a recommendation based on how close movies are to each other on the chart.

You are using KNN for your network. This means that:

• You are using labeled data with human guidance to train your network. You have a dataset of movies labeled with their genres (such as action, comedy, drama, etc.) based on their features (such as rating and watch time).
• You are using KNN as your machine learning model. KNN is a type of machine learning model that stores the entire training data and uses it as a reference to classify or predict new inputs based on their similarity or proximity to their neighbors.
• You are using classification as your machine learning task. Classification is a type of supervised learning task where the output variable has two or more categories, such as movie genres. The goal is to assign each movie to one of these categories based on its features.

Therefore, you are using KNN for your network.

## Reference

The latest Generative AI Skills Initiative certificate program actual real practice exam question and answer (Q&A) dumps are available free, helpful to pass the Generative AI Skills Initiative certificate exam and earn Generative AI Skills Initiative certification.