MCPcopy Index your code
hub / github.com/apachecn/ailearning / modelLeaf

Function modelLeaf

src/python/9.RegTrees/regTrees.py:252–262  ·  view source on GitHub ↗

Desc: 当数据不再需要切分的时候,生成叶节点的模型。 Args: dataSet -- 输入数据集 Returns: 调用 linearSolve 函数,返回得到的 回归系数ws

(dataSet)

Source from the content-addressed store, hash-verified

250# 得到模型的ws系数:f(x) = x0 + x1*featrue1+ x3*featrue2 ...
251# create linear model and return coeficients
252def 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# 计算线性模型的误差值

Callers

nothing calls this directly

Calls 1

linearSolveFunction · 0.85

Tested by

no test coverage detected