Abstract The radial velocity technique is one of the two main approaches for detecting planets outside our solar system, often referred to as exoplanets. When a planet orbits a star its gravitational force causes the star to move and this induces a Doppler shift (i.e. the star light appears redder or bluer than expected), and it is this effect that the radial velocity method attempts to detect. Unfortunately, these Doppler signals are typically contaminated by various stellar activity phenomena, such as dark spots on the star surface. We propose a flexible statistical modeling framework to capture this stellar activity and thereby improve detection power for low-mass planets (e.g., Earth-like planets). Our approach builds on previous work and makes two key contributions: (i) we use a customized dimension reduction approach to construct new data-driven stellar activity proxies; and (ii) we use a large-scale model selection procedure to find the best model for the particular proxies at hand, as opposed to considering only a single model. Our method results in substantially improved power for planet detection compared with existing methods in the astronomy literature.