This is the repository for my implementations on the Machine Learning course of Stanford University/Coursera.
Taught by Andrew Ng
- Linear Regression & Normal Equation
- Implemented linear regresion, mean square distance cost function and gradient descent.
- Example linear regression:
-
Implemented logistic regression, binary classification cost function and gradient descent.
-
Implemented L2 regularization on cost function and gradient descent.
-
Example of logistic regression classification:
- Example of L2 regularization: Shows how a low regularization term (0) results in overfitting and a large one (100) in underfiting, and lambda=1 showing the trade off minimizing the square mean distance or the weigth values, best fit for the model.
- Logistic Regression & Regularization
- Implemented polynomial featurization, learning curve and validation curve plots.
-
Implemented a SVM spam email classifier.
-
Example of fitting a SVM: First image shows an underfit model for C=3, sigma=1. Second one, an overfitting model C=0.3, sigma= 0.03. And finally a good fit model C=0.3, sigma=0.1.
-
Increasing C pushes to minimize the error from the cost function, where sigma in the Gaussian kernel if decreased pushes to minimize distance between the data point and landmark.
-
Implemeneted K-Means and PCA Algorithms.
-
Example of K-Means centroid progression and point assigment: 1st Iteration and last 10th one.
-
Example of PCA dimension reduction: Eigonvectors over data set, and projection of data point on the reduced dimension.
-
Example of K-Mean and PCA over data set: K-Means group assigment and PCA dimension reduction: 3-D to 2-D.
-
Implemeneted anomaly detection with multi-variable gaussian distribution and recommender ystem.
-
Example of anomaly detection. This plot shows the gaussian distribution and how the data points are placed, red circles show the anomalies, p(x; u, covariance) < epsilon.
-
Example of recommender system: "This dataset consists of ratings on a scale of 1 to 5. The dataset has nu = 943 users, and nm = 1682 movies." This first plot shows the movie rating per user, second image shows how the system is able to find similar movies to the ones high rated by the same user. This is done after the implementation of the regularized cost, gradients, and training of the model.