fa3 + logistic reg to gradient boosting Flashcards

(100 cards)

1
Q

We can visualize the tree using the export_graph function from the tree module.

Group of answer choices:
True
False

A

False

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

In the decision tree, the region can be found by traversing the tree from the root and going left or right.

Group of answer choices
True
False

A

True

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

Decision tree is a model that learns a hierarchy of if/else questions, leading to a decision.

Group of answer choices
True
False

A

True

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

The .dot file format is a _____ file format for storing graphs.

A

TEXT

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

In the decision tree, the ______ represents the whole dataset.

Group of answer choices
Terminal Nodes
Edges
Root
Conditions

A

Root

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

The .dot file format is an image file format for storing graphs.
Group of answer choices
True
False

A

True

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

Decision trees in scikit learn are implemented in ________ and DecisionTreeClassifier classes.

Group of answer choices: DecisionRegressorTree
TreeDecisionRegressor
RegressorDecisionTree
DecisionTreeRegressor

A

DecisionTreeRegressor

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

Which is not true about Random Forest?

Group of answer choices
Not in the options
Less memory usage.
Less burden or parameter tuning.
As many trees are created, detailed analysis is difficult.
Poor performance for large and sparse data.

A

Less memory usage.

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

To build a random forest model, you need to decide on the __________ to build.

Group of answer choices
Depth of the tree Height of tree
Number of trees
Root
Node of the tree

A

Number of trees

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

The _______ are methods that combine multiple machine learning models to create more powerful models.

A

ENSEMBLES

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

In the decision tree, the terminal nodes represent the whole dataset.

Group of answer choices
True
False

A

False

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

In the decision tree, the sequence of if/else questions are called qualifiers.

Group of answer choices
True
False

A

False

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

Which is not true about Random Forest?

Group of answer choices
Reduces underfitting by averaging trees that predict well.
Reduces overfitting by averaging trees that predict well.
Selects candidate features at random when splitting nodes.
Randomly selects some of the data when creating a tree.

A

Reduces underfitting by averaging trees that predict well.

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

What are the parameters for Gradient Boosting?

a. n_estimators, learning rate
b. n_estimators, max_features
c. n_estimators, learning rate, max_depth
d. n_estimators, max_features, max_depth

A

c

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

Gradient boosting is used when you need to take more performance in random forests.

Group of answer choices
True
False

A

True

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

In the decision tree, the sequence of if/else questions are called ______.

Group of answer choices
Qualifiers
Condition
Tests
Nodes

A

Tests

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

Decision trees in scikit learn are implemented in DecisionTreeRegressor and _______ classes.

Group of answer choices
DecisionClassifier
TreeDecisionClassifier
DecisionTreeClassifier
DecisionClassifierTree

A

DecisionTreeClassifier

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

We can visualize the tree using the ______ function from the tree module.

A

export_graphviz

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

Two most common linear classification algorithms:

A

Logistic Regression
Linear Support Vector Machines

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

Logistic Regression, implemented in where

A

linear_model.LogisticRegression

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

Linear Support Vector Machines (Linear SVMs), implemented in where

A

svm.LinearSVC

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

SVC stands for?

A

support vector classifier

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

______ is a classification algorithm and not a regression algorithm, and it should not be confused with LinearRegression

A

LogisticRegression

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

