print("Time taken in millis:", timeTaken) # print("Product score:", productScore) # SPG timeTaken = int(round(time.time() * 1000)) selectedProdsSPG, productScore = SPG(k, C, SBS, EP_New, CP_New) timeTaken = int(round(time.time() * 1000)) - timeTaken print("Single Product Based Greedy Algorithm : \n", selectedProdsSPG) print("Time taken in millis:", timeTaken) # print("Product score:", productScore) # =================================KMEANS CLUSTERING===================================== timeTaken = int(round(time.time() * 1000)) EP_New, CP_New = KMeans.K_Means(data, SBS, C, EP, CP, bestSampledProds, n_clusters) timeTaken = int(round(time.time() * 1000)) - timeTaken print('Kmeans time:', timeTaken) print('AFTER KMEANS CLUSTERING:') # IG timeTaken = int(round(time.time() * 1000)) selectedProdsIG, productScore = IG(k, C, SBS, EP_New, CP_New) timeTaken = int(round(time.time() * 1000)) - timeTaken print("Incremental Based Greedy Algorithm : \n", selectedProdsIG) print("Time taken in millis:", timeTaken) # print("Product score:", productScore) # SPG timeTaken = int(round(time.time() * 1000)) selectedProdsSPG, productScore = SPG(k, C, SBS, EP_New, CP_New)
# SPG timeTaken = int(round(time.time() * 1000)) selectedProdsSPG, productScore = SPG(k, C, SBS, EP_New, CP_New) timeTaken = int(round(time.time() * 1000)) - timeTaken print("Single Product Based Greedy Algorithm : \n", selectedProdsSPG) print("Time taken in millis:", timeTaken) # print("Product score:", productScore) except: print("Error in Mean Shift") # =================================KMEANS CLUSTERING===================================== try: timeTaken = int(round(time.time() * 1000)) EP_New, CP_New = KMeans.K_Means(data, SBS, C, EP, CP, bestSampledProds, 10) timeTaken = int(round(time.time() * 1000)) - timeTaken print('Kmeans time:', timeTaken) print('AFTER KMEANS CLUSTERING:') # IG timeTaken = int(round(time.time() * 1000)) selectedProdsIG, productScore = IG(k, C, SBS, EP_New, CP_New) timeTaken = int(round(time.time() * 1000)) - timeTaken print("Incremental Based Greedy Algorithm : \n", selectedProdsIG) print("Time taken in millis:", timeTaken) # print("Product score:", productScore) # SPG timeTaken = int(round(time.time() * 1000)) selectedProdsSPG, productScore = SPG(k, C, SBS, EP_New, CP_New)