Data Science using Python and R - 9 Flashcards

1
Q

What do neural networks attempt to imitate?

A

The type of non-linear learning that occurs in the networks of neurons found in nature, such as the human brain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main components of a neuron?

A

Dendrites, cell body, and axon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the role of dendrites in a neuron?

A

To gather inputs from other neurons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does an artificial neuron model typically consist of?

A

Inputs (xi), a combination function (such as summation), an activation function, and an output response (y).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a key benefit of neural networks?

A

They are robust for noisy, complicated, or nonlinear data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a main drawback of neural networks?

A

They are relatively opaque to human interpretation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the three layers typically found in a neural network?

A
  • Input layer
  • Hidden layer
  • Output layer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is meant by a ‘completely connected’ neural network?

A

Every node in a given layer is connected to every node in adjoining layers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of weights in a neural network?

A

To influence the strength of the connection between nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens if the hidden layer has too many nodes?

A

It can lead to overfitting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the combination function used in neural network nodes?

A

Usually summation (Σ) to produce a linear combination of inputs and weights.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the term ‘net’ refer to in a node?

A

The single scalar value produced by the combination function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the most common activation function in neural networks?

A

The sigmoid function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the sigmoid function output range between?

A

0 and 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the formula for the sigmoid function?

A

y = 1 / (1 + e^(-x))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is backpropagation in neural networks?

A

A method for adjusting weights based on prediction error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the sum of squared errors (SSE) measure?

A

How well the output predictions fit the actual target values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is used to minimize the SSE in neural networks?

A

Optimization methods, specifically gradient-descent methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What type of data does the Framingham Heart Study dataset contain?

A

Information on three variables for 7953 patients, including binary predictor ‘Sex’ and continuous predictor ‘Age’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are the target variable values in the Framingham Heart Study dataset?

A

0 = survival and 1 = death.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the activation function do within a node?

A

It produces an output value based on the net input.

22
Q

What does the weight in a neural network model represent?

A

What the model is trying to tell you, analogous to predictor coefficients in regression.

23
Q

Fill in the blank: The combination function produces a _______ of the node inputs and connection weights.

A

single scalar value

24
Q

True or False: Neural networks allow for looping or cycling within the flow of information.

25
Q

What do the predictor coefficients in a regression model indicate?

A

They indicate the strength and direction of the relationship between predictors and the response variable.

26
Q

What are the weights associated with the hidden layer node H1 and the output node O1?

A

WH1O1 = -5.8477

27
Q

What does a negative weight from H1 to O1 imply about the relationship with death probability?

A

It implies that a higher value of H1 lowers the probability of death.

28
Q

How does the Sex predictor influence the hidden layer node H1?

A

The weight WI1H = 0.6418 indicates that larger values of Sex (females) excite H1 to a higher value.

29
Q

What is the relationship between age and the hidden layer node H1?

A

The weight WI2H = -3.0784 indicates that higher values of Age lower the value of H1.

30
Q

What is the first step in using neural networks in R with the Framingham_training data set?

A

Read in the Framingham_training data set as fram_train.

31
Q

What command is used to convert the binary and ordinal variables Death and Sex to factors in R?

A

fram_train$Death <- as.factor(fram_train$Death) and fram_train$Sex <- as.factor(fram_train$Sex)

32
Q

What is the purpose of min-max standardization on the Age variable?

A

To scale the Age variable to a range between 0 and 1.

33
Q

What command installs the nnet and NeuralNetTools packages in R?

A

install.packages(‘nnet’); install.packages(‘NeuralNetTools’)

34
Q

What is specified by the size parameter in the nnet function?

A

The number of units in the hidden layer.

35
Q

What is the command to plot the neural network after running the nnet algorithm?

A

plotnet(nnet01)

36
Q

What is the essential problem for the neural network?

A

To construct a set of weights that will minimize the error in predictions.

37
Q

What is backpropagation in the context of neural networks?

A

A process to update weights in the network by propagating the error backward.

38
Q

What does it mean when we say a neural network is completely connected?

A

Each node in one layer is connected to every node in the next layer.

39
Q

What are the benefits of having more nodes in the hidden layer?

A

Increased model capacity and ability to capture complex patterns.

40
Q

What is a drawback of using too many nodes in the hidden layer?

A

Risk of overfitting the model to the training data.

41
Q

Fill in the blank: The sigmoid function combines nearly linear behavior, curvilinear behavior, and nearly constant behavior in _______.

A

output transformation.

42
Q

What does the output of the nnet() function include?

A

Weights and structure of the trained neural network.

43
Q

Which baseline model do we compare the neural network model against?

A

A simple classification model, often logistic regression.

44
Q

True or False: The neural network model should outperform the baseline model in terms of accuracy.

45
Q

What is the purpose of constructing a contingency table in model evaluation?

A

To compare actual and predicted values.

46
Q

What are the criteria to compare different models in the exercises?

A
  • Accuracy
  • Sensitivity
  • Specificity
47
Q

What is the first step in preparing the adult_ch6_training data set for neural network modeling?

A

Create a binary variable CapGainsLossesPositive.

48
Q

What should be done with the variables Marital.status, Income, and CapGainsLossesPositive before modeling?

A

Convert them to factors.

49
Q

What is the command to evaluate the NNM1 model using the test data set?

A

Construct a contingency table comparing actual and predicted values.

50
Q

What is the purpose of standardizing the variables in neural network modeling?

A

To ensure that all inputs contribute equally to the model.

51
Q

What is the command used to obtain the weights for the neural network?

A

nnet01$wts