Nice, this is a very elegant way now.
Only one thing about coding style (this is the last thing Ill complain about ;) .
There is quite some code redundancy here, could you simplify this a bit:
Most of the commands here are shared between the two modes, so pull them out of the if-then-else:

 * processing feature matrix
 * set_feature_matrix call in the end
 * the matrix multiplication call by eigen3 (only transpose afterwards etc is different in modes)