vega-lite-api

vl.regression(regression)

Fit regression models to smooth and predict values.

regression Method Overview

regression API Reference

# regression.as(…value)

The output field names for the smoothed points generated by the regression transform.

Default value: The field names of the input x and y values.

# regression.extent(…value)

A [min, max] domain over the independent (x) field for the starting and ending points of the generated trend line.

# regression.groupby(…value)

The data fields to group by. If not specified, a single group containing all data objects will be used.

# regression.method(value)

The functional form of the regression model. One of "linear", "log", "exp", "pow", "quad", or "poly".

Default value: "linear"

# regression.on(value)

The data field of the independent variable to use a predictor.

# regression.order(value)

The polynomial order (number of coefficients) for the ‘poly’ method.

Default value: 3

# regression.params(value)

A boolean flag indicating if the transform should return the regression model parameters (one object per group), rather than trend line points. The resulting objects include a coef array of fitted coefficient values (starting with the intercept term and then including terms of increasing order) and an rSquared value (indicating the total variance explained by the model).

Default value: false

# regression.regression(value)

The data field of the dependent variable to predict.