Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 Point: create a special data structure that will be a list of numbers Each of the lists called a calculationList will have two
Part
Point: create a special data structure that will be a list of numbers
Each of the lists called a calculationList will have two main parts
List of numbers
a threshold value
The threshold values is a limit for whatever type of calculation the list belongs to
Example: for stdList, the threshold applies to the standard deviation. For meanList, the threshold applies to the mean etc.
The calculation list should have a prune method that will start removing values from the list until the relevant value is below the threshold.
Each type of calculation list will have a different way of figuring out what to remove as the most important values should be removed first
Most important meaning if standard deviation is greater than the threshold, and we have a value that is standard deviation away from the mean and another that is standard deviations away from the mean we want to remove the second valve first as it will be the most impactful
PLEASE CREATE CLASSES USING PYTHON
A calculationList class that is made up of a list of float numbers as well as a few additions
This class will
Inherit from two things the mutable sequence class and the ABC class
Mutable sequence class: allow us to use the list methods
ABC class: allow us to use the abstract methods
The calculation list will be a base class that will not be implemented directly. Next will need to create some subclasses that then inherit from the calculationList class
PLS CODE the following in python using numpy
stdList this will be a calculationList that will prune values based on the standard deviation of the list
meanList this will be a calculationList that will prune values based on the mean of the list
sumList this will be a calculationList that will prune values based on the sum of the list
Each of these classes should only add what they need to make their unique functionality work
The things that are common to all of them should be calculationList class. The other classes should be children of that class, each adding ether own unique parts
NOTE: there may be erroneous values in the input data, so there should be some error checking to deal with broken inputs of the row has erroneous data, that row should be skipped entirely
Example of input csv file contents
Name Type Threshold Value Value Value
list stdList
list stdList
list meanList
Example of output file contents what we tryna do
Name Length Threshold Value
list
list
list
Starting point
Part
Write a code that reads a csv file using the code classes above
Some criteria:
# read data from disk, and create a list of the calculation lists.
# process those lists to get actual outputs.
#outputs processCalculationListscalculationListLoaderinputscsv outputfile"output.csv
#outputs.head
Example files above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started