Skip to content

海底捞针官方题解round与fit_intercept #31

@0rzx

Description

@0rzx
  1. 生成均值图像用的是np.ndarray.astype(np.uint8),做的是向下取整。而题解中却用round四舍五入来解释

    averaged = np.mean(targets, axis=0).astype(np.uint8)

    https://github.com/ustclug/hackergame2019-writeups/blame/6fbe69e0666bdb9f16a375b6cfb5395aafcefd1c/official/2077_%E6%B5%B7%E5%BA%95%E6%8D%9E%E9%92%88/README.md#L20-L25

  2. 题目中拟合的形式是y=k0*x0+k1*x1+...+k49999*x49999,不存在偏置项b,那么用下面不带偏置项的回归器应该更科学一点

reg = linear_model.Lasso(alpha=1, positive=True, fit_intercept=False)

但是,实际效果却变差了很多,通不过官方给的测试。运行一个更弱的条件,发现有四张正确图片的系数是0

[x for x in choices if x not in np.argwhere(reg.coef_>0).reshape(-1)] # [4303, 24496, 36462, 39326]

这真是一个玄学题目😂

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions