I have Pavia dataset which is available as .mat file (Available @ web http://www.ehu.eus/ccwintco/index.php?title=Hyperspectral_Remote_Sensing_Scenes).
Here i want to know how to generate the classes such as tree, soil etc.
The best way is manual generation with prior knowledge about your case study. For example, I generated building layer in one of my recent studies. This is valuable for evaluation your final results. To give more information about this, you can refer to my article: " Automatic building extraction in dense urban areas through GeoEye multispectral imagery".