biologyguy / Evopix

Pictures evolved
0 stars 0 forks source link

Similarity score #4

Closed biologyguy closed 10 years ago

biologyguy commented 10 years ago

Hey Jane, I've been thinking about the EVP structure a bit more, and how it will be used during breeding, mutation, and possibly fighting. We're going to need a way of calculating how similar two genomes are to one another for all of these things, so while you're working on the breeding function, I'm going to write a similarity_score function. The two are going to share a lot of features, so we can monitor each others' code for ideas. It should also give you more examples of how the evopic objects are used. -Steve

jhawkey commented 10 years ago

Just letting you know that I have seen this and checked out your similarity.py script. Looks good!

biologyguy commented 10 years ago

The function is written! Hazzah! It should be super easy to use:

import Evopic from Evopic
import similarity_score from similarity
bob = Evopic("Bob's evp file")
sue = Evopic("Sue's evp file")
sim_score = similarity_score(bob, sue)

The output is a float, between 0 and 1. Undoubtably the code can be refactored, and we may need to fiddle around with the weighting that the various path components contribute to the overall score, but it's totally usable as is.