def regressionWrapper(model, modelType, testSample):
 if ((modelType == 'svm') or (modelType == 'randomforest')):
  return model.predict(testSample.reshape(1, (-1)))[0]
 return None

def regressionWrapper ( model , modelType , testSample ) : if ( ( modelType == 'svm' ) or ( modelType == 'randomforest' ) ) : return model . predict ( testSample . reshape ( 1 , ( - 1 ) ) ) [ 0 ] return None
this function is used as a wrapper to pattern classification .