Classification (supervised learning) of expression data on pathway level
Have a look at the GSVA package. It allows to convert a matrix with genes x Samples to a pathways x Samples using several methods ssgsea, gage, gsva...

Afterwards you can use that matrix as input for differential expression of pathways or classification algorithms or whatever. 



However it depends on the input of the "pathways" you give it. Make sure that the pathways are correct. Also consider that the pathway topology might change with conditions.