The NeuralNet_XLT
class supports multi-output, multi-layer (input, {hidden} and output) Neural-Networks with Transfer Learning. A layer (first hidden by default) from a neural- network model trained on a related dataset is transferred into that position in this model. Given several input vectors and output vectors (training data), fit the parameters b connecting the layers, so that for a new input vector v, the net can predict the output vector. Caveat: currently only allows the transfer of one layer.
Value parameters
- f
-
the array of activation function families between every pair of layers
- fname_
-
the feature/variable names (defaults to null)
- hparam
-
the hyper-parameters for the model/network
- itran
-
the inverse transformation function returns responses to original scale
- l_tran
-
the layer to be transferred in (defaults to first hidden layer)
- nz
-
the number of nodes in each hidden layer, e.g., Array (9, 8) => 2 hidden of sizes 9 and 8 (null => use default formula)
- transfer
-
the saved network parameters from a layer of a related neural network trim before passing in if the size does not match
- x
-
the m-by-n input matrix (training data consisting of m input vectors)
- y
-
the m-by-ny output matrix (training data consisting of m output vectors)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class NeuralNet_XLtrait Fittrait FitMtrait PredictorMVtrait Modelclass Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited classlikes
The BestStep
is used to record the best improvement step found so far. Only considers the first response variable y(0) => qof(?, 0).
The BestStep
is used to record the best improvement step found so far. Only considers the first response variable y(0) => qof(?, 0).
Value parameters
- col
-
the column/variable to ADD/REMOVE for this step
- mod
-
the model including selected features/variables for this step
- qof
-
the Quality of Fit (QoF) for this step
Attributes
- Inherited from:
- PredictorMV
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Trim the new transferred in NetParam
to match the size of the existing NetParam
.
Trim the new transferred in NetParam
to match the size of the existing NetParam
.
Value parameters
- lt
-
the layer to transfer in
- tl
-
the transferred in layer's NetParam (weights and biases) (defaults to the l_tran layer)
Attributes
Inherited methods
Perform backward elimination to find the least predictive variable to remove from the existing model, returning the variable to eliminate, the new parameter matrix and the new Quality of Fit (QoF). May be called repeatedly.
Perform backward elimination to find the least predictive variable to remove from the existing model, returning the variable to eliminate, the new parameter matrix and the new Quality of Fit (QoF). May be called repeatedly.
Value parameters
- cols
-
the columns of matrix x currently included in the existing model
- first
-
first variable to consider for elimination (default (1) assume intercept x_0 will be in any model)
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Perform backward elimination to find the least predictive variables to remove from the full model, returning the variables left and the new Quality of Fit (QoF) measures for all steps.
Perform backward elimination to find the least predictive variables to remove from the full model, returning the variables left and the new Quality of Fit (QoF) measures for all steps.
Value parameters
- cross
-
whether to include the cross-validation QoF measure
- first
-
first variable to consider for elimination
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Build a sub-model that is restricted to the given columns of the data matrix.
Build a sub-model that is restricted to the given columns of the data matrix.
Value parameters
- x_cols
-
the columns that the new model is restricted to
Attributes
- Inherited from:
- NeuralNet_XL
Compute default values for the number nodes in each hidden layer, based on the number of nodes in the input layer. Rule: e.g., n = 15 => [ 31, 15, 10, 7 ]
Compute default values for the number nodes in each hidden layer, based on the number of nodes in the input layer. Rule: e.g., n = 15 => [ 31, 15, 10, 7 ]
Attributes
- Inherited from:
- NeuralNet_XL
Attributes
- Inherited from:
- PredictorMV
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.
Value parameters
- w
-
the weights on the instances (defaults to null)
- y
-
the actual response/output vector to use (test/full)
- yp
-
the predicted response/output vector (test/full)
Attributes
- See also
-
Regression_WLS
- Definition Classes
- Inherited from:
- Fit
Return the Quality of Fit (QoF) measures corresponding to the labels given. Note, if sse > sst, the model introduces errors and the rSq may be negative, otherwise, R^2 (rSq) ranges from 0 (weak) to 1 (strong). Override to add more quality of fit measures.
Return the Quality of Fit (QoF) measures corresponding to the labels given. Note, if sse > sst, the model introduces errors and the rSq may be negative, otherwise, R^2 (rSq) ranges from 0 (weak) to 1 (strong). Override to add more quality of fit measures.
Attributes
- Inherited from:
- Fit
Perform forward selection to find the most predictive variable to add the existing model, returning the variable to add and the new model. May be called repeatedly.
Perform forward selection to find the most predictive variable to add the existing model, returning the variable to add and the new model. May be called repeatedly.
Value parameters
- cols
-
the columns of matrix x currently included in the existing model
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Perform forward selection to find the most predictive variables to have in the model, returning the variables added and the new Quality of Fit (QoF) measures for all steps.
Perform forward selection to find the most predictive variables to have in the model, returning the variables added and the new Quality of Fit (QoF) measures for all steps.
Value parameters
- cross
-
whether to include the cross-validation QoF measure
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Freeze the given layer (do not change its paramaters during back-propogation).
Freeze the given layer (do not change its paramaters during back-propogation).
Value parameters
- layer
-
the layer to freeze (defaults to -1 => no layers are frozen)
Attributes
- See also
-
NeuralNet_XLT
(transfer learning) - Inherited from:
- NeuralNet_XL
Return the best model found from feature selection.
Return the feature/variable names.
Return the network parameters (weights and biases) for the given layer.
Return the network parameters (weights and biases) for the given layer.
Value parameters
- layer
-
the layer to get the parameters from
Attributes
- See also
-
NeuralNet_XLT
(transfer learning) - Inherited from:
- NeuralNet_XL
Return the used data matrix x. Mainly for derived classes where x is expanded from the given columns in x_.
Return the used data matrix x. Mainly for derived classes where x is expanded from the given columns in x_.
Attributes
- Inherited from:
- PredictorMV
Return the used response matrix y. Mainly for derived classes where y is transformed.
Return the used response matrix y. Mainly for derived classes where y is transformed.
Attributes
- Inherited from:
- PredictorMV
Return the help string that describes the Quality of Fit (QoF) measures provided by the Fit
trait. Override to correspond to fitLabel.
Return the help string that describes the Quality of Fit (QoF) measures provided by the Fit
trait. Override to correspond to fitLabel.
Attributes
- Inherited from:
- Fit
Return the hyper-parameters.
The log-likelihood function times -2. Override as needed.
The log-likelihood function times -2. Override as needed.
Value parameters
- ms
-
raw Mean Squared Error
- s2
-
MLE estimate of the population variance of the residuals
Attributes
- See also
- Inherited from:
- Fit
Make plots for each output/response variable (column of matrix y). Overriden as the response matrix may be transformed or rescaled.
Make plots for each output/response variable (column of matrix y). Overriden as the response matrix may be transformed or rescaled.
Value parameters
- yp
-
the testing/full predicted response/output matrix (defaults to full y)
- yy_
-
the testing/full actual response/output matrix (defaults to full y)
Attributes
- Definition Classes
- Inherited from:
- NeuralNet_XL
Return the mean of the squares for error (sse / df). Must call diagnose first.
Return the mean of the squares for error (sse / df). Must call diagnose first.
Attributes
- Inherited from:
- Fit
Return the number of terms/parameters in the model, e.g., b_0 + b_1 x_1 + b_2 x_2 has three terms.
Return the number of terms/parameters in the model, e.g., b_0 + b_1 x_1 + b_2 x_2 has three terms.
Attributes
- Inherited from:
- PredictorMV
Order vectors y_ and yp_ accroding to the ascending order of y_.
Order vectors y_ and yp_ accroding to the ascending order of y_.
Value parameters
- y_
-
the vector to order by (e.g., true response values)
- yp_
-
the vector to be order by y_ (e.g., predicted response values)
Attributes
- Inherited from:
- PredictorMV
Return only the first matrix of parameter/coefficient values.
Return only the first matrix of parameter/coefficient values.
Attributes
- Inherited from:
- PredictorMV
Return the array of network parameters (weight matrix, bias vector) bb.
Return the array of network parameters (weight matrix, bias vector) bb.
Attributes
- Inherited from:
- PredictorMV
Given an input matrix v, predict the output/response matrix f(v).
Given an input matrix v, predict the output/response matrix f(v).
Value parameters
- v
-
the input matrix
Attributes
- Definition Classes
- Inherited from:
- NeuralNet_XL
Given a new input vector v, predict the output/response vector f(v).
Given a new input vector v, predict the output/response vector f(v).
Value parameters
- v
-
the new input vector
Attributes
- Inherited from:
- NeuralNet_XL
Return the coefficient of determination (R^2). Must call diagnose first.
Return the coefficient of determination (R^2). Must call diagnose first.
Attributes
- Inherited from:
- FitM
Return a basic report on a trained and tested multi-variate model.
Return a basic report on a trained and tested multi-variate model.
Value parameters
- ftMat
-
the matrix of qof values produced by the
Fit
trait
Attributes
- Definition Classes
-
PredictorMV -> Model
- Inherited from:
- PredictorMV
Return a basic report on a trained and tested model.
Return a basic report on a trained and tested model.
Value parameters
- ftVec
-
the vector of qof values produced by the
Fit
trait
Attributes
- Inherited from:
- Model
Reset the best-step to default
Reset the degrees of freedom to the new updated values. For some models, the degrees of freedom is not known until after the model is built.
Reset the degrees of freedom to the new updated values. For some models, the degrees of freedom is not known until after the model is built.
Value parameters
- df_update
-
the updated degrees of freedom (model, error)
Attributes
- Inherited from:
- Fit
Return the matrix of residuals/errors.
Perform feature selection to find the most predictive variables to have in the model, returning the variables added and the new Quality of Fit (QoF) measures for all steps.
Perform feature selection to find the most predictive variables to have in the model, returning the variables added and the new Quality of Fit (QoF) measures for all steps.
Value parameters
- cross
-
whether to include the cross-validation QoF measure
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
- tech
-
the feature selection technique to apply
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Return the sum of the squares for error (sse). Must call diagnose first.
Return the sum of the squares for error (sse). Must call diagnose first.
Attributes
- Inherited from:
- FitM
Perform stepwise regression to find the most predictive variables to have in the model, returning the variables left and the new Quality of Fit (QoF) measures for all steps. At each step it calls 'forwardSel' and 'backwardElim' and takes the best of the two actions. Stops when neither action yields improvement.
Perform stepwise regression to find the most predictive variables to have in the model, returning the variables left and the new Quality of Fit (QoF) measures for all steps. At each step it calls 'forwardSel' and 'backwardElim' and takes the best of the two actions. Stops when neither action yields improvement.
Value parameters
- cross
-
whether to include the cross-validation QoF measure
- idx_q
-
index of Quality of Fit (QoF) to use for comparing quality
Attributes
- See also
-
Fit
for index of QoF measures. - Inherited from:
- PredictorMV
Produce a QoF summary for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). Note: `Fac_Cholesky is used to compute the inverse of xtx.
Produce a QoF summary for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). Note: `Fac_Cholesky is used to compute the inverse of xtx.
Value parameters
- b
-
the parameters/coefficients for the model
- fname
-
the array of feature/variable names
- vifs
-
the Variance Inflation Factors (VIFs)
- x_
-
the testing/full data/input matrix
Attributes
- Inherited from:
- Fit
Produce a QoF summary for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). FIX - only known to be valid for id activation function
Produce a QoF summary for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). FIX - only known to be valid for id activation function
Value parameters
- b_
-
the parameters/coefficients for the model
- fname_
-
the array of feature/variable names
- x_
-
the testing/full data/input matrix
Attributes
- See also
- Inherited from:
- NeuralNet_XL
Test a predictive model y_ = f(x_) + e and return its QoF vector. Testing may be be in-sample (on the training set) or out-of-sample (on the testing set) as determined by the parameters passed in. Note: must call train before test.
Test a predictive model y_ = f(x_) + e and return its QoF vector. Testing may be be in-sample (on the training set) or out-of-sample (on the testing set) as determined by the parameters passed in. Note: must call train before test.
Value parameters
- x_
-
the testing/full data/input matrix (defaults to full x)
- y_
-
the testing/full response/output matrix (defaults to full y)
Attributes
- Inherited from:
- NeuralNet_XL
Test/evaluate the model's Quality of Fit (QoF) and return the predictions and QoF vectors. This may include the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model). Extending traits and classess should implement various diagnostics for the test and full (training + test) datasets.
Test/evaluate the model's Quality of Fit (QoF) and return the predictions and QoF vectors. This may include the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model). Extending traits and classess should implement various diagnostics for the test and full (training + test) datasets.
Value parameters
- x_
-
the testiing/full data/input matrix (impl. classes may default to x)
- y_
-
the testiing/full response/output vector (impl. classes may default to y)
Attributes
- Inherited from:
- PredictorMV
Return the indices for the test-set.
Return the indices for the test-set.
Value parameters
- n_test
-
the size of test-set
- rando
-
whether to select indices randomly or in blocks
Attributes
- See also
-
scalation.mathstat.TnT_Split
- Inherited from:
- PredictorMV
Given training data x_ and y_, fit the parameters bb. Minimize the error in the prediction by adjusting the parameters bb.
Given training data x_ and y_, fit the parameters bb. Minimize the error in the prediction by adjusting the parameters bb.
Value parameters
- x_
-
the training/full data/input matrix
- y_
-
the training/full response/output matrix
Attributes
- Inherited from:
- NeuralNet_XL
Train the model 'y_ = f(x_) + e' on a given dataset, by optimizing the model parameters in order to minimize error '||e||' or maximize log-likelihood 'll'.
Train the model 'y_ = f(x_) + e' on a given dataset, by optimizing the model parameters in order to minimize error '||e||' or maximize log-likelihood 'll'.
Value parameters
- x_
-
the training/full data/input matrix (impl. classes may default to x)
- y_
-
the training/full response/output vector (impl. classes may default to y)
Attributes
- Inherited from:
- PredictorMV
Given training data x_ and y_, fit the parameters bb. Minimize the error in the prediction by adjusting the parameters bb. This version preforms an interval search for the best eta value.
Given training data x_ and y_, fit the parameters bb. Minimize the error in the prediction by adjusting the parameters bb. This version preforms an interval search for the best eta value.
Value parameters
- x_
-
the training/full data/input matrix
- y_
-
the training/full response/output matrix
Attributes
- Definition Classes
- Inherited from:
- NeuralNet_XL
Train and test the predictive model y_ = f(x_) + e and report its QoF and plot its predictions. FIX - currently must override if y is transformed, @see TranRegression
Train and test the predictive model y_ = f(x_) + e and report its QoF and plot its predictions. FIX - currently must override if y is transformed, @see TranRegression
Value parameters
- x_
-
the training/full data/input matrix (defaults to full x)
- xx
-
the testing/full data/input matrix (defaults to full x)
- y_
-
the training/full response/output matrix (defaults to full y)
- yy
-
the testing/full response/output matrix (defaults to full y)
Attributes
- Inherited from:
- PredictorMV
Train and test the predictive model y_ = f(x_) + e and report its QoF and plot its predictions. This version does auto-tuning. FIX - currently must override if y is transformed, @see TranRegression
Train and test the predictive model y_ = f(x_) + e and report its QoF and plot its predictions. This version does auto-tuning. FIX - currently must override if y is transformed, @see TranRegression
Value parameters
- x_
-
the training/full data/input matrix (defaults to full x)
- xx
-
the testing/full data/input matrix (defaults to full x)
- y_
-
the training/full response/output matrix (defaults to full y)
- yy
-
the testing/full response/output matrix (defaults to full y)
Attributes
- Inherited from:
- PredictorMV
Attributes
- Inherited from:
- PredictorMV
Compute the Variance Inflation Factor (VIF) for each variable to test for multi-collinearity by regressing x_j against the rest of the variables. A VIF over 50 indicates that over 98% of the variance of x_j can be predicted from the other variables, so x_j may be a candidate for removal from the model. Note: override this method to use a superior regression technique.
Compute the Variance Inflation Factor (VIF) for each variable to test for multi-collinearity by regressing x_j against the rest of the variables. A VIF over 50 indicates that over 98% of the variance of x_j can be predicted from the other variables, so x_j may be a candidate for removal from the model. Note: override this method to use a superior regression technique.
Value parameters
- skip
-
the number of columns of x at the beginning to skip in computing VIF
Attributes
- Inherited from:
- PredictorMV
Inherited fields
The optional reference to an ontological concept
The name for the model (or modeling technique).
Attributes
- Inherited from:
- NeuralNet_XL