test_class.declarator: trainOrderItems
test_class.modifier: private
test_class.original_string: private List<OrderItem> trainOrderItems;
test_class.type: List<OrderItem>
test_class.var_name: trainOrderItems
test_class.declarator: trainOrders
test_class.modifier: private
test_class.original_string: private List<Order> trainOrders;
test_class.type: List<Order>
test_class.var_name: trainOrders
test_class.declarator: allUsers
test_class.modifier: private
test_class.original_string: private List<User> allUsers;
test_class.type: List<User>
test_class.var_name: allUsers
test_class.declarator: recommendSingle
test_class.modifier: private
test_class.original_string: private List<OrderItem> recommendSingle;
test_class.type: List<OrderItem>
test_class.var_name: recommendSingle
test_class.declarator: recommendMulti
test_class.modifier: private
test_class.original_string: private List<OrderItem> recommendMulti;
test_class.type: List<OrderItem>
test_class.var_name: recommendMulti
test_class.declarator: algo
test_class.modifier: private
test_class.original_string: private AbstractRecommender algo;
test_class.type: AbstractRecommender
test_class.var_name: algo
test_class.file: services/tools.descartes.teastore.recommender/src/test/java/tools/descartes/teastore/recommender/algorithm/AbstractRecommenderTest.java
test_class.identifier: AbstractRecommenderTest
test_case.body: @Test
  	public void testResults() {
  		getAlgo().train(getTrainOrderItems(), getTrainOrders());
  		testSingleResults();
  		testMultiResults();
  	}
