undefined
Question # 1 This problem concerns the Min-max normalization algorithm which is one of the most common ways to normalize data. Your task is to write a python program that include normalize function. This function receives a list of values, then it will normalize it by:
The minimum value of the list gets transformed into a 0. The maximum value gets transformed into a 1. And every other value gets transformed into a decimal between 0 and 1 using the following formula.
value - min
max-min
(3020) For example, if the minimum value of the list was 20, and the maximum value was 40, then value 30 would be transformed to about 0.5 since it is (4020)
You should provide the following functions:
def normalize():
Receive a list of values, and return a new normalized list.
def main
Open and read values from a text file data. txt and fill it in a list. The values of list normalize by calling the function normalize Print the values of the list after and before normalization.
Note :
It is not allowed to use external library to solve this question. No printing from the normalize function Assume that the file has unique distinct valid values If the input file does not exit, display the following message input file is not found
Sample Run
Before normalization: [70,90,78,20,5,10,6]
After normalization: [.75,1,.85,.125,.5,,.625]