A Single Layer Perceptron for Regression: Part 3

  New Functions created:

  • normalize:  This function normalizes inputs using either min-max or Z-score normalization techniques. Importance of Normalization: Preventing than others just because their range of values are greater in comparison.
    Parameters:  (1) input (numpy array (m,n)): input/predictor values that have to be normalized.
                         (2) outputs(numpy array (m,1)) : Output values that have to be normalized. 
                         (3) type_of_normlaization (string): can be min_max or z_score.
                         
  • denormalize: This function converts the normalized values back to their original form.
    Parameters:  (1) outputs(numpy array (m,1)) : Predicted outputs that are to be brought back to                                                                                their original form. 
                         (2) term1(float):Either the min value or the mean of the original outputs.
                         (3) term2(float): Either the max value or the standard deviation of the original                                                            outputs.
                         (4) type_of_normlaization (string): can be min_max or z_score.
                         
  • predict: This function takes in inputs to predict outputs based on the weights passed to it.
    Parameters: (1)input(numpy array (m,n))
                        (2) actual_output(numpy array (m,1))
                        (3) type_of_normalization(string)
                        (3) weights(numpy array (n,1)) 

Next Step:

-  Testing the predictions on actual data.

Code

Comments

Popular posts from this blog

A single layer Perceptron for Regression: Part 1

What Data Structure Do I use?

A Single Layer Perceptron for Regression: Part 2