test_case.class_method_signature: AbstractRecommenderTest.testResults()
test_case.full_signature: @Test public void testResults()
test_case.identifier: testResults
test_case.invocations: train getAlgo getTrainOrderItems getTrainOrders testSingleResults testMultiResults
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testResults()
focal_class.declarator: trainingFinished = false
focal_class.modifier: private
focal_class.original_string: private boolean trainingFinished = false;
focal_class.type: boolean
focal_class.var_name: trainingFinished
focal_class.declarator: MAX_NUMBER_OF_RECOMMENDATIONS = 10
focal_class.modifier: public static final
focal_class.original_string: public static final int MAX_NUMBER_OF_RECOMMENDATIONS = 10;
focal_class.type: int
focal_class.var_name: MAX_NUMBER_OF_RECOMMENDATIONS
focal_class.declarator: LOG = LoggerFactory.getLogger(AbstractRecommender.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(AbstractRecommender.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: userBuyingMatrix
focal_class.modifier: private
focal_class.original_string: private Map<Long, Map<Long, Double>> userBuyingMatrix;
focal_class.type: Map<Long, Map<Long, Double>>
focal_class.var_name: userBuyingMatrix
focal_class.declarator: userItemSets
focal_class.modifier: private
focal_class.original_string: private Map<Long, Set<OrderItemSet>> userItemSets;
focal_class.type: Map<Long, Set<OrderItemSet>>
focal_class.var_name: userItemSets
focal_class.declarator: totalProducts
focal_class.modifier: private
focal_class.original_string: private Set<Long> totalProducts;
focal_class.type: Set<Long>
focal_class.var_name: totalProducts
focal_class.file: services/tools.descartes.teastore.recommender/src/main/java/tools/descartes/teastore/recommender/algorithm/AbstractRecommender.java
focal_class.identifier: AbstractRecommender
focal_class.interfaces: implements IRecommender
focal_class.class_method_signature: AbstractRecommender.train(List<OrderItem> orderItems, List<Order> orders)
focal_class.full_signature: @Override public void train(List<OrderItem> orderItems, List<Order> orders)
focal_class.identifier: train
focal_class.modifiers: @Override public
focal_class.parameters: (List<OrderItem> orderItems, List<Order> orders)
focal_class.return: void
focal_class.signature: void train(List<OrderItem> orderItems, List<Order> orders)
focal_class.class_method_signature: AbstractRecommender.executePreprocessing()
focal_class.full_signature: protected void executePreprocessing()
focal_class.identifier: executePreprocessing
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void executePreprocessing()
focal_class.class_method_signature: AbstractRecommender.recommendProducts(Long userid, List<OrderItem> currentItems)
focal_class.full_signature: @Override public List<Long> recommendProducts(Long userid, List<OrderItem> currentItems)
focal_class.identifier: recommendProducts
focal_class.modifiers: @Override public
focal_class.parameters: (Long userid, List<OrderItem> currentItems)
focal_class.return: List<Long>
focal_class.signature: List<Long> recommendProducts(Long userid, List<OrderItem> currentItems)
focal_class.class_method_signature: AbstractRecommender.filterRecommendations(Map<Long, Double> priorityList, List<Long> currentItems)
focal_class.full_signature: protected List<Long> filterRecommendations(Map<Long, Double> priorityList, List<Long> currentItems)
focal_class.identifier: filterRecommendations
focal_class.modifiers: protected
focal_class.parameters: (Map<Long, Double> priorityList, List<Long> currentItems)
focal_class.return: List<Long>
focal_class.signature: List<Long> filterRecommendations(Map<Long, Double> priorityList, List<Long> currentItems)
focal_class.class_method_signature: AbstractRecommender.createRanking(Map<Long, Double> map)
focal_class.full_signature: private TreeMap<Double, List<Long>> createRanking(Map<Long, Double> map)
focal_class.identifier: createRanking
focal_class.modifiers: private
focal_class.parameters: (Map<Long, Double> map)
focal_class.return: TreeMap<Double, List<Long>>
focal_class.signature: TreeMap<Double, List<Long>> createRanking(Map<Long, Double> map)
focal_class.class_method_signature: AbstractRecommender.execute(Long userid, List<Long> currentItems)
focal_class.full_signature: protected abstract List<Long> execute(Long userid, List<Long> currentItems)
focal_class.identifier: execute
focal_class.modifiers: protected abstract
focal_class.parameters: (Long userid, List<Long> currentItems)
focal_class.return: List<Long>
focal_class.signature: List<Long> execute(Long userid, List<Long> currentItems)
focal_class.class_method_signature: AbstractRecommender.findOrder(List<Order> orders, long orderid)
focal_class.full_signature: private Order findOrder(List<Order> orders, long orderid)
focal_class.identifier: findOrder
focal_class.modifiers: private
focal_class.parameters: (List<Order> orders, long orderid)
focal_class.return: Order
focal_class.signature: Order findOrder(List<Order> orders, long orderid)
focal_class.class_method_signature: AbstractRecommender.getUserBuyingMatrix()
focal_class.full_signature: public Map<Long, Map<Long, Double>> getUserBuyingMatrix()
focal_class.identifier: getUserBuyingMatrix
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<Long, Map<Long, Double>>
focal_class.signature: Map<Long, Map<Long, Double>> getUserBuyingMatrix()
focal_class.class_method_signature: AbstractRecommender.setUserBuyingMatrix(Map<Long, Map<Long, Double>> userBuyingMatrix)
focal_class.full_signature: public void setUserBuyingMatrix(Map<Long, Map<Long, Double>> userBuyingMatrix)
focal_class.identifier: setUserBuyingMatrix
focal_class.modifiers: public
focal_class.parameters: (Map<Long, Map<Long, Double>> userBuyingMatrix)
focal_class.return: void
focal_class.signature: void setUserBuyingMatrix(Map<Long, Map<Long, Double>> userBuyingMatrix)
focal_class.class_method_signature: AbstractRecommender.getTotalProducts()
focal_class.full_signature: public Set<Long> getTotalProducts()
focal_class.identifier: getTotalProducts
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<Long>
focal_class.signature: Set<Long> getTotalProducts()
focal_class.class_method_signature: AbstractRecommender.setTotalProducts(Set<Long> totalProducts)
focal_class.full_signature: public void setTotalProducts(Set<Long> totalProducts)
focal_class.identifier: setTotalProducts
focal_class.modifiers: public
focal_class.parameters: (Set<Long> totalProducts)
focal_class.return: void
focal_class.signature: void setTotalProducts(Set<Long> totalProducts)
focal_class.class_method_signature: AbstractRecommender.getUserItemSets()
focal_class.full_signature: public Map<Long, Set<OrderItemSet>> getUserItemSets()
focal_class.identifier: getUserItemSets
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<Long, Set<OrderItemSet>>
focal_class.signature: Map<Long, Set<OrderItemSet>> getUserItemSets()
focal_class.class_method_signature: AbstractRecommender.setUserItemSets(Map<Long, Set<OrderItemSet>> userItemSets)
focal_class.full_signature: public void setUserItemSets(Map<Long, Set<OrderItemSet>> userItemSets)
focal_class.identifier: setUserItemSets
focal_class.modifiers: public
focal_class.parameters: (Map<Long, Set<OrderItemSet>> userItemSets)
focal_class.return: void
focal_class.signature: void setUserItemSets(Map<Long, Set<OrderItemSet>> userItemSets)
focal_class.class_method_signature: AbstractRecommender.createUserBuyingMatrix(Map<Long, Set<OrderItemSet>> useritemsets)
focal_class.full_signature: private static Map<Long, Map<Long, Double>> createUserBuyingMatrix(Map<Long, Set<OrderItemSet>> useritemsets)
focal_class.identifier: createUserBuyingMatrix
focal_class.modifiers: private static
focal_class.parameters: (Map<Long, Set<OrderItemSet>> useritemsets)
focal_class.return: Map<Long, Map<Long, Double>>
focal_class.signature: Map<Long, Map<Long, Double>> createUserBuyingMatrix(Map<Long, Set<OrderItemSet>> useritemsets)
focal_method.body: @Override
  	public void train(List<OrderItem> orderItems, List<Order> orders) {
  		long tic = System.currentTimeMillis();
  		totalProducts = new HashSet<>();
  		// first create order mapping unorderized
  		Map<Long, OrderItemSet> unOrderizeditemSets = new HashMap<>();
  		for (OrderItem orderItem : orderItems) {
  			if (!unOrderizeditemSets.containsKey(orderItem.getOrderId())) {
  				unOrderizeditemSets.put(orderItem.getOrderId(), new OrderItemSet());
  				unOrderizeditemSets.get(orderItem.getOrderId()).setOrderId(orderItem.getOrderId());
  			}
  			unOrderizeditemSets.get(orderItem.getOrderId()).getOrderset().put(orderItem.getProductId(),
  					orderItem.getQuantity());
  			// see, if we already have our item
  			if (!totalProducts.contains(orderItem.getProductId())) {
  				// if not known yet -> add
  				totalProducts.add(orderItem.getProductId());
  			}
  		}
  		// now map each id with the corresponding order
  		Map<Order, OrderItemSet> itemSets = new HashMap<>();
  		for (Long orderid : unOrderizeditemSets.keySet()) {
  			Order realOrder = findOrder(orders, orderid);
  			itemSets.put(realOrder, unOrderizeditemSets.get(orderid));
  		}
  		userItemSets = new HashMap<>();
  		for (Order order : itemSets.keySet()) {
  			if (!userItemSets.containsKey(order.getUserId())) {
  				userItemSets.put(order.getUserId(), new HashSet<OrderItemSet>());
  			}
  			itemSets.get(order).setUserId(order.getUserId());
  			userItemSets.get(order.getUserId()).add(itemSets.get(order));
  		}
  		userBuyingMatrix = createUserBuyingMatrix(userItemSets);
  		executePreprocessing();
  		LOG.info("Training recommender finished. Training took: " + (System.currentTimeMillis() - tic) + "ms.");
  		trainingFinished = true;
  	}
focal_method.class_method_signature: AbstractRecommender.train(List<OrderItem> orderItems, List<Order> orders)
focal_method.full_signature: @Override public void train(List<OrderItem> orderItems, List<Order> orders)
focal_method.identifier: train
focal_method.invocations: currentTimeMillis containsKey getOrderId put getOrderId setOrderId get getOrderId getOrderId put getOrderset get getOrderId getProductId getQuantity contains getProductId add getProductId keySet findOrder put get keySet containsKey getUserId put getUserId setUserId get getUserId add get getUserId get createUserBuyingMatrix executePreprocessing info currentTimeMillis
focal_method.modifiers: @Override public
focal_method.parameters: (List<OrderItem> orderItems, List<Order> orders)
focal_method.return: void
focal_method.signature: void train(List<OrderItem> orderItems, List<Order> orders)