Now that we've seen how to validate regression models in theory, let's take a look at how to use the different metrics we just discussed in combination with CNTK. For this section, we'll be working with a model that predicts miles per gallon for cars using the following code:
from cntk import default_options, input_variablefrom cntk.layers import Dense, Sequentialfrom cntk.ops import reluwith default_options(activation=relu): model = Sequential([ Dense(64), Dense(64), Dense(1,activation=None) ]) features = input_variable(X.shape[1])target = input_variable(1)z = model(features)
Follow the given steps:
- First, import the required components from the cntk package
- Next, define a default activation ...