Question: Given the following control - flow diagram:class MachineLearningTechnique def _ ( self , name, accuracy ) I self.name = name self.accuracy = accuracy I I

Given the following control-flow diagram:class
MachineLearningTechnique
def
_(self, name, accuracy)
I
self.name = name
self.accuracy = accuracy
I
I
A heap class
class
aHeap
def
init__(self)
l
self.heap =[]
I
1
def
push(self, technique)
I
heapq.heappush(self.heap, (technique.accuracy, technique))
|
def
top(self)
self.heap[0][1]
Machine learning techniques
technique1= MachineLearningTechnique("Random Forest", 0.79)
technique2= MachineLearningTechnique("XGBoost",0.88)
technique3= MachineLearningTechnique("Decision Tree", 0.65)
technique4= MachineLearningTechnique("Support Vector Machine", 0.92)
Create a Heap object and add techniques
heap = aHeap()
heap. push(technique1)
heap. push(technique2)
heap. push(technique3)
heap. push(technique4)
Retrieve a specific technique with its respective accuracy
mlTechnique = heap.top()
print("Technique:",
mlTechnique.name, "(Accuracy:", mlTechnique.accuracy, ")")Which machine learning technique will be retrieved?
Support Vector Machine
Decision Tree
XGBoost
Random Forest
Given the following control - flow diagram:class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!