Tag Archives: Machine Learning

Principal Component Analysis (PCA) – Part 4 – Python ML – OOP Basics

Goal of this post:

  1. Add principal component analysis (PCA)
  2. Refactor using inheritance
  3. Convert gradient descent to stochastic gradient descent
  4. Add new tests via pytest

What we are leaving for the next post:

  1. Discussing the need for packaging
  2. Start creating an actual package
Continue reading

Multivariate Linear Regression – Part 3 – Refactoring – Python ML – OOP Basics

Goal of this post:

  1. Move beyond single linear regression into multiple linear regression by utilizing gradient descent
  2. Refactor using inheritance
  3. Reconfigure our pytest to include the general case

What we are leaving for the next post:

  1. Add principal component analysis
  2. Refactor using inheritance
  3. Add new tests via pytest
Continue reading

Single Linear Regression – Part 1 – Python ML – OOP Basics

Data scientists who come to the career without a software background (myself included) tend to use a procedural style of programming rather than taking an object oriented approach. Changing styles is a paradigm shift and really takes some time to wrap your mind around. Many of us who have been doing this for years still have trouble envisioning how objects can improve things. There are a lot of resources out there to help you understand this subject in more detail but I am going to take a “learn by doing” approach. The code used for this can be found on my GitHub.

Goal of this post:

  1. Build a very basic object to house our linear regression model
  2. Create a command line interface (CLI) to pass in different datasets
  3. Print the object to the screen in a user-friendly format

What we are leaving for the next post:

  1. Fitting a model to find coefficients
  2. Finding the RMSE, R^2, slope and intercept of the model
  3. Testing our model using pytest

Here we go!

Continue reading

Google Vision API in R – RoogleVision

Using the Google Vision API in R

Utilizing RoogleVision

After doing my post last month on OpenCV and face detection, I started looking into other algorithms used for pattern detection in images. As it turns out, Google has done a phenomenal job with their Vision API. It’s absolutely incredible the amount of information it can spit back to you by simply sending it a picture.

Also, it’s 100% free! I believe that includes 1000 images per month. Amazing!

In this post I’m going to walk you through the absolute basics of accessing the power of the Google Vision API using the RoogleVision package in R. Continue reading

Random Forest Classification of Mushrooms

There is a plethora of classification algorithms available to people who have a bit of coding experience and a set of data. A common machine learning method is the random forest, which is a good place to start.

This is a use case in R of the randomForest package used on a data set from UCI’s Machine Learning Data Repository.

Are These Mushrooms Edible? Continue reading