- Read Tutorial
- Watch Guide Video
- Complete the Exercise
Summary
Implement the ability to remove anomalies from a Ruby collection
Exercise File
Exercise Description
Given an array of integers, add a method to the array class that removes any/all values higher or lower than specified arguments.
Example
[44, 8043, 443, 43452, 2183].remove_anomalies 100, 10_000 # => [8043, 443, 2183]
Real World Usage
When working with machine learning algorithms, one of the key requirements is to clean up the data and remove anomalies. Imagine a situation where you are building a baseball statistic algorithm and you want to ignore players who only played in a few games to ensure that you are only looking at data from a typical player. In this guide, we focused on how to leverage a helpful Ruby method that allows you to quickly return only the data that you need.
Solution
Can be found on the solutions branch on github.