Reactivity controlled compression ignition (RCCI) technology not only offers high thermal efficiency but also produces low nitrogen oxides (NOx) and soot emissions. However, it is imperative to control the combustion in RCCI engines to prevent high pressure rise rates and combustion instability. In this study, a model-based control framework is developed to optimize the RCCI operating mode. To this end, the effects of variations in the premixed ratio, start of injection timing and fuel equivalence ratio on the combustion dynamics are analyzed by examining the heat release rates. Three distinct heat release rate patterns are identified together with two transition zones. Heat release rate traces are grouped together as a function of fractions of early and late heat release rates. Based on a classification algorithm, the fractions of early and late heat release rate are identified as scheduling variables for the data-driven modeling of an RCCI engine. Linear regression is used to model the fractions of early and late heat release. These models are then used to train linear parameter varying (LPV) models using least-squares support vector machine (LS-SVM). Using the learned LPV model, a model predictive controller (MPC) scheme is then developed for a 2-liter 4-cylinder RCCI engine to control combustion phasing (CA50) and indicated mean effective pressure (IMEP) while limiting the maximum pressure rise rate (MPRR) to avoid engine knocking. The simulation results show that the designed controller is capable of limiting MPRR below 6 bar/CAD while tracking CA50 and IMEP with average errors of 1.2 CAD and 6.2 kPa, respectively.