Method for changning K, the scaling parameter is added, and a function for cross validation for fitting K over the training set