Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python help using numpy(in the code numpy is np) - Let's consider the problem of data normalizationsscoling in statistics and machine leaming it is olten
Python help using numpy(in the code numpy is np)
- Let's consider the problem of data normalizationsscoling in statistics and machine leaming it is olten desirable to convert data to a specified range; for example scale the data sa that the values falls between 0 and 1 , which is called min-max rescaling Suppose you hwve a vector (or one dimensional array) of values x, then the min-max rescaled values are given by: x=max(x)min(x)xmin(x) for your evercise, first perform min-max rescaling over a one-dimensional array. Next, assume you are given a two dimensional array, where you need to pertorm min-max rescaling on each column separately. Test that your code works as expected! menene,randon, default_ong() a ane dimensional anroy; x= mes.standard nornal (sizen(59), - code for min-mox rescoling of an arrey (onte the of code) Xerng.standard_norsal(size: (50,20)) - code for ein-max reicating of a 2.9 orray A can be done in one tine of code P anke sure you don't use for coopsit To evaluate your code for min-mak rescaling compute the following (assuming that your rescaled mattix is stored in a variabio named X roscaled): print(Xrescaled.min(axisee)) print(X_rescaled.nax(axis=0)) 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