Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

public static double[] calcPerceptronInput(double[] example, double[][] kernelSe

ID: 3646848 • Letter: P

Question

public static double[] calcPerceptronInput(double[] example,
double[][] kernelSet, double variance){

//Create a new 1D array for an input to the perceptron stage
//length: one larger than the number of rows in the kernelSet


//Assign to each of the first kernelSet.length elements of your input array the
//distance calculated between example and the corresponding examples in the
//kernelSet.


//Update each of those values in your input array by applying the Gaussian
//function to each value.


//Assign 1 to the last element in your input array.
//(The last weight in a weight array does not correspond to an example from the
//kernel set, but just increases or decreases the weighted sum by some constant
//amount, just like the b value does in y = mx + b. Because we will later perform
//a weighted sum with the perceptron input and a weight array, for consistency,
//we need to multiply that last weight by 1.)


//Replace the line below to return your input array.
return null;
}

please help me write the script in between!

Explanation / Answer

//Update each of those values in your input array by applying the Gaussian //function to each value. //Assign 1 to the last element in your input array. //(The last weight in a weight array does not correspond to an example from the //kernel set, but just increases or decreases the weighted sum by some constant //amount, just like the b value does in y = mx + b. Because we will later perform //a weighted sum with the perceptron input and a weight array, for consistency, //we need to multiply that last weight by 1.) //Replace the line below to return your input array. return null;