Skip to content

Commit

Permalink
Merge pull request #15 from Jedges/master
Browse files Browse the repository at this point in the history
Fix caculate the MAPE
  • Loading branch information
animeshbchowdhury authored Aug 16, 2024
2 parents 936a3b6 + 7055c51 commit 82bead6
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.prediction.to_list(),designDF.actual.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.prediction.to_list(),designDF.actual.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.prediction.to_list(),designDF.actual.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 82bead6

Please sign in to comment.