I am reading data from the text file which is in the following format.
1 1 5
1 3 3
1 5 4
2 1 5
2 4 3
3 1 2
3 3 4
3 4 3
3 5 4
The first column represents the coachId, the second column represents the playerId, and the last column represents the score given by each coach to each player. So now say there are 3 coaches and 5 players and the data we are given is not complete. We basically have to implement a recommender system and generate the missing scores for each player by each of the coaches. I have already done that part. So basically now I want to generate an output file to fill out the missing scores. Here is my logic.
data = np.loadtxt('player.txt')
coaches = data.T[0]
players = data.T[1]
scores = data.T[2]
a = 0
total = 3 * 5 #total fields to fill is num of player times num of coaches
while a < total:
b = 0
while b < 3: #for each coach
#check if score was given
# if score is given don't do anything
# if score is not given get new socre and write it to file
I feel like this approach might take a LONG time if i lots of coaches and players. IS there a better way to do this?