Desc: 当数据不再需要切分的时候,生成叶节点的模型。 Args: dataSet -- 输入数据集 Returns: 调用 linearSolve 函数,返回得到的 回归系数ws
(dataSet)
| 250 | # 得到模型的ws系数:f(x) = x0 + x1*featrue1+ x3*featrue2 ... |
| 251 | # create linear model and return coeficients |
| 252 | def modelLeaf(dataSet): |
| 253 | """ |
| 254 | Desc: |
| 255 | 当数据不再需要切分的时候,生成叶节点的模型。 |
| 256 | Args: |
| 257 | dataSet -- 输入数据集 |
| 258 | Returns: |
| 259 | 调用 linearSolve 函数,返回得到的 回归系数ws |
| 260 | """ |
| 261 | ws, X, Y = linearSolve(dataSet) |
| 262 | return ws |
| 263 | |
| 264 | |
| 265 | # 计算线性模型的误差值 |
nothing calls this directly
no test coverage detected