gradientDescent.py 文件源码

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

项目:MLBDailyProjections 作者: brendanahart 项目源码 文件源码
def mapFeatures(X):
    '''
    MAPFEATURE Feature mapping function to polynomial features
    MAPFEATURE(X1, X2) maps the two input features
    to quadratic features used in the regularization exercise.
    Returns a new feature array with more features, comprising of
    X1, X2, X1.^2, X2.^2, X1*X2, X1*X2.^2, etc..
    Inputs X1, X2 must be the same size

    :param X:
    :return: XTransform
    '''

    degree = 4

    poly = PolynomialFeatures(degree)
    XTransform = poly.fit_transform(X)

    return XTransform
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号