Returns the k most similar concepts from the given list.
(self, concept, concepts=[], k=3)
| 181 | return w / k |
| 182 | |
| 183 | def nearest_neighbors(self, concept, concepts=[], k=3): |
| 184 | """ Returns the k most similar concepts from the given list. |
| 185 | """ |
| 186 | return sorted(concepts, key=lambda candidate: self.similarity(concept, candidate, k), reverse=True) |
| 187 | |
| 188 | similar = neighbors = nn = nearest_neighbors |
| 189 |
nothing calls this directly
no test coverage detected