Prediction Flashcards
Classification
Predicting when y=1 vs 0 (like churn). Tells you probability of y=1
Unconditional Probability
Unaffected by previous or future events
Law of Large Numbers
Increased observations means increased precision of prediction
Conditional Probability
Stronger prediction, rather than just 25% of customers churn you divide churn rate by senior and not senior
Bayes Rule
P(A|B) = P(A&B)/P(B)
P(A|B) = P(A)P(B)/P(B)
Threshold
Value between 0 and 1. The value for probability that will mean it is considered a 1
Sigmoid Function
H= @ + @ * tenure and then L(H) = 1/(1+e^-H)
gets you those predictions on multiple variables
Certainty through |H|
|H|> 2 okay
|H|> 5 quite sure
|H| > 10 super sure
Scatter Plotting Continuous Features
A method to analyze how your y value is affected by both. have feature 1 on the x, feature 2 on the y, and then two colours for whether each data point is y=1
Precision
How many false positives, if higher than less Fp
Tp/(Tp + Fp)
Accuracy
How many correct predictions (so true positives and true negatives)
(Tp + Tn)/(all obs)
Recall
How many false negatives, if higher than less Fn
Tp/(Tp+Fn)
F1
Balance between precision and recall
2((PR)/(P + R))
Underfitting
Model bad in testing, not flexible enough
High bias
Add observations or add features
Overfitting
Poor predictions in test data, too flexible on training data, too custom
High variance
less features or regularization (make simpler) or increased observations
Make sure 70/30 data split
What to do when y= 0,1,or 2
Make z0=1 only if y= 0 then do Pr(z0|X)
Do the same with a z1 and z2
Supervised Learning
Predict a labelled attribute y with features
classification, log regression
ex. home sales price (cond mean at each value to get line)
Unsupervised Learning
no labelled target attribute to predict
come up with cluster observation on similar features
ex. market segments, similar images, news article types
Anomaly Detection
Evaluate whether certain data anomalous
fraud detect, defect detect
Reinforcement Learning
Implements actions, generates data, updates algorithm
Trade off between exploit and explore
Recco systems
Machine Learning Benefits and Types
More precise because it can use more obs, more flexible forms, more variables
predicts then decides off that
Supervised Learning
Unsupervised Learning
Anomaly Detection
Reinforcement Learning
External Validity
Model trained in context A can be used in context B
Likely higher when data context is similar