This paper considers an aggregator of Electric Vehicles (EVs) who aims to learn the aggregate power of his/her fleet while also participating in the electricity market. The proposed approach is based on a data-driven inverse optimization (IO) method, which is highly nonlinear. To overcome such a caveat, we use a two-step estimation procedure which requires solving two convex programs. Both programs depend on penalty parameters that can be adjusted by using grid search. In addition, we propose the use of kernel regression to account for the nonlinear relationship between the behavior of the pool of EVs and the explanatory variables, i.e., the past electricity prices and EV fleet’s driving patterns. Unlike any other forecasting method, the proposed IO framework also allows the aggregator to derive a bid/offer curve, i.e. the tuple of price-quantity to be submitted to the electricity market, according to the market rules. We show the benefits of the proposed method against the machine-learning techniques that are reported to exhibit the best forecasting performance for this application in the technical literature.