University lab "Method of classification of k-nearest neighbors"
18 USD"Method of classification of k-nearest neighbors"
Purpose: In laboratory work it is necessary to classify Fisher's irises by the method of k-nearest neighbors. Data on iris flowers are used for classification. The target column corresponds to the type of flower (‘Species’).
The K-Nearest Neighbor (KNN) algorithm uses "feature similarity" to predict the values of new data points, which also means that a new data point will be assigned a value based on how closely it corresponds to points in the training set.
Task:
Select 2 column attributes for classification: length (‘PetalLengthCm’) and width (‘PetalWidthCm’) of the flower.
Next you need to select the value of k, i.e. the nearest data points. k can be any integer. (recommended k = 5).
Divide the sample into training (80%) and test (20%) randomly, because the data is organized.
For each point in the test data, do the following:
4.1 Calculate the distance between the object coordinate data and each row of training data using the Euclidean distance method (determine the length of the vector for each neighbor).
Example of calculation
math.sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2)

4.2. Based on the distance value, sort them in ascending order (choose any data sorting method).
4.3. You must select the top k rows from the sorted array.
4.4. Assign a class (iris type) to a checkpoint based on the most common class of these strings.

Figure 1. Example of one iteration of the algorithm
Figure 1 graphically shows one iteration of the algorithm. The test object is highlighted in gray, and the nearest neighbors are highlighted in green and red.
To check the correct operation of the algorithm, calculate the error. Evaluate the result of your classification with the original data.
+ 2 лаби
Client's review of cooperation with freelancer
University lab "Method of classification of k-nearest neighbors"Good work! Thank you for cooperation!
Freelancer's review of cooperation with Vladyslav Kaliuha
University lab "Method of classification of k-nearest neighbors"I recommend you to work together, it's all great.
![]()
Current freelance projects in the category Python
Development of software with AIIt is necessary to develop software for automatic detection, capturing, and tracking of an object using a video camera and a rotating mechanism.Output data: Video camera with optics. Rotating device on two axes (azimuth/elevation angle). Servomotors controlled via Modbus… AI & Machine Learning, Python ∙ 9 hours 41 minutes back ∙ 10 proposals |
Technical Specification for Refinement of AI Bot for Generating Personalized SongsTECHNICAL TASK FOR IMPROVING THE AI PERSONAL SONG GENERATOR BOTMAIN GOAL Create a stable premium product that: generates the highest quality personal songs; does not fabricate facts about the client; works stably under load; is easily scalable; allows for analysis and… Python, Bot Development ∙ 10 hours 46 minutes back ∙ 27 proposals |
Excel Specialist / Process Automation (Excel + preferably programming)We are looking for a specialist with ADVANCED knowledge of Excel to optimize the existing file and automate processes. It will be a great advantage if you also have programming skills / VBA / Power Query / Power Automate or experience in creating complex logic in Excel. Project… Python, Databases & SQL ∙ 13 hours 45 minutes back ∙ 31 proposals |
Automation of processes through API and PythonBelow I described the current process and the result I would like to achieve. I also attach files of the real process to better understand how it looks in reality Current process Currently, the entire process is performed manually: uploading/downloading files, transferring… AI & Machine Learning, Python ∙ 14 hours 46 minutes back ∙ 39 proposals |
A bot needs to be created in Telegram for subscription payment.
45 USD
A bot needs to be created in Telegram where users can subscribe for access to the webcams located in the yard. Organize payment for two types of subscriptions (monthly and daily) in the bot. The bot should automatically check the payment and then provide access links. Python, Bot Development ∙ 1 day 3 hours back ∙ 76 proposals |