QuestionQ134

VerifiedPreparing and using data for analysis

You are preparing data that your machine learning team will use to train a model with BigQueryML. They want to predict the price per square foot of real estate. The training data contains a price column and a column for the number of square feet. Another feature column, feature1, has null values because of missing data. You want to replace the nulls with zeros so that more data points are retained. Which query should you use?

Explanation

The training data must include a price_per_sqft value calculated as price / square_feet and a non-null version of feature1 that uses IFNULL(feature1, 0). Excluding the original input columns before adding these derived columns prevents duplicate or uncleaned versions from remaining in the output. WHERE feature1 IS NOT NULL would discard records rather than retain them.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!