Machine-learning based methods have been widely used for battery health state monitoring. However, the existing studies require sophisticated data processing for feature extraction, thereby complicating the implementation in battery management systems. This paper proposes a machine-learning technique, random forest regression, for battery capacity estimation. The proposed technique is able to learn the dependency of the battery capacity on the features that are extracted from the charging voltage and capacity measurements. The random forest regression is solely based on signals, such as the measured current, voltage and time, that are available onboard during typical battery operation. The collected raw data can be directly fed into the trained model without any pre-processing, leading to a low computational cost. The incremental capacity analysis is employed for the feature selection. The developed method is applied and validated on lithium nickel manganese cobalt oxide batteries with different ageing patterns. Experimental results show that the proposed technique is able to evaluate the health states of different batteries under varied cycling conditions with a root-mean-square error of less than 1.3% and a low computational requirement. Therefore, the proposed method is promising for online battery capacity estimation.