Data Science using Python and R - 9 Flashcards
What do neural networks attempt to imitate?
The type of non-linear learning that occurs in the networks of neurons found in nature, such as the human brain.
What are the main components of a neuron?
Dendrites, cell body, and axon.
What is the role of dendrites in a neuron?
To gather inputs from other neurons.
What does an artificial neuron model typically consist of?
Inputs (xi), a combination function (such as summation), an activation function, and an output response (y).
What is a key benefit of neural networks?
They are robust for noisy, complicated, or nonlinear data.
What is a main drawback of neural networks?
They are relatively opaque to human interpretation.
What are the three layers typically found in a neural network?
- Input layer
- Hidden layer
- Output layer
What is meant by a ‘completely connected’ neural network?
Every node in a given layer is connected to every node in adjoining layers.
What is the purpose of weights in a neural network?
To influence the strength of the connection between nodes.
What happens if the hidden layer has too many nodes?
It can lead to overfitting.
What is the combination function used in neural network nodes?
Usually summation (Σ) to produce a linear combination of inputs and weights.
What does the term ‘net’ refer to in a node?
The single scalar value produced by the combination function.
What is the most common activation function in neural networks?
The sigmoid function.
What does the sigmoid function output range between?
0 and 1.
What is the formula for the sigmoid function?
y = 1 / (1 + e^(-x))
What is backpropagation in neural networks?
A method for adjusting weights based on prediction error.
What does the sum of squared errors (SSE) measure?
How well the output predictions fit the actual target values.
What is used to minimize the SSE in neural networks?
Optimization methods, specifically gradient-descent methods.
What type of data does the Framingham Heart Study dataset contain?
Information on three variables for 7953 patients, including binary predictor ‘Sex’ and continuous predictor ‘Age’.
What are the target variable values in the Framingham Heart Study dataset?
0 = survival and 1 = death.
What does the activation function do within a node?
It produces an output value based on the net input.
What does the weight in a neural network model represent?
What the model is trying to tell you, analogous to predictor coefficients in regression.
Fill in the blank: The combination function produces a _______ of the node inputs and connection weights.
single scalar value
True or False: Neural networks allow for looping or cycling within the flow of information.
False
What do the predictor coefficients in a regression model indicate?
They indicate the strength and direction of the relationship between predictors and the response variable.
What are the weights associated with the hidden layer node H1 and the output node O1?
WH1O1 = -5.8477
What does a negative weight from H1 to O1 imply about the relationship with death probability?
It implies that a higher value of H1 lowers the probability of death.
How does the Sex predictor influence the hidden layer node H1?
The weight WI1H = 0.6418 indicates that larger values of Sex (females) excite H1 to a higher value.
What is the relationship between age and the hidden layer node H1?
The weight WI2H = -3.0784 indicates that higher values of Age lower the value of H1.
What is the first step in using neural networks in R with the Framingham_training data set?
Read in the Framingham_training data set as fram_train.
What command is used to convert the binary and ordinal variables Death and Sex to factors in R?
fram_train$Death <- as.factor(fram_train$Death) and fram_train$Sex <- as.factor(fram_train$Sex)
What is the purpose of min-max standardization on the Age variable?
To scale the Age variable to a range between 0 and 1.
What command installs the nnet and NeuralNetTools packages in R?
install.packages(‘nnet’); install.packages(‘NeuralNetTools’)
What is specified by the size parameter in the nnet function?
The number of units in the hidden layer.
What is the command to plot the neural network after running the nnet algorithm?
plotnet(nnet01)
What is the essential problem for the neural network?
To construct a set of weights that will minimize the error in predictions.
What is backpropagation in the context of neural networks?
A process to update weights in the network by propagating the error backward.
What does it mean when we say a neural network is completely connected?
Each node in one layer is connected to every node in the next layer.
What are the benefits of having more nodes in the hidden layer?
Increased model capacity and ability to capture complex patterns.
What is a drawback of using too many nodes in the hidden layer?
Risk of overfitting the model to the training data.
Fill in the blank: The sigmoid function combines nearly linear behavior, curvilinear behavior, and nearly constant behavior in _______.
output transformation.
What does the output of the nnet() function include?
Weights and structure of the trained neural network.
Which baseline model do we compare the neural network model against?
A simple classification model, often logistic regression.
True or False: The neural network model should outperform the baseline model in terms of accuracy.
True
What is the purpose of constructing a contingency table in model evaluation?
To compare actual and predicted values.
What are the criteria to compare different models in the exercises?
- Accuracy
- Sensitivity
- Specificity
What is the first step in preparing the adult_ch6_training data set for neural network modeling?
Create a binary variable CapGainsLossesPositive.
What should be done with the variables Marital.status, Income, and CapGainsLossesPositive before modeling?
Convert them to factors.
What is the command to evaluate the NNM1 model using the test data set?
Construct a contingency table comparing actual and predicted values.
What is the purpose of standardizing the variables in neural network modeling?
To ensure that all inputs contribute equally to the model.
What is the command used to obtain the weights for the neural network?
nnet01$wts