Skip to content

Commit

Permalink
update result
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Feb 21, 2017
1 parent 9b1747c commit a7616f0
Show file tree
Hide file tree
Showing 36 changed files with 40,766 additions and 68 deletions.
81 changes: 43 additions & 38 deletions GetResultFromLogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def GetAccuracyFromXgboost(filename, key):
lightgbm_speed_result = [GetTimeFromLightGBM('lightgbm/lightgbm_higgs_speed.log')
,GetTimeFromLightGBM('lightgbm/lightgbm_yahoo_speed.log')
,GetTimeFromLightGBM('lightgbm/lightgbm_msltr_speed.log')
,GetTimeFromLightGBM('lightgbm/lightgbm_dataexpo_speed.log')]
,GetTimeFromLightGBM('lightgbm/lightgbm_dataexpo_speed.log')
,GetTimeFromLightGBM('lightgbm/lightgbm_allstate_speed.log')]

lightgbm_higgs_accuracy = [GetAccuracyFromLightGBM('lightgbm/lightgbm_higgs_accuracy.log', "auc")]

Expand All @@ -44,14 +45,16 @@ def GetAccuracyFromXgboost(filename, key):
,GetAccuracyFromLightGBM('lightgbm/lightgbm_msltr_accuracy.log', "ndcg@5")
,GetAccuracyFromLightGBM('lightgbm/lightgbm_msltr_accuracy.log', "ndcg@10")]

lightgbm_expo_one_hot_accuracy = [GetAccuracyFromLightGBM('lightgbm/lightgbm_dataexpo_onehot_accuracy.log', "auc") ]

lightgbm_expo_accuracy = [GetAccuracyFromLightGBM('lightgbm/lightgbm_dataexpo_accuracy.log', "auc") ]

lightgbm_allstate_accuracy = [GetAccuracyFromLightGBM('lightgbm/lightgbm_allstate_accuracy.log', "auc") ]

xgboost_speed_result = [GetTimeFromXgboost('xgboost/xgboost_higgs_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_yahoo_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_msltr_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_dataexpo_onehot_speed.log')]
,GetTimeFromXgboost('xgboost/xgboost_dataexpo_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_allstate_speed.log')]

xgboost_higgs_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_higgs_accuracy.log', "auc")]

Expand All @@ -65,29 +68,16 @@ def GetAccuracyFromXgboost(filename, key):
,GetAccuracyFromXgboost('xgboost/xgboost_msltr_accuracy.log', "ndcg@5")
,GetAccuracyFromXgboost('xgboost/xgboost_msltr_accuracy.log', "ndcg@10")]

xgboost_expo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_dataexpo_onehot_accuracy.log', "auc")]

xgboost_approx_speed_result = [GetTimeFromXgboost('xgboost/xgboost_approx_higgs_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_approx_yahoo_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_approx_msltr_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_approx_dataexpo_onehot_speed.log')]
xgboost_expo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_dataexpo_accuracy.log', "auc")]

xgboost_approx_higgs_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_approx_higgs_accuracy.log', "auc")]
xgboost_allstate_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_allstate_accuracy.log', "auc")]

xgboost_approx_yahoo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_approx_yahoo_accuracy.log', "ndcg@1")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_yahoo_accuracy.log', "ndcg@3")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_yahoo_accuracy.log', "ndcg@5")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_yahoo_accuracy.log', "ndcg@10")]

xgboost_approx_msltr_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_approx_msltr_accuracy.log', "ndcg@1")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_msltr_accuracy.log', "ndcg@3")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_msltr_accuracy.log', "ndcg@5")
,GetAccuracyFromXgboost('xgboost/xgboost_approx_msltr_accuracy.log', "ndcg@10")]

xgboost_hist_speed_result = [GetTimeFromXgboost('xgboost/xgboost_hist_higgs_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_hist_yahoo_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_hist_msltr_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_hist_dataexpo_onehot_speed.log')]
,GetTimeFromXgboost('xgboost/xgboost_hist_dataexpo_speed.log')
,GetTimeFromXgboost('xgboost/xgboost_hist_allstate_speed.log')]

xgboost_hist_higgs_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_hist_higgs_accuracy.log', "auc")]

Expand All @@ -102,15 +92,16 @@ def GetAccuracyFromXgboost(filename, key):
,GetAccuracyFromXgboost('xgboost/xgboost_hist_msltr_accuracy.log', "ndcg@10")]


