ISDS 415 Data Mining Ch. 7 - 10.
|
How to select K in kNN (1Q)
K= 1: By validation data; whichever k gives the lowest validation error.
|
|
Binary Classification K With Even K's
DO NOT USE even numbers since it could lead to an tie. XLMiner will pick the lowest probability and can chose an even number but that doesn't mean it should be chosen
|
|
K >1: classify by the majority decision rule based on the nearest k records
|
|
Low K values:
Capture local structure but may also capture noise. You cant rely on one Neighbour
|
|
High K values:
Provide more smoothing but may lose local detail. K can be as large as the training sample
|
|
Chose the K that gives you the lowest valid ER
|
|
sometimes predictors need to be standardized to equalize scales before computing distances. Standarized = normalized (-3, 3)
|
|
# of possible partitions in Recursive Partition (2Q)
|
|
Continuous: (n-1)*p
|
|
Categorical: 2ID - 1P, 3ID -3P, 4ID - 7P, 5ID - 15P
|
|
- Cutoff = 0.5 by default becuase the proportion of observation neighbors 1's in the k nearest neighbors. Majority decision rule is related to the cut off value for classifying records
|
|
You can adjust the cut off value to improve accuracy
|
|
Y = 1 (if p> cutoff)
|
|
Y = 0 ( if p < cutoff)
|
|
Example: Suppose cutoff = 0.9, k=7, we observed 5 C1 and 2C0. Y = 1 or 0?
- Probability (Y=1) = 5/7 = 0.71 ---> 0.71 < 0.9 -> Y= 0
|
|
Properties of CART (Classification And Regression Tree)(3Q)
|
|
- Model Free
|
|
- Automatic variable selection
|
|
- Needs large sample size (bc its model free)
|
|
- Only gives horizontal or vertical splits
|
|
- both methods of CART are BOTH model free
|
|
Best pruned tree: You naturally get overfitting when the natural end of process is 100% purity in each leaf which ends up fitting noise in the data. Slightly overfitted so people partition a bit less to accommodate based of the minimal error tree
|
|
Minimum error tree: The tree with lowest validation error.
|
|
Full tree: largest tree training error equals zero; overfitted
|
|
Note: The full tree can be the same as the minimum error tree BUT usually best pruned tree should be smaller than the other trees
|
|
Continous Partitions
(n-1) x P -> p dimentional predictors (more than 2 dimensional predictors)
|
|
Categorical Partitions
abcd split. (3Levels, 3P), (4Levels, 7P)
|
|
Assumptions For Logistic Regression (1Q)
|
|
- Generalized linearity
|
|
Logistic Regression Equation(2Q)
|
|
NOT model free -> based on following equations
|
|
log odds = beta0 + beta1X1 + ... + betaqXq
|
|
log p/(1-p) = beta0 + beta1X1 + ... betaqXq
|
|
P = 1/(1+exp(-(beta0 + beta 1X1 +... + betaqXq)))
|
|
EX. Probabiliy could look like this: **P = 1/(1+exp(0.6535 - 0.4535(X))) ----> where you can sub in x
|
|
Direct interpretation of beta 1 is that per unit increase of X1, log odds will increase by beta 1 -> not clear so thus you must say
|
|
The Log odds are going to increase by beta 1
|
|
Types of Regression :
|
|
- Logistic regression (Binary outcome)
|
|
- Multiple Linear Regression (Continuous outcome)
|
|
- Multinomial Logistic Regression (categorical outcome of 3 or more levels)
|
|
- Ordinal Logistic Regression (Categorical outcome of 3 or more ordinal levels)
|
|
- Poisson Regression (Count outcome)
|
|
- Negative Binomial Regression (Count outcome)
|
|
All those regression models can be called generalized linear models (GLM) !
|
|
(1)Partition the data into Training and Validation Sets
|
|
Training set Used to grow tree
|
|
Validation set used to assess classification performance
|
|
(2) More than 2 classes (M >2 )
|
|
Same structure except that the terminal nodes would take one of the m-class labels
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.