MCPcopy Create free account
hub / github.com/Giyn/DataMiningVisualizationSystem / accuracy_score

Function accuracy_score

model_assessment/divide_data.py:33–38  ·  view source on GitHub ↗
(y_true, y_predict)

Source from the content-addressed store, hash-verified

31 :return:
32 """
33 def accuracy_score(y_true, y_predict): # 计算准确率
34
35 if(isReg) :
36 return np.sqrt(np.sum(np.power(y_true - y_predict, 2.0)) / len(y_true))
37 else :
38 return np.sum(y_true == y_predict) / len(y_true)
39 all = np.random.permutation(len(X)) #打乱索引
40 size = len(X) // n
41 # 根据n把数据分成n部分

Callers 1

cross_validationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected