Changeset 128:5e724235253b
- Timestamp:
- 06/21/07 08:51:50 (15 months ago)
- Author:
- Tarek Ziad?? <tarek@…>
- Message:
-
added db level
- Location:
- neighbors
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r126
|
r128
|
|
| | 1 | from neighbours import compute |
| | 2 | |
| | 3 | if __name__ == '__main__': |
| | 4 | compute() |
| | 5 | |
-
|
r126
|
r128
|
|
| 1 | | # http://aima.cs.berkeley.edu/python/learning.html |
| | 1 | |
| | 2 | # original code, http://aima.cs.berkeley.edu/python/learning.html |
| | 3 | # a bit arranged |
| 2 | 4 | |
| 3 | 5 | class DataSet(object): |
-
|
r126
|
r128
|
|
| 1 | 1 | import nearest |
| 2 | | |
| 3 | 2 | |
| 4 | 3 | class NearestByTag(object): |
| … |
… |
|
| 23 | 22 | |
| 24 | 23 | if current is None: |
| 25 | | raise Exception('user not found') |
| | 24 | raise Exception('user %s not found' % name) |
| 26 | 25 | |
| 27 | 26 | for user in self.db.examples: |