Question: In Java Please Homework 6 Continue working in the Caesar project. Normalizing data is useful in many areas. There are also multiple methods of normalizing
In Java Please
Homework 6 Continue working in the Caesar project. Normalizing data is useful in many areas. There are also multiple methods of normalizing data (such as in Linear Algebra to make the vector length one, rescaling data to the range of [0, 1], or making the data sum to 100%). This can be useful in a number of areas, for this assignment we will be thinking about comparing histograms where the number of data points is different so comparing counts would be misleading. So we want to convert our histograms from counts to percentages. 1) (15 points) Write a method normalizeArray that takes one argument, an array of integers. This method will return a normalized copy of the array where each bin contains the percentage. public static double[] normalizeArray(int[] inputArray) O To compute this you will need to Create a new double array Add up all of the values of the input array (sum) Divide each array value by the sum and store that in the double array Return the double array O For example this histogram: int[] binsArray = {2,3,4,8,1,2}; Will result in a normalized histogram of: {0.1, 0.15, 0.2, 0.4, 0.05, 0.1} a * * * * b * * * * * * * * * * * * * d * * * * * * * * * * * * * e * * f * * * *
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