xgboost_hist_expo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_hist_dataexpo_onehot_accuracy.log', "auc")]
xgboost_hist_expo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_hist_dataexpo_accuracy.log', "auc")]

xgboost_hist_allstate_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_hist_allstate_accuracy.log', "auc")]

xgboost_approx_expo_accuracy = [GetAccuracyFromXgboost('xgboost/xgboost_approx_dataexpo_onehot_accuracy.log', "auc")]
output = open("result.md", "w")
output.write("Speed:\n\n")
Title = ["Higgs", "Yahoo LTR", "MS LTR", "Expo"]
speed_result = [xgboost_speed_result, xgboost_approx_speed_result, xgboost_hist_speed_result, lightgbm_speed_result]
output.write('| Data | xgboost| xgboost_approx | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----- | ----|\n')
Title = ["Higgs", "Yahoo LTR", "MS LTR", "Expo", "Allstate"]
speed_result = [xgboost_speed_result, xgboost_hist_speed_result, lightgbm_speed_result]
output.write('| Data | xgboost | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ----- | ----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
Expand All @@ -121,9 +112,9 @@ def GetAccuracyFromXgboost(filename, key):

output.write("Higgs's AUC:\n\n")
Title = ["AUC"]
speed_result = [xgboost_higgs_accuracy, xgboost_approx_higgs_accuracy, xgboost_hist_higgs_accuracy, lightgbm_higgs_accuracy]
output.write('| Metric | xgboost| xgboost_approx | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----- | ----|\n')
speed_result = [xgboost_higgs_accuracy, xgboost_hist_higgs_accuracy, lightgbm_higgs_accuracy]
output.write('| Metric | xgboost| xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
Expand All @@ -134,9 +125,9 @@ def GetAccuracyFromXgboost(filename, key):

output.write("ndcg at Yahoo LTR:\n\n")
Title = ["ndcg@1","ndcg@3","ndcg@5","ndcg@10"]
speed_result = [xgboost_yahoo_accuracy, xgboost_approx_yahoo_accuracy, xgboost_hist_yahoo_accuracy, lightgbm_yahoo_accuracy]
output.write('| Metric | xgboost| xgboost_approx | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----- | ----|\n')
speed_result = [xgboost_yahoo_accuracy, xgboost_hist_yahoo_accuracy, lightgbm_yahoo_accuracy]
output.write('| Metric | xgboost | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
Expand All @@ -148,9 +139,9 @@ def GetAccuracyFromXgboost(filename, key):

output.write("ndcg at MS LTR:\n\n")
Title = ["ndcg@1","ndcg@3","ndcg@5","ndcg@10"]
speed_result = [xgboost_msltr_accuracy, xgboost_approx_msltr_accuracy, xgboost_hist_msltr_accuracy, lightgbm_msltr_accuracy]
output.write('| Metric | xgboost| xgboost_approx | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----- | ----|\n')
speed_result = [xgboost_msltr_accuracy, xgboost_hist_msltr_accuracy, lightgbm_msltr_accuracy]
output.write('| Metric | xgboost | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | -----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
Expand All @@ -161,9 +152,23 @@ def GetAccuracyFromXgboost(filename, key):

output.write("auc at Expo:\n\n")
Title = ["auc"]
speed_result = [xgboost_expo_accuracy, xgboost_approx_expo_accuracy, xgboost_hist_expo_accuracy ,lightgbm_expo_accuracy]
output.write('| Metric | xgboost| xgboost_approx | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----- | ----|\n')
speed_result = [xgboost_expo_accuracy, xgboost_hist_expo_accuracy ,lightgbm_expo_accuracy]
output.write('| Metric | xgboost | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
output.write(str(speed_result[j][i]) + '|')
output.write('\n')

output.write('\n\n')


output.write("auc at Allstate:\n\n")
Title = ["auc"]
speed_result = [xgboost_allstate_accuracy, xgboost_hist_allstate_accuracy ,lightgbm_allstate_accuracy]
output.write('| Metric | xgboost | xgboost_hist | LightGBM|\n')
output.write('|----| ----| ---- | ----|\n')
for i in range(len(Title)):
output.write('| ' + Title[i] + '|')
for j in range(len(speed_result)):
Expand Down
Loading

0 comments on commit a7616f0

Please sign in to comment.