Skip to content

Instantly share code, notes, and snippets.

@enesser
Last active May 13, 2018 20:53
Show Gist options
  • Select an option

  • Save enesser/16f4150b6850bf420dd40574ffa9f0a6 to your computer and use it in GitHub Desktop.

Select an option

Save enesser/16f4150b6850bf420dd40574ffa9f0a6 to your computer and use it in GitHub Desktop.
Machine Learning Notes
Supervised Learning
Labeled Sets
Training
Evaluation (reserve)
Binary Classification
Predict a binary class as output based on given features
Examples:
* Is this transaction fraudulent or valid?
* Do we need to follow up on a customer review?
* Are there signs of onset of a medical condition or disease?
Multiclass Classification
Predict a class as output based on given features
Examples:
* How healthy is the food based on given ingredients?
Classes: Healthy, Moderate, Occasional, Avoid
* Identify type of mushroom based on features
* What type of advertisement can be placed for this search?
Data Visualization
* Linear
* Log
* Quadratic
* Cubic
* Exponential
* Log
* Sine
Lienar Regression
* Linear Model. Estimated Target = w0 + w1x1 + w2x2 + w3x3 + … + wnxn
where, w is the weight and x is the feature
* Predicted Value: Numeric
* Algorithm Used: Linear Regression. Objective is to find the weights w
* Optimization: Stochastic Gradient Descent. Seeks to minimize loss/cost so that predicted value is as close to actual as possible
* Cost/Loss Calculation: Squared loss function
Normalization Transformation (Numeric) - Chandra Lingam
* When there are very large differences in magnitude of features, features that have large magnitude can dominate model
* Normalization is a process of transforming features to have a mean of 0 and a variance of 1. This will ensure all features have similar scale.
* Feature normalized = (feature - mean) / (sigma)
where,
mean = mean of feature x
sigma = standard deviation of feature x
* Usage: normalize (numericFeature)
* Optimization algorithm may also converge faster with normalized features compared to features that have very large scale differences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment