ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 21 - Professional Machine Learning Engineer discussion

Report
Export

You are building a linear regression model on BigQuery ML to predict a customer's likelihood of purchasing your company's products. Your model uses a city name variable as a key predictive component. In order to train and serve the model, your data must be organized in columns. You want to prepare your data using the least amount of coding while maintaining the predictable variables. What should you do?

A.
Create a new view with BigQuery that does not include a column with city information
Answers
A.
Create a new view with BigQuery that does not include a column with city information
B.
Use Dataprep to transform the state column using a one-hot encoding method, and make each city a column with binary values.
Answers
B.
Use Dataprep to transform the state column using a one-hot encoding method, and make each city a column with binary values.
C.
Use Cloud Data Fusion to assign each city to a region labeled as 1, 2, 3, 4, or 5r and then use that number to represent the city in the model.
Answers
C.
Use Cloud Data Fusion to assign each city to a region labeled as 1, 2, 3, 4, or 5r and then use that number to represent the city in the model.
D.
Use TensorFlow to create a categorical variable with a vocabulary list Create the vocabulary file, and upload it as part of your model to BigQuery ML.
Answers
D.
Use TensorFlow to create a categorical variable with a vocabulary list Create the vocabulary file, and upload it as part of your model to BigQuery ML.
Suggested answer: B

Explanation:

One-hot encoding is a technique that converts categorical variables into numerical variables by creating dummy variables for each possible category.Each dummy variable has a value of 1 if the original variable belongs to that category, and 0 otherwise1.One-hot encoding can help linear regression models to capture the effect of different categories on the target variable without imposing any ordinal relationship among them2. Dataprep is a service that allows you to explore, clean, and transform your data for analysis and machine learning.You can use Dataprep to apply one-hot encoding to your city name variable and make each city a column with binary values3. This way, you can prepare your data using the least amount of coding while maintaining the predictive variables. Therefore, using Dataprep to transform the state column using a one-hot encoding method is the best option for this use case.

One Hot Encoding: A Beginner's Guide

One-Hot Encoding in Linear Regression Models

Dataprep documentation

asked 18/09/2024
niels valk
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first