Specify a column to use as regressor in a model

Applies to: SQL Server 2019 and earlier Analysis Services Azure Analysis Services Fabric/Power BI Premium

Important

Data mining was deprecated in SQL Server 2017 Analysis Services and now discontinued in SQL Server 2022 Analysis Services. Documentation is not updated for deprecated and discontinued features. To learn more, see Analysis Services backward compatibility.

A linear regression model uses a formula that combines the inputs to fit the predictable attribute's value as closely as possible to an estimated regression line. The algorithm accepts only numeric input values and automatically detects the inputs that provide the best fit.

To include a column as a regressor, add the FORCE_REGRESSOR parameter to the model and specify the regressors. Use this parameter when an attribute is meaningful but its effect is too small for the model to detect, or when the formula must include the attribute.

Follow these steps to create a simple linear regression model with the sample data from the neural networks tutorial. This sample model isn't necessarily robust, but it demonstrates how to customize a linear regression model in Data Mining Designer.

How to create a simple linear regression model

  1. In SQL Server Data Tools, in Solution Explorer, expand Mining Structures.

  2. Open Call Center.dmm in the designer.

  3. On the Mining Model menu, select New Mining Model.

  4. For the algorithm, select Microsoft Linear Regression. For the name, type Call Center Regression.

  5. On the Mining Models tab, set the following column usage values. Set all other columns to Ignore.

    • FactCallCenterID: Key

    • ServiceGrade: PredictOnly

    • Total Operators: Input

    • AverageTimePerIssue: Input

  6. On the Mining Model menu, select Set Model Parameters.

  7. In the Value column for the FORCE_REGRESSOR parameter, enter the column names in brackets and separate them with commas:

    [Average Time Per Issue],[Total Operators]  
    

    Note

    The algorithm automatically detects the best regressors. Force a regressor only when the final formula must include a specific column.

  8. On the Mining Model menu, select Process Model.

    In the viewer, the model is represented a single node containing the regression formula. You can view the formula in the Mining Legend, or you can extract the coefficients for the formula by using queries.

See Also