bayesian_regression.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:stock 作者: dmegbert 项目源码 文件源码
def find_parameters_w(X, Y):
    """Find the parameter values w for the model which best fits X and Y.

    Args:
        X: A 2-dimensional numpy array representing the independent variables
            in the linear regression model.
        Y: A numpy array of floats representing the dependent variables in the
            linear regression model.

    Returns:
        A tuple (w0, w1, w2, w3, w4) representing the parameter values w.
    """
    clf = linear_model.LinearRegression()
    clf.fit(X, Y)
    w0 = clf.intercept_
    w1, w2, w3, w4 = clf.coef_
    return w0, w1, w2, w3, w4
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号