MCPcopy Index your code
hub / github.com/Dod-o/Statistical-Learning-Method_Code / predict

Function predict

AdaBoost/AdaBoost.py:199–214  ·  view source on GitHub ↗

输出单独层预测结果 :param x: 预测样本 :param div: 划分点 :param rule: 划分规则 :param feature: 进行操作的特征 :return:

(x, div, rule, feature)

Source from the content-addressed store, hash-verified

197 return tree
198
199def predict(x, div, rule, feature):
200 '''
201 输出单独层预测结果
202 :param x: 预测样本
203 :param div: 划分点
204 :param rule: 划分规则
205 :param feature: 进行操作的特征
206 :return:
207 '''
208 #依据划分规则定义小于及大于划分点的标签
209 if rule == 'LisOne': L = 1; H = -1
210 else: L = -1; H = 1
211
212 #判断预测结果
213 if x[feature] < div: return L
214 else: return H
215
216def model_test(testDataList, testLabelList, tree):
217 ''&#x27;

Callers 1

model_testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected