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 for height and weight 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 of 70 inches for the height and 180 lbs for the weight, as seen in the following script:
score = input_normalize(70, 180)
- Create another Python function, called predict_gender, to output a probability score, gender_score, between 0 and 1, as well as a gender ...