fix data_read access bug
only calculate kernel for training set