Future large space missions designed to search for biosignatures in the atmospheres of Earth-like exoplanets will operate more efficiently and have a higher chance of success if stars with possible Earth analogs are known before launch. One way to find these Earth-like candidates is with the radial velocity technique, but this method is currently limited by spurious signals introduced by stellar activity (i.e. faculae, starspots). Here we show that machine learning techniques such as linear regression and neural networks can effectively remove these activity signals from RV observations. Previous efforts have focused on carefully filtering out activity signals in time using Gaussian process regression (e.g. Haywood et al. 2014). Instead, we separate activity signals from true center-of-mass RV shifts using only changes to the average shape of spectral lines, and no information about when the observations were collected. We demonstrate our technique on simulated data, reducing the RV scatter from 82.0 cm s-1 to 3.1 cm s-1 , and on approximately 700 observations taken nearly daily over three years with the HARPS-N Solar Telescope, reducing the RV scatter from 1.47 m s-1 to 0.78 m s-1 (a 47% or factor of ~ 1.9 improvement). In the future, these or similar techniques could remove activity signals from observations of stars outside our solar system and eventually help detect habitable-zone Earth-mass exoplanets around Sun-like stars. In this way, improvements in RV precision could significantly accelerate the characterization of habitable zone Earth-sized exoplanets.