A predictive model is only useful if it can actually predict based on new information. This is the case with a simple logistic or linear regression, or a more complex neural network model.
This is where the fun begins. The only requirements for this section are to pull sample data points for both male and female individuals and use their height and weight values to measure the accuracy of the model created in the previous section.
This section walks through the steps to predict gender based on height and weight.
- Create a Python function called
input_normalize
to input new values forheight
andweight
and output a normalized height and weight, as seen in the following script:
def input_normalize(height, weight): inputHeight = (height - x_mean[0])/x_std[0] inputWeight = (weight - x_mean[1])/x_std[1] return inputHeight, inputWeight
- Assign a variable called
score
to the function for the values of70
inches for the...