Skip to content

Commit

Permalink
fix caculate the MAPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedegs-dog committed Aug 15, 2024
1 parent 2edc6b6 commit 7055c51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/qor/SynthNetV1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def doScatterAndTopKRanking(batchLen,batchSize,batchData,dumpDir,trainMode):
accuracyFileWriter.write(endDelim)
desDF1.to_csv(osp.join(dumpDir,"desDF1_"+trainMode+"_"+d+".csv"),index=False)
desDF2.to_csv(osp.join(dumpDir,"desDF2_"+trainMode+"_"+d+".csv"),index=False)
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list()designDF.prediction.to_list())
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list(),designDF.prediction.to_list())
print("MAPE ("+d+"): "+str(mapeScore))
accuracyFileWriter.close()

Expand Down
2 changes: 1 addition & 1 deletion models/qor/SynthNetV2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def doScatterAndTopKRanking(batchLen,batchSize,batchData,dumpDir,trainMode):
accuracyFileWriter.write(endDelim)
desDF1.to_csv(osp.join(dumpDir,"desDF1_"+trainMode+"_"+d+".csv"),index=False)
desDF2.to_csv(osp.join(dumpDir,"desDF2_"+trainMode+"_"+d+".csv"),index=False)
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list()designDF.prediction.to_list())
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list(),designDF.prediction.to_list())
print("MAPE ("+d+"): "+str(mapeScore))
accuracyFileWriter.close()

Expand Down
2 changes: 1 addition & 1 deletion models/qor/SynthNetV3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def doScatterAndTopKRanking(batchLen,batchSize,batchData,dumpDir,trainMode):
accuracyFileWriter.write(endDelim)
desDF1.to_csv(osp.join(dumpDir,"desDF1_"+trainMode+"_"+d+".csv"),index=False)
desDF2.to_csv(osp.join(dumpDir,"desDF2_"+trainMode+"_"+d+".csv"),index=False)
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list()designDF.prediction.to_list())
mapeScore = mean_absolute_percentage_error(designDF.actual.to_list(),designDF.prediction.to_list())
print("MAPE ("+d+"): "+str(mapeScore))
accuracyFileWriter.close()

Expand Down

0 comments on commit 7055c51

Please sign in to comment.