Data-driven methods are widely applied to predict the remaining useful life (RUL) of lithium-ion batteries, but they generally suffer from two limitations: (i) the potentials of features are not fully exploited, and (ii) the parameters of the prediction model are difficult to determine. To address this challenge, this paper proposes a new data-driven method using feature enhancement and adaptive optimization. First, the features of battery aging are extracted online. Then, the feature enhancement technologies, including the box-cox transformation and the time window processing, are used to fully exploit the potential of features. The box-cox transformation can improve the correlation between the features and the aging status of the battery, and the time window processing can effectively exploit the time information hidden in the historical features sequence. Based on this, gradient boosting decision trees are used to establish the RUL prediction model, and the particle swarm optimization is used to adaptively optimize the model parameters. This method was applied on actual lithium-ion battery degradation data, and the experimental results show that the proposed model is superior to traditional prediction methods in terms of accuracy.