the trade-off parameter detemrins the strength of the regularizaiton, called _____

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Higher values of C correspond to _____
LESS REGULARIZATION
26
When you use a high value of the parameter C, LogisticRegression and LinearSVC will _______
try to fit the training set as best as possible
27
low values of the parameter C, the models put more emphasis on _______
finding a coefficient vector (w) that is close to zero
28
Using low values of C will cause the algorithms to try to adjust to the _____ of data points
“majority”
29
using a higher value of C stresses the importance that each ______ be classified correctly
individual data point
30
_______ are a family of classifiers that are quite similar to the linear models
Naive Bayes classifiers
31
In Naive Bayes, ____is faster than linear classifier
Training Speeds
32
In Naive Bayes, _____ performance is slightly lower
Generalization
33
The reason that Naive Bayes models are so efficient is that they______ and collect simple per-class statistics from each feature
learn parameters by looking at each feature individually
34
The reason that Naive Bayes models are so efficient is that they learn parameters by looking at each feature individually and _______
collect simple per-class statistics from each feature
35
3 Kinds of Naive Bayes Classifier in Scikit-learn:
GaussianNB BernoulliNB MultinomialNB
36
GuassianNB -> ____ data
Continuous
37
BernoulliNB -> ____ data, ___ data
Binary data, Text data
38
MultinomialNB -> ____ data, ___ data
Integer count data, text data
39
In Naive Bayes, it controls _____
model complexity with alpha parameter
40
In Naives Bayes, _____ by adding virtually positive data as much as alpha
Smooth statistics
41
In Naive Bayes, ____ decreases the complexity of the model but does not change the performance
Large alpha
42
_____ is a high-dimensional dataset
GaussianNB
43
_____ and ______ are a text-like used to count sparse data
BernioulliNB and MultinomialNB
44
In Naive Bayes, _____ are fast and easy to understand and process
Training and testing
45
Naives Bayes works well with _____ and is not _____
sparse high-dimensional datasets, parameter sensitive
46
______ are widely used models for classification and regression tasks
Decision trees
47
In Decision Trees, they learn a hierarchy of ____, leading to a decision
if/else questions
48
Learning a _____ means learning the sequence of if/else questions that gets us to the true answer most quickly
decision tree
49
In the machine learning setting, if/else questions are called ___
tests
50
To build a tree, the algorithm searches over all possible tests and finds the one that is ____ about the target variable
most informative
51
The top node is called the ___, representing the whole dataset.
root
52
Parts of a decision tree:
Root Node Node Edge (Connects tests to other nodes) Terminal Node (Nodes with no futher edges) Characteristics (inside nodes)
53
A prediction on a new data is made by checking which region of the ____ the point lies in, and then predicting the majority target (or the single target in the case of pure leaves) in that region
partition of the feature space
54
The ____ can be found by traversing the tree from the root and going left or right, depending on whether the test is fulfilled or not
region
55
Decision trees in scikit learn are implemented in ____ and ____ classes
DecisionTreeRegressor, DecisionTreeClassifier
56
We can visualize the tree using the ___ function from the tree module
export_graphviz
57
export_graphviz writes a file in the ____, which is a text file format for storing graphs
.dot file format
58
export_graphviz writes a file in the .dot file format, which is a ____for storing graphs
text file format
59
We can visualize the _____ in a way that is similar to the way we visualize the coefficients in the linear model
feature importances
60
______ is impossible for extrapolation predicting outside the range of training data
Extrapolation 0
61
____ is not affected by scale
Decision Tree Regression
62
_____ are methods that combine multiple machine learning models to create more powerful models
Ensembles
63
Two ensemble models that have proven to be effective on a wide range of datasets, for classification and regression, both of which use decision trees as their building blocks:
Random Forests Gradient Boosted Decision Trees
64
It is one of the ensemble methods that can avoid overfitting by combining multiple decision trees
Random Forests
65
Random Forests Reduces overfitting by ______
averaging trees that predict well
66
In Random Forests, Regression is:
average of predicted values
67
In Random Forests, Classification is:
average of predicted probabilities
68
It injects randomness when creating trees
Random Forests
69
In Random Forests, it randomly selects _____ when creating a tree
some of the data
70
In Random Features, selects ______ when splitting nodes
candidate features at random
71
To build a random forest model, you need to decide on the _____ to build
number of trees
72
To build a random forest model, you need to decide on the number of trees to build (the ____ parameter of RandomForestRegressor or RandomForestClassifier)
n_estimators
73
To build a tree, we first take what is called a _____ of our data. That is, from our n_samples data points, we repeatedly draw an example randomly with replacement
bootstrap sample
74
A critical parameter in this process is ____. If we set _____ to n features, that means that each split can look at all features in the dataset, and no randomness will be injected in the feature selection
max features
75
The Advantages of Random Forests are:
Mostly widely used algorithm in regression and classification Excellent performance, less burden or parameter tuning, no data scale required Large datasets can be applied
76
In Random Forests, it is the _______ algorithm in regression and classification
Mostly widely used
77
In Random Forests, it has ___ performance, less burden or _____, ____ required
excellent performance, parameter tuning, no data scale required
78
In Random Forests, ____ datasets can be applied
Large
79
The Disadvantages of Random Forests are:
As many trees are created, detailed analysis is difficult, and the trees tend to get deeper Poor performance for large and sparse data More memory usage and slower training and prediction than linear models
80
In Random Forests, as many trees are created, _____ is difficult and the trees tends to get deeper
detailed analysis
81
In Random Forests, it has poor performance for ___ and ____ data
large and sparse data
82
In Random Forests, it has more ____ and slower ___ and ____ than linear models
memory usage slower training and prediction
83
The parameters used in Random Forests are:
n_estimators, max features
84
Another ensemble algorithm based on DecisiontreeRegressor
Gradient Boosted Regression Trees (gradient boosting machines)
85
Gradient Boosted Regression Trees can be used for both ____ and ___
classification and regression
86
In Gradient Boosted Regression Trees, unlike random forest, _____ is strongly applied instead of randomness
pre-pruning
87
Used a lot in machine learning contests (Kaggle)
Gradient Boosted Regression Trees (gradient boosting machines)
88
In Gradient Boosted Regression Trees, it is slightly more _____, slightly ____ than random forest
more parameter sensitive higher performance
89
Create the next tree to compensate for the error of the previous tree using a ______
shallow tree of 5 or less
90
In Gradient Boosted Regression Trees, the regression is:
least squares error loss function
91
In Gradient Boosted Regression Trees, the classification is:
logistic loss function
92
In Gradient Boosted Regression Trees, use _____ method
gradient descent method
93
In Gradient Boosted Regression Trees, use gradient descent method (learning rate parameter is important default = ___)
0.1
94
Gradient Boosting Advantages:
Use when you need to take more performance in random forests (xgboost for larger scales) No need for feature scale adjustment and can be used for binary and continuous features
95
In Gradient Boosting, we can use it when you need to take more _____ in random forests (____ for larger scales)
performance, xgboost
96
In Gradient Boosting, no need for _________ and can be used for binary and continuous features
feature scale adjustment
97
Gradient Boosting Disadvantages:
Doesn't work well for sparse high-dimensional data Sensitive to parameters, takes longer training time
98
In Gradient Boosting, it doesn't work well for sparse ___
high-dimensional data
99
In Gradient Boosting, it is sensitive to _____, takes longer _____
Parameters Longer Training time
100
Gradient Boosting Parameters are:
n_estimators learning rate max_depth (<=5)