Skip to content

Commit

Permalink
fixed matrix creation, now it respects the order of the features
Browse files Browse the repository at this point in the history
  • Loading branch information
akathorn committed May 15, 2014
1 parent 4d8f32f commit d6fe01f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions devmine/lib/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ def get_scores_matrix(db):
Score.score,
Score.did)

features = [f[0] for f in db.query(Feature).values(Feature.name)]
features = [f.name for f in
db.query(Feature).order_by(Feature.name).all()]

d = {}
u = {}
for (ulogin, fname, score, did) in scores:
if ulogin not in d:
d[ulogin] = [ 0 for _ in features ]
d[ulogin] = [0 for _ in features]
d[ulogin][features.index(fname)] = score
u[ulogin] = did

Expand Down

0 comments on commit d6fe01f

Please sign in to comment.