A data scientist uses the following SAS code: DATA scored; SET new_customers; ARRAY wts{5} w1-w5; pred = 0; DO i = 1 TO 5; pred + wts{i} * input{i}; END; DROP i; RUN; What is this DATA step implementing?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because this DATA step iterates over 5 weights (w1-w5) and 5 inputs, accumulating their products with pred + wts{i} * input{i}, which computes the dot product — the standard formula for applying a linear model's coefficients to new data. This is a manual implementation of scoring a linear regression or logistic regression model without calling a SAS procedure.
Full explanation below image
Full Explanation
B is correct because this DATA step iterates over 5 weights (w1-w5) and 5 inputs, accumulating their products with pred + wts{i} * input{i}, which computes the dot product — the standard formula for applying a linear model's coefficients to new data. This is a manual implementation of scoring a linear regression or logistic regression model without calling a SAS procedure. A (KNN) computes distances, not weighted sums of coefficients. C (random forest) would sum binary or probability predictions from many trees, not multiply weights by features. D (CV fold assignment) involves no such computation.