Starting from:

$34.99

CSE101 Lab 5 – Search and sort Finding love with Python Solution


Our database

Our database

1. Open the database

candidates_list = read_database('list_males.csv’) candidates_list = candidates_list[1:]
Just to remove the header
[['Douglas', 39, 183, 67],
['Austin', 29, 169, 45],
['Lee', 31, 173, 48], candidates_list[2]
['Cody', 27, 169, 45],
['Bryan', 37, 180, 65],
['Luis', 33, 176, 52],
['Carlos', 35, 178, 60],
['Alan', 38, 183, 67],
['Mario', 42, 188, 70],
['Juan', 32, 174, 52]]
2. The clients

Peter has a closer profile than Henry then he is a better match for Pamela
3. Euclidean distance

4. Compute the distance between the client and the candidates

You will implement this in
ComputeAllDistances()
→This function will return the list of distances between one client (Pamela or George) and a database.

5. Find the best match

Using the index returned by your function, display the name and characteristic of the best match for our client

By the way, you just implemented a naïve nearest neighbor search
6. Bonus
• •




! Terminology alert !
A unit test is a type of software testing technique that focuses on testing individual components or functions of a program in isolation to ensure they perform as expected. This helps developers identify and fix errors early in the development process.




Only work on the origin *.py file I am providing you!
Do not do that!!
Work only here
• Does it change the way I push my work on Github?
• Not at all, push and commit as before, follow Lab0 very carefully
• Why do we do unit test?
• What unit test does for me?
• It will directly tell you if you are code is right or wrong such that you can correct a function that you have not coded properly!

You will directly see which tests has been successful or failing


OR







Now you are ready to go if you want to test your code locally

Feedback via pull request


More products