Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

we want to IMPLEMENT IN FIRST SCREENSHOT (GROUPING CLASS, THW WINDOW MAKE GROUPING FUNCTION IN PYTHON ) also, to help you this window function might

image text in transcribed

image text in transcribed

image text in transcribed

we want to IMPLEMENT IN FIRST SCREENSHOT (GROUPING CLASS, THW WINDOW MAKE GROUPING FUNCTION IN PYTHON ) also, to help you this window function might be useful

image text in transcribed

thanks

Eclass WindowGrouper(Grouper): A grouper used to create a grouping of students according to their answers to a survey. This grouper uses a window search algorithm to create groups. ERE Public Attributes ses group size: the ideal number of students that should be in each group == Representation Invariants === group_size > 1 group_size: int def make_grouping(self, course: Course, survey: Survey) -> Grouping: Return a grouping for all students in . Starting with a tuple of all students in None: Initialize a course with the name of . self.name = name self.students = [] class Survey: A survey containing questions as well as criteria and weights used to evaluate the quality of a group based on their answers to the survey questions - Private Attributes --- questions: a dictionary mapping each question's id to the question itself criterio: adictionary mapping a question's td to its associated criterion weights: dictionary mapping a question's id to a weight; an integer representing the importance of this criteria. _default_criterion: a criterion to use to evaluate a question the question does not have an associated criterion in criteria _default_weight: a weight to use to evaluate a question the question does not have an associated weight in weights - Representation Invariants es No two questions on this survey have the same id Each key in questions equals the id attribute of its value Each key in criteria occurs as a key in questions Each key in weights occurs as a key in questions Each value in weights is greater than _default_weight > questions: Dict(int, Question) _criteria: Dict(int, Criterion) _weights: Dict(int, int] _default_criterion: Criterion _default_weight: int der _init__(self, questions: List[Question)) -> None: Initialize o new survey that contains every question in . This new survey should use a HomogeneousCriterion as a default criterion and should use I o . default weight. self._questions - () for question in questions: self._questions question. 10) - question self._default_criterion - HomogeneousCriterion() self._default_weight. 1 self, weights - () self-criteria - def windows(1st: List[Anyl n: int) -> List[List[Any] Return o list containing windows of containing the elements with index i through index fe in the original List where is the index of window in the returned list. ses Preconditions >> windows ((3, 4, 6, 2, 3), 2) -- [[3, 4), 14, 6), 16, 2), (3, 371 >>> windows(['a', 1, 6.0, False), 3) -- [I , 1, 6.0],[1, 6.0, False) True True wind - for in range(len(1st). n + 1): ending_index-lin wind.append(ist[iending Index]) return wind<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions