In this homework assignment, you will use the concepts of branching to identify the type of iris flower based on some ke

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In this homework assignment, you will use the concepts of branching to identify the type of iris flower based on some ke

Post by answerhappygod »

In this homework assignment, you will use the concepts ofbranching to identify the type of iris flower based on some keycharacteristics or attributes.
Figure 1 Iris (Source:Wikipedia)
Data science/ computing techniques are important tools forbotanists to automatically identify flowers based on importantfeatures. Specifically, data science techniques calledclassification techniques are used for this type of problemsolving. A classification technique groups data points intocategories or classes using a classifier.
In this assignment, we will try to classify flowers that belongto the genus iris. According to Wikipedia “Iris is a genus of260–300 species of flowering plants with showy flowers. It takesits name from the Greek word for a rainbow, which is also the namefor the Greek goddess of the rainbow, Iris.”[1] Botanists have usedthe following measurements to identify the specific type of irisflower. Note that, in general, such measurements or descriptivevalues are also called attributes.
sepal width (in cm)
petal length (in cm)
petal width (in cm)
For this assignment, we write a series of if-else operations todetermine the iris type based on the given sepal and petalmeasurements of a given flower. We will use the classifier derivedby the prominent statistician R.A. Fisher [2] and the publisheddataset on iris to generate the classifier that will guide us toclassifying the following types of Iris flowers.
Iris-Setosa
Iris-Versicolor
Iris-Virginica
Figure 2 outlines the classifier that we need to build tocorrectly classify iris flowers into Setosa, Versicolor orVirginica.
In This Homework Assignment You Will Use The Concepts Of Branching To Identify The Type Of Iris Flower Based On Some Ke 1
In This Homework Assignment You Will Use The Concepts Of Branching To Identify The Type Of Iris Flower Based On Some Ke 1 (332.01 KiB) Viewed 36 times
Please HELP ME FIGURE OUT THE SECOND PART OF THE CODE IN PYTHONPLEASE
In this homework assignment, you will use the concepts of branching to identify the type of iris flower based on some key characteristics or attributes. Figure 1 Iris (Source:Wikipedia) Data science/ computing techniques are important tools for botanists to automatically identify flowers based on important features. Specifically, data science techniques called classification techniques are used for this type of problem solving. A classification technique groups data points into categories or classes using a classifier. In this assignment, we will try to classify flowers that belong to the genus iris. According to Wikipedia "Iris is a genus of 260-300 species of flowering plants with showy flowers. It takes its name from the Greek word for a rainbow, which is also the name for the Greek goddess of the rainbow, Iris.*[1] Botanists have used the following measurements to identify the specific type of iris flower. Note that, in general, such measurements or descriptive values are also called attributes. sepal width (in cm) petal length (in cm) petal width (in cm) For this assignment, we write a series of if-else operations to determine the iris type based on the given sepal and petal measurements of a given flower. We will use the classifier derived by the prominent statistician R.A. Fisher [2] and the published dataset on iris to generate the classifier that will guide us to classifying the following types of Iris flowers. Iris-Setosa Iris-Versicolor Iris-Virginica Figure 2 outlines the classifier that we need to build to correctly classify iris flowers into Setosa, Versicolor or Virginica. class=setosa TRUE TRUE petal width(cm) <= 0.8 petal width (cm) <= 1.65 class=versicolor class=virginica FALSE TRUE FALSE TRUE petal lenght (cm) <= 4.95 sepal width (cm) <= 3.1 FALSE class=versicolor FALSE TRUE petal width (cm) <= 1.75 class=virginica TRUE Figure 2 Decision Tree using the Iris training dataset petal width (cm) <= 1.65 FALSE FALSE class=versicolor class=virginica
Enter the sepal width (cm): 3.5 Enter the petal length (cm): 1.4 Enter petal width (cm): 0.2 The flower classification is Setosa References [1] https://www.wikiwand.com/en/Iris_(plant) [2] https://scikit-learn.org/dev/datasets/t ... ne-dataset 414776.1710972.qx3zqy7 LAB ACTIVITY 1 def classify(swidth,plength, pwidth): #follow the defined decision tree 2 3 if pwidth<=0.8: 4 5 6 7 8 9 10 11 12 13 14 15 67892 16 17 4.1.1: HW1 18 return "Setosa" else: if plength<=4.95: if pwidth<=1.65: else: return "Versicolor" else: Submit for grading if swidth<=3.1: return "Virginica" return "Versicolor" else: if pwidth<=1.75: if pwidth<=1.65: return "Virginica" else: else: 19 20 21 return "Virginica" 22 23 swidth=float(input("Enter the sepal width (cm): ")) 24 plength=float(input("Enter the petal length (cm): ")) 25 pwidth=float(input("Enter the petal width (cm): ")) 26 result classify(swidth,plength, pwidth) 27 print("The flower classification is "+result) return "Versicolor" Develop mode Submit mode main.py Coding trail of your work What is this? 6/29 W-3,3 min: 1 3/10 Load default template... When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading.
1: Compare output Your output correctly contains 2: Compare output 3.5 Input 1.4 0.2 Your output correctly. contains 3: Compare output 4: Unit test Input Your output correctly contains 5: Unit test Input Setosa 2.5 1.8 0.9 Versicolor 1.2 5.0 1.78 Test classify(3.5, 1.4, 0.5) returns Setosa Virginica 9: Unit testa Your output Enter the sepal width (cm): Test classify(3.5, 1.9, 0.85) returns Versicolor Your output Enter the sepal width (cm): 6: Unit test Test classify(2.85, 1.9, 1.85) returns Virginica Your output Enter the sepal width (cm): 7: Unit test Test classify(3.2, 1.9, 1.85) returns Versicolor Your output Enter the sepal width (cm): 8: Unit test Test classify(3.2, 5.1, 1.65) returns Virginica Your output Enter the sepal width (cm): Test classify(3.2, 5.1, 1.75) returns Versicolor 1/1 1/1 1/1 0/1 0/1 0/1 0/1 0/1 0/1
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply