altair.RegressionTransform#

altair.RegressionTransform(on=Undefined, regression=Undefined, extent=Undefined, groupby=Undefined, method=Undefined, order=Undefined, params=Undefined, **kwds)#

RegressionTransform 模式封装器。

参数:
onstr, FieldName

要用作预测变量的自变量数据字段。

regressionstr, FieldName

要预测的因变量数据字段。

extentSequence[float]

生成的趋势线的起点和终点,它们是自变量 (x) 字段上的 [min, max] 域。

groupbySequence[str, FieldName]

用于分组的数据字段。如果未指定,则将使用包含所有数据对象的单个组。

methodLiteral[‘linear’, ‘log’, ‘exp’, ‘pow’, ‘quad’, ‘poly’]

回归模型的函数形式。可以是 "linear", "log", "exp", "pow", "quad""poly" 中的一个。

默认值: "linear"

orderfloat

对于 'poly' 方法的多项式阶数(系数个数)。

默认值: 3

paramsbool

一个布尔标志,指示转换是应返回回归模型参数(每组一个对象),还是返回趋势线点。结果对象包括拟合系数值的 coef 数组(从截距项开始,然后包含阶数递增的项)以及 rSquared 值(表示模型解释的总方差)。

默认值: false

asSequence[str, FieldName]

回归转换生成的平滑点的输出字段名称。

默认值: 输入 x 和 y 值的字段名称。

__init__(on=Undefined, regression=Undefined, extent=Undefined, groupby=Undefined, method=Undefined, order=Undefined, params=Undefined, **kwds)#

方法

__init__([on, regression, extent, groupby, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构造类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象的模式或根模式上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

to_json([validate, indent, sort_keys, ...])

将此对象的 JSON 表示作为字符串发出。

validate(instance[, schema])

在根模式上下文中根据类模式验证实例。

validate_property(name, value[, schema])

在根模式上下文中根据属性模式验证属性。