-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlamda_mart_Run_time.py
438 lines (378 loc) · 22.1 KB
/
lamda_mart_Run_time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
from RankingHelper import *
import os
import shutil
from ranking import prepareKFoldForLamdaMart
from ranking import prepareKFoldForSVM
from ranking import backAllPredictionsInOneFileStraight
from Data_Preparation_For_Learning import compute_Kendall_New_Experiment_Setup
from RankingHelper import createSortedRankAndRunR
from Data_Preparation_For_Learning import Prepare_Training_Testing_Data_New_Experiment_Setup,compute_Kendall_SubCat_Experiment_Setup_Yelp,compute_Kendall_SubCat_Experiment_Setup_Amazon
from Data_Preparation_For_Learning import compute_Kendall_SubCat_Experiment_Setup,compute_Kendall_SubCat_Experiment_Setup_TQRank_Amazon,Prepare_Training_Testing_Data_Sub_Cat_Experiment_Setup_Yelp,compute_Kendall_SubCat_Experiment_Setup_TQRank_Yelp
from Data_Preparation_For_Learning import Prepare_Training_Testing_Data_Sub_Cat_Experiment_Setup_Amazon,Adjust_Training_Testing_Data_Per_Cat_From_All_Cat_Data_Amazon
from Data_Preparation_For_Learning import compute_Kendall_SubCat_Experiment_Setup_Per_Cat_Amazon,Adjust_Training_Testing_Data_Per_Cat_From_All_Cat_Data_Regression_Amazon
def runLamdamartLearning(lamda_directory,destCopyDirectory,testing):
shutil.copy2(
'C:\Yassien_RMIT PhD\Datasets\TruthDiscovery_Datasets\Web data Amazon reviews/Unique_Products_Stanford_three/Experiment 2/Lamda_Java/jforests-0.5.jar',
destCopyDirectory)
shutil.copy2(
'C:\Yassien_RMIT PhD\Datasets\TruthDiscovery_Datasets\Web data Amazon reviews/Unique_Products_Stanford_three/Experiment 2/Lamda_Java/ranking.properties',
destCopyDirectory)
shutil.copy2(
'C:\Yassien_RMIT PhD\Datasets\TruthDiscovery_Datasets\Web data Amazon reviews/Unique_Products_Stanford_three/Experiment 2/Lamda_Java/mslr-eval-score-mslr.pl',
destCopyDirectory)
os.chdir(destCopyDirectory)
command = "java -jar jforests-0.5.jar --cmd=generate-bin --ranking --folder . --file train.txt --file valid.txt --file test.txt"
os.system(command)
command = "java -jar jforests-0.5.jar --cmd=train --ranking --config-file ranking.properties --train-file train.bin --validation-file valid.bin --output-model ensemble.txt"
os.system(command)
command = "java -jar jforests-0.5.jar --cmd=predict --ranking --model-file ensemble.txt --tree-type RegressionTree --test-file test.bin --output-file predictions.txt"
os.system(command)
command = "C:\Strawberry\perl/bin/perl.exe mslr-eval-score-mslr.pl test.txt predictions.txt results.txt 1"
os.system(command)
predicitonsFile = destCopyDirectory+"predictions.txt"
testFile = destCopyDirectory+"test.txt"
categoriesDirectory = "C:\Yassien_RMIT PhD\Datasets\TruthDiscovery_Datasets\Web data Amazon reviews/Unique_Products_Stanford_three\categories/"
destDirectory = destCopyDirectory+"prediction/"
try:
os.stat(destDirectory)
except:
os.mkdir(destDirectory)
transformPredictionsToComputed(testing, categoriesDirectory, destDirectory, predicitonsFile)
return
def Modify_Predictions_of_RankLib():
predictions = []
with open("predictions.txt", 'r') as filep:
for line in filep:
line = line.split('\t')
predictions.append(float(line[len(line)-1]))
filehandle = open("predictions.txt",'w')
for pred in predictions:
filehandle.write(str(pred)+"\n")
filehandle.close()
return
def runLamdamartLearning_Rank_Lib(lamda_directory,destCopyDirectory,ranker,max_num_prods,opt_fn):
print("Running "+str(ranker))
shutil.copy2(lamda_directory + 'RankLib.jar',destCopyDirectory)
shutil.copy2(lamda_directory + 'mslr-eval-score-mslr.pl',destCopyDirectory)
os.chdir(destCopyDirectory)
#if ranker == 6:
# command = "java -jar RankLib.jar -train train.txt -ranker "+str(ranker)+" -metric2t KTau@"+max_num_prods+" -test test.txt -validate valid.txt -save model.txt -tree 1000 -shrinkage 0.1 -leaf 7"
#else:
command = "java -jar RankLib.jar -train train.txt -ranker " + str(ranker) + " -metric2t "+opt_fn+"@" + max_num_prods + " -test test.txt -validate valid.txt -save model.txt"
print("command "+str(command))
os.system(command)
command = "java -jar RankLib.jar -rank test.txt -load model.txt -score predictions.txt"
os.system(command)
os.chdir(destCopyDirectory)
command = "C:\Strawberry\perl/bin/perl.exe mslr-eval-score-mslr.pl test.txt predictions.txt results.txt 1"
os.system(command)
Modify_Predictions_of_RankLib()#Just to make this prediciton file compatible with the way we read predictions
return
def runLamdamartLearningOnly(lamda_directory,destCopyDirectory,justTesting):
if justTesting != 1:
shutil.copy2(
lamda_directory+'jforests-0.5.jar',
destCopyDirectory)
shutil.copy2(
lamda_directory+'ranking.properties',
destCopyDirectory)
shutil.copy2(
lamda_directory+'mslr-eval-score-mslr.pl',
destCopyDirectory)
os.chdir(destCopyDirectory)
command = "java -jar jforests-0.5.jar --cmd=generate-bin --ranking --folder . --file train.txt --file valid.txt --file test.txt"
os.system(command)
command = "java -jar jforests-0.5.jar --cmd=train --ranking --config-file ranking.properties --train-file train.bin --validation-file valid.bin --output-model ensemble.txt"
os.system(command)
os.chdir(destCopyDirectory)
command = "java -jar jforests-0.5.jar --cmd=predict --ranking --model-file ensemble.txt --tree-type RegressionTree --test-file test.bin --output-file predictions.txt"
os.system(command)
command = "C:\Strawberry\perl/bin/perl.exe mslr-eval-score-mslr.pl test.txt predictions.txt results.txt 1"
os.system(command)
return
def runSVMRankOnly_Learning(learning_lib_directory,destCopyDirectory, c):
print("Learning to Rank using SVM")
os.chdir(destCopyDirectory)
shutil.copy2(
learning_lib_directory+'svm_rank_learn.exe',
destCopyDirectory)
shutil.copy2(
learning_lib_directory+'svm_rank_classify.exe',
destCopyDirectory)
shutil.copy2(
learning_lib_directory+'mslr-eval-score-mslr.pl',
destCopyDirectory)
# Svm_Rank Example
# Training
command = "svm_rank_learn.exe -c "
command += str(300)
command += " train.txt model.dat"
print(command)
os.system(command)
# Prediction
command = "svm_rank_classify.exe test.txt model.dat predictions.txt"
os.system(command)
command = "C:\Strawberry\perl/bin/perl.exe mslr-eval-score-mslr.pl test.txt predictions.txt results.txt 1"
os.system(command)
return
def runSVMRankOnly(learning_lib_directory,destCopyDirectory, ce, gamma, useCGamma=0):
print("Using SVM Light Regression")
os.chdir(destCopyDirectory)
shutil.copy2(
learning_lib_directory+'svm_learn.exe',
destCopyDirectory)
shutil.copy2(
learning_lib_directory+'svm_classify.exe',
destCopyDirectory)
shutil.copy2(
learning_lib_directory+'mslr-eval-score-mslr.pl',
destCopyDirectory)
# Svm_Rank Example
# Training
command = "svm_learn.exe -z r "
if useCGamma == 1:
command += "-c "
command += str(ce)
command += " -g "
command += str(gamma)
command += " train.txt model.dat"
print(command)
os.system(command)
# Prediction
command = "svm_classify.exe test.txt model.dat predictions.txt"
os.system(command)
command = "C:\Strawberry\perl/bin/perl.exe mslr-eval-score-mslr.pl test.txt predictions.txt results.txt 1"
os.system(command)
return
print("will start Lamdamart Learning to Rank")
#'''
AllTrainingSets = []
AllTestingSets = []
#AllTrainingSets, AllValidating, AllTestingSets = prepareKFoldForLamdaMart()
'''#AllTrainingSets, AllTestingSets = prepareKFoldForSVM()
for i in range(5):
print("Training Fold_" + str(i + 1))
destCopyDirectory = "C:\Yassien_RMIT PhD\Datasets\TruthDiscovery_Datasets\Web data Amazon reviews/Unique_Products_Stanford_three/Experiment 2/Lamda_Java/K_Fold/Set_" + str(i + 1) + "/"
runLamdamartLearning(destCopyDirectory,AllTestingSets[i])
'''
#AllTrainingSets.append(['Appliances', 'Arts, Crafts & Sewing', 'Camera & Photo', 'Electronics', 'Home Improvement', 'Jewelry', 'Office Products', 'Watches'])
#AllTestingSets.append(['Appliances', 'Arts, Crafts & Sewing', 'Camera & Photo', 'Electronics', 'Home Improvement', 'Jewelry', 'Office Products', 'Watches'])
#runLamdamartLearning(destCopyDirectory,AllTestingSets[0])
#'''
#'''
#cutoffs = [3, 5, 10, 20, 30, 40, 50, 60, 70, 100, 120, 150, 160, 180, 200, 220, 250, 280, 300, 350, 400,500,600]
cutoffs = [10]
def runLamadaMart_All_Categories_Old_Experiment_Setup(categoryList,base_learning_directory,learning_lib_directory,exp_type):
for category in categoryList:
for i in range(len(cutoffs)):
cutoff = "Cutoff_" + str(cutoffs[i]) # str((i + 1) * 10)
# cutoff = str(cutoffs[i])
print("Preparing data for " + str(cutoff))
numSets = 0
directory = destCopyDirectory = base_learning_directory + category + "/" + cutoff + "/"
for folder in os.listdir(directory):
setFilePath = directory + folder
if os.path.isdir(setFilePath):
numSets += 1
print("numSets " + str(numSets))
for i in range(numSets):
destCopyDirectory = base_learning_directory + category + "/" + cutoff + "/" + "Set_" + str(i + 1) + "/"
if exp_type == "svm":
runSVMRankOnly_Learning(learning_lib_directory, destCopyDirectory, 20)
elif exp_type == "lamda":
runLamdamartLearningOnly(learning_lib_directory, destCopyDirectory, 0)
elif exp_type == "regression":
runSVMRankOnly(destCopyDirectory, 0, 0, 0)
destCopyDirectory = base_learning_directory + category + "/" + cutoff + "/"
backAllPredictionsInOneFileStraight(destCopyDirectory)
predicitonsFile = destCopyDirectory + "AllPredictions.txt"
destDirectory = destCopyDirectory
categoriesDirectory="F:\Yassien_PhD\categories/"
transformPredictionsToComputedPerCategory(category, categoriesDirectory, destDirectory, predicitonsFile)
return
def runLamadaMart_All_Categories_New_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type):
for category in categoryList:
print("Processing "+category)
for i in range(len(cutoffs)):
cutoff = "Cutoff_" + str(cutoffs[i])
try:
os.stat(base_learning_directory + category + "/")
except:
os.mkdir(base_learning_directory + category + "/")
destCopyDirectory = base_learning_directory + category + "/" + cutoff + "/"
try:
os.stat(destCopyDirectory)
except:
os.mkdir(destCopyDirectory)
if exp_type == "svm":
runSVMRankOnly_Learning(learning_lib_directory, destCopyDirectory, 20, 0, 0)
elif exp_type == "lamda":
runLamdamartLearningOnly(learning_lib_directory, destCopyDirectory, 0)
elif exp_type == "regression":
runSVMRankOnly(destCopyDirectory, 0, 0, 0)
elif exp_type == "lamda_new":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6)
elif exp_type == "mart":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 0)
elif exp_type == "ranknet":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 1)
elif exp_type == "rankboost":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 2)
elif exp_type == "adarank":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 3)
elif exp_type == "randomforest":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 8)
return
def runLamadaMart_Per_Categories_Sub_Cat_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type,categoryList,dataset):
if dataset=="amazon":
max_num_prods_cat_file_path = "D:\Yassien_PhD\Experiment_5\Randomized_Queryset/max_num_prodc_per_cat.txt"
else:
max_num_prods_cat_file_path = "D:\Yassien_PhD\yelp_dataset_challenge_academic_dataset\Experiment_3\Randomized_Queryset/max_num_prodc_per_cat.txt"
cat_max_num_prod_dict = dict()
with open(max_num_prods_cat_file_path, 'r') as fp:
for line in fp:
row = line.split('\t')
cat_max_num_prod_dict[row[0]]=row[1].split('\n')[0]
for category_name in categoryList:
print("Learningn for "+category_name)
destCopyDirectory = base_learning_directory+category_name+"/"
if exp_type == "svm":
runSVMRankOnly_Learning(learning_lib_directory, destCopyDirectory, 20)
elif exp_type == "lamda":
runLamdamartLearningOnly(learning_lib_directory, destCopyDirectory, 0)
elif exp_type == "regression":
runSVMRankOnly(learning_lib_directory, destCopyDirectory, 0, 0, 0)
elif exp_type == "lamda_new":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6,cat_max_num_prod_dict[category_name])
elif exp_type == "mart":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 0,cat_max_num_prod_dict[category_name])
elif exp_type == "ranknet":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 1,cat_max_num_prod_dict[category_name])
elif exp_type == "rankboost":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 2,cat_max_num_prod_dict[category_name])
elif exp_type == "adarank":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 3,cat_max_num_prod_dict[category_name])
elif exp_type == "randomforest":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 8,cat_max_num_prod_dict[category_name])
return
def runLamadaMart_All_Categories_Sub_Cat_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type):
print("This module runs the learning algorithm "+exp_type)
max_num_docs_per_query = "10"
destCopyDirectory= base_learning_directory
if exp_type == "svm":
runSVMRankOnly_Learning(learning_lib_directory, destCopyDirectory, 20)
elif exp_type == "lamda":
runLamdamartLearningOnly(learning_lib_directory, destCopyDirectory, 0)
elif exp_type == "regression":
runSVMRankOnly(learning_lib_directory, destCopyDirectory, 0, 0, 0)
elif exp_type == "lamda_new":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6,max_num_docs_per_query,"NDCG")
elif exp_type == "ktau":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6, max_num_docs_per_query,"KTAU")
elif exp_type == "ktauk":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6, max_num_docs_per_query,"KTAUK")
elif exp_type == "sprk":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 6, max_num_docs_per_query,"SPRK")
elif exp_type == "mart":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 0,max_num_docs_per_query,"NDCG")
elif exp_type == "ranknet":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 1,max_num_docs_per_query,"ERR")
elif exp_type == "rankboost":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 2,max_num_docs_per_query,"ERR")
elif exp_type == "adarank":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 3,max_num_docs_per_query,"ERR")
elif exp_type == "randomforest":
runLamdamartLearning_Rank_Lib(learning_lib_directory, destCopyDirectory, 8,max_num_docs_per_query,"ERR")
return
def compute_Kendall_Old_Experiment_Setup(categoriesList,orig_catNames,base_learning_directory,dataset_type,rename):
for i in range(len(categoriesList)):
categoryName = categoriesList[i]
orig_CatName = orig_catNames[i]
original_directory = base_learning_directory + orig_CatName + "/"
new_directory = base_learning_directory + categoryName + "/"
if dataset_type == "amazon" and rename == 1:
print("Will Rename folder")
os.chmod(original_directory, 0o777)
os.rename(original_directory, new_directory)
print("Renamed the folder")
categoryMainDirectory = base_learning_directory + categoryName + "/"
#This one was used when we were doing clustering or anyother sort of change that will change the order so we change the order of the sales rank for correct comparison
#salesRankDirectory = "f:\Yassien_PhD\Experiment_4\categories_sales_rank/"
salesRankDirectory ="F:\Yassien_PhD\categories/"
R_path = "C:\Program Files\R\R-3.2.2/bin/Rscript.exe" # RMIT
# R_path ="C:\Program Files\R\R-3.3.2/bin/Rscript.exe" #Laptop
createSortedRankAndRunR(categoryMainDirectory, "Lamda", categoryName, orig_CatName, dataset_type,salesRankDirectory, R_path)
if dataset_type == "amazon" and rename == 1:
os.chmod(new_directory, 0o777)
os.rename(new_directory, original_directory)
print("Returned the folder back to original name")
return
def Delete_Files_From_Old_Run(base_learning_directory):
print("Deleting old files from previous run")
lst = os.listdir(base_learning_directory)
lst = natsorted(lst)
for folder in lst:
folder_path = base_learning_directory+folder
print("Deleteing " + folder_path)
if os.path.isfile(folder_path):
os.remove(folder_path)
else:
shutil.rmtree(folder_path)
return
#*******************************Yelp Dataset
#categoryList = ["Mexican", "Cafes", "Chinese", "Thai", "American (Traditional)", "Italian", "American (New)", "Japanese", "Bars"]
#base_learning_directory ="F:\Yassien_PhD\yelp_dataset_challenge_academic_dataset\AVG_Predictions/"
#categoriesDirectory = "F:\Yassien_PhD\yelp_dataset_challenge_academic_dataset\Resturants_Categories/"
#*******************************Amazon Dataset
#Prepare the data for the new experiemnt setup
drive = "d:/"
amazon_base_learning_directory = "\Yassien_PhD\Experiment_6\Train_Test_Category_TQ_Target_Sub_Cat_Setup/"
yelp_base_learning_directory = "\Yassien_PhD\yelp_dataset_challenge_academic_dataset\Experiment_3\Train_Test_Category_With_Time_Interval_TQ_Target_Sub_Cat_Setup/"
base_learning_directory = drive+ amazon_base_learning_directory
dataset_type="amazon"
#Deleting old files and folder from main learning directory from previous run''Comment
#Delete_Files_From_Old_Run(base_learning_directory)
#Preparing the training and tesitng data ''Comment
#Prepare_Training_Testing_Data_New_Experiment_Setup(5,drive)
#Prepare_Training_Testing_Data_Sub_Cat_Experiment_Setup(drive)
#Prepare_Training_Testing_Data_Sub_Cat_Experiment_Setup_Yelp(drive)
#Prepare_Training_Testing_Data_Sub_Cat_Experiment_Setup_Amazon(drive)
#Adjust_Training_Testing_Data_Per_Cat_From_All_Cat_Data_Amazon(drive)
#Adjust_Training_Testing_Data_Per_Cat_From_All_Cat_Data_Regression_Amazon(drive)
###########
amazon_categoryList = ["Industrial & Scientific", "Jewelry", "Arts, Crafts & Sewing", "Toys & Games", "Video Games","Computers & Accessories", "Software", "Cell Phones & Accessories", "Electronics"]
yelp_categoryList = ["Cafes", "Chinese","Mexican" , "Italian","American (Traditional)", "Thai", "Bars", "Japanese", "American (New)"]
categoryList=amazon_categoryList
#categoriesDirectory = drive+"Yassien_PhD\Experiment_4\categories_sales_rank/" #This one is for new setup
learning_lib_directory =drive+"Yassien_PhD\Experiment 2\Lamda_Java/"#
#learning_lib_directory =drive+"Yassien_PhD\Experiment 2\SVM_Light\svm_light_windows64/"
#learning_lib_directory =drive+"Yassien_PhD\Experiment 2\Svm_Test/"
exp_type ="lamda_new"
#Running the learning algorithm on the prepared data
#'''
#runLamadaMart_All_Categories_Old_Experiment_Setup(categoryList,base_learning_directory,learning_lib_directory,exp_type)
#runLamadaMart_All_Categories_New_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type)
#runLamadaMart_All_Categories_Sub_Cat_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type)
#runLamadaMart_Per_Categories_Sub_Cat_Experiment_Setup(base_learning_directory,learning_lib_directory,exp_type,categoryList,dataset_type)
#'''
#'''
#*******************************Yelp Dataset
#categoriesList = ["Cafes", "Chinese","Mexican" , "Italian","American (Traditional)", "Thai", "Bars", "Japanese", "American (New)"]
#orig_catNames = ["Cafes", "Chinese","Mexican" , "Italian","American (Traditional)", "Thai", "Bars", "Japanese", "American (New)"]
#*******************************Amazon Dataset
#categories_sales_rank=drive+"Yassien_PhD\Experiment_5\Categories_Ranked_by_Sales_Rank/"
#categories_with_testing_indices=drive+"Yassien_PhD\Experiment_5\Categories/"
#categoriesList = ["Arts","Industrial", "Jewelry", "Toys", "Computers", "Video Games", "Electronics","Software", "Cell Phones"]
#orig_catNames = ["Arts, Crafts & Sewing","Industrial & Scientific", "Jewelry", "Toys & Games","Computers & Accessories", "Video Games", "Electronics", "Software", "Cell Phones & Accessories"]
rename=1
#query_size = 100
#R_path = "C:\Program Files\R\R-3.2.2/bin/Rscript.exe" # RMIT
R_path ="C:\Program Files\R\R-3.3.2/bin/Rscript.exe" #Laptop
#Running the algorithm to compute kendall tau on the predicted products
#compute_Kendall_Old_Experiment_Setup(categoriesList,orig_catNames,base_learning_directory,dataset_type,rename)
#compute_Kendall_New_Experiment_Setup(base_learning_directory,categories_sales_rank,categories_with_testing_indices,"LamdaMart",R_path)
#compute_Kendall_SubCat_Experiment_Setup_Amazon(base_learning_directory,drive,R_path,-1)
#compute_Kendall_SubCat_Experiment_Setup_TQRank_Yelp(base_learning_directory,drive,R_path,-1)
#compute_Kendall_SubCat_Experiment_Setup_Per_Cat_Amazon(base_learning_directory,drive,R_path,-1)
#'''
print("done")