10a3aff02e633faa4f546bfc482e746f2f0d6b7f,Rewards/Reward.py,Reward,getOptimalReward,#Reward#Any#Any#Any#,15

Before Change


		return total/k

	def getOptimalReward(self, user, articlePool, exclude = []):		
		maxReward = float("-inf")
		maxx = None
		for x in articlePool:	 
			reward = self.getReward(user, x)
			if reward > maxReward and x not in exclude:

After Change


		return total/k

	def getOptimalReward(self, user, articlePool, exclude = []):
		art_features = np.empty([len(articlePool), len(articlePool[0].featureVector)])
		for i in range(len(articlePool)):
			art_features[i, :] = articlePool[i].featureVector
		user_features = self.get_user_features(user)
		reward_matrix = np.dot(art_features, user_features)
		pool_position = np.argmax(reward_matrix)
		return reward_matrix[pool_position], articlePool[pool_position]

 //    ////// Broadcasting Here //////////////
	// def getOptimalReward(self, user, articlePool, exclude = []):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: huazhengwang/BanditLib
Commit Name: 10a3aff02e633faa4f546bfc482e746f2f0d6b7f
Time: 2018-02-25
Author: bjw4ph@virginia.edu
File Name: Rewards/Reward.py
Class Name: Reward
Method Name: getOptimalReward


Project Name: DagnyT/hardnet
Commit Name: 04cd555be76efc7baced753c751c4257d41eb75d
Time: 2017-07-27
Author: ducha.aiki@gmail.com
File Name: EvalMetrics.py
Class Name:
Method Name: ErrorRateAt95Recall


Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: ngram