从头开始在python中进行多项式回归

时间:2019-10-14 18:10:29

标签: python regression

我正在进行多项式回归:

"dueDate": "{{json_encode(date(\"MM/dd/yyyy\")) }})"

  JtwigTemplate template = JtwigTemplate.classpathTemplate(payloadFile, configuration);
        JtwigModel model = JtwigModel.newModel(payLoad);
        return template.render(model);

and this is how I build configuration object

 configuration = EnvironmentConfigurationBuilder
                .configuration()
                .extensions()
                .add(new JsonExtension(JsonMapperProviderConfigurationBuilder
                        .jsonConfiguration()
                        .build())
                )
                .and()
                .build();

我知道这个概念,但是我不明白他们为什么要这样做,请有人可以解释。

1 个答案:

答案 0 :(得分:0)

这段代码只是在说

y=a_n*x^n + a_(n-1)*x^(n-1) +...+ a_1*x^(1)

尽管我不确定为什么不包括指数= 0。

编辑:OP应该包含更多代码(并且作为问题正文中的文本,而不是图像)。 无论如何,原始代码是:

line = coeff[0]
for i in np.arange(1, len(coeff)):
    line += coeff[i] * x_pts ** i

所以我们可以看到line被初始化为coeff [0],它实际上是一个常数而不是一个系数。