Random Forest Simple Explanation

Understanding the Random Forest with an intuitive example

When learning a technical concept, I find it’s better to start with a high-level overview and work your way down into the details rather than starting at the bottom and getting immediately lost. Along those lines, this post will use an intuitive example to provide a conceptual framework of the random forest, a powerful machine learning algorithm. After getting a basic idea down, I move on to a simple implementation to see how the technique works and if it will be useful to me before finally working out the details by digging deep into the theory. With that in mind, after understanding the overview of the random forest here, feel free to check out part two of this post, an end-to-end example worked out in Python code. Taken together, these two articles will help you conquer the first two steps in the learning process and leave you well prepared to dive as far into the random forest and machine learning as you want!

Read More

Random Forest In Python

A Practical End-to-End Machine Learning Example

There has never been a better time to get into machine learning. With the learning resources available online, free open-source tools with implementations of any algorithm imaginable, and the cheap availability of computing power through cloud services such as AWS, machine learning is truly a field that has been democratized by the internet. Anyone with access to a laptop and a willingness to learn can try out state-of-the-art algorithms in minutes. With a little more time, you can develop practical models to help in your daily life or at work (or even switch into the machine learning field and reap the economic benefits). This post will walk you through an end-to-end implementation of the powerful random forest machine learning model. It is meant to serve as a complement to my conceptual explanation of the random forest, but can be read entirely on its own as long as you have the basic idea of a decision tree and a random forest. A follow-up post details how we can improve upon the model built here.

There will of course be Python code here, however, it is not meant to intimate anyone, but rather to show how accessible machine learning is with the resources available today! The complete project with data is available on GitHub, and the data file and Jupyter Notebook can also be downloaded from Google Drive. All you need is a laptop with Python installed and the ability to start a Jupyter Notebook and you can follow along. (For installing Python and running a Jupyter notebook check out this guide). There will be a few necessary machine learning topics touched on here, but I will try to make them clear and provide resources for learning more for those interested.

Read More

The Case For Criticism

When I’m wrong, call me out!

Here’s a radical idea: every time you refrain from correcting someone out of politeness, you are doing them a disservice by robbing them of a valuable opportunity for self-improvement.

Lately, I have noticed a disconcerting trend: people in daily life are more reluctant to point out and correct other’s mistakes. This has been most pronounced than in the classroom where it seems to be impossible for a student to actually give a wrong answer. Instead, they are “on the right track” or “have the basic concept” no matter how far away from the correct response they actually are. Now, I understand professors may not want to discourage a student by flat out telling them they are wrong, but despite recent political developments in the US, we are not living in a post-truth world. There are still right and wrong answers, optimal ways to solve a problem, and opinions that belong in “the dustbin of history.” The aversion to correcting false statements extends beyond the classroom. In my time with NASA, I sat in on many meetings where a manager said something all the engineers knew was technically wrong, but no one would ever think to speak up and point this out. Afterwards, we talked about how the manager had no clue how things actually got done, but instead of explaining that to him, we let him continue in his false beliefs. As a final example, consider a typical scenario in the early rounds of the popular singing contest American Idol: a young contestant, full of enthusiasm and confidence walks onto the stage and belts out an absolutely unbearable rendition of a pop song. How on Earth did they come to believe they had any singing talent? Because no one had ever been told them how bad they really were. For years, they had been surrounded by family and friends who politely told them they were a great performer, a delusion that finally was shattered in front of a national audience. All it would have taken was a single honest person to tell the contestant that maybe they should pursue a different path to save them hours of wasted effort and the embarrassment of a failed audition.

Read More

Artificial Intelligence Part 1 Search

Eight Puzzle Search Tree

Author’s Note: The following is a project I completed for Introduction to Artificial Intelligence at Case Western Reserve University. The complete Python code and documentation can be found on my machine learning GitHub page. One quick comment about my code: as an engineer, I pride myself on getting the job done. That means I often put functionality ahead of clean code. I would appreciate any constructive criticism for optimizing my Python code!

Introduction

The eight puzzle provides an ideal environment for exploring one of the fundamental problems in Artificial Intelligence: searching for the optimal solution path. Although the eight puzzle is a simplified environment, the general techniques of search employed to find the solution can translate into many domains, including laying out components on a computer chip or finding the best route between two cities. Two different search strategies were explored in this project: a-star and local beam search. A-star search was tested with 2 heuristics, while local beam was tested with several values for the beam width.

Figure 1: Eight Puzzle in Unsolved and Solved State

Read More

The Worst They Can Say Is No

Overcoming Social Anxiety with an Attitude Change

Going into college I had a serious case of social anxiety. From conversations with classmates, I know I wasn’t the only one suffering from this problem, although everyone’s fears took different forms. My anxiety manifested itself whenever I had to start a conversation either in person or online. A typical example occurred when I would need to email professors to apply for a research position or just to ask for help. Every time, I would spend a few agonizing hours composing the ideal paragraph only to receive a reply within minutes saying simply “Yes” with the tag “Sent from my iPhone.” Inevitably, I would brief a sigh of relief and tell myself next time I would remember the professor would only spend a few seconds on my email and it did not have to be perfect. I knew that whenever I would read an email, I did not analyze every word and others were not expecting immaculate messages. Nevertheless, the next time I had to write a dreaded email, I would forget my promise and waste precious time crafting a message. Debilitating social stumbling blocks such as this affect all of us to some degree because we have a natural aversion to situations where we might be subjected to social disapproval. This makes perfect sense from an evolutionary standpoint — we would not want to be alienated from a group when we depend on them for survival — but it does not serve us well in the modern world where we must expose ourselves to rejection in multiple interactions every day. Even though one of my goals after high school was to embrace failure rather than trying to avoid it, I knew that social anxiety led me to avoid trying new opportunities because I was afraid of any form of rejection. Although I was able to identify this condition before my freshman year, it was not until my junior year that I was able to overcome it by embracing the mindset of “the worst they can say is no.”

Read More