Ejemplo n.º 1
0
Archivo: rls.py Proyecto: godeva/RanKit
 def __init__(self,
              X,
              Y,
              kernel='LinearKernel',
              basis_vectors=None,
              regparams=None,
              **kwargs):
     if regparams is None:
         grid = [2**x for x in range(-15, 16)]
     else:
         grid = regparams
     learner = RLS(X, Y, grid[0], kernel, basis_vectors, **kwargs)
     crossvalidator = LPOCV(learner)
     self.cv_performances, self.cv_predictions, self.regparam = grid_search(
         crossvalidator, grid)
     self.predictor = learner.predictor
Ejemplo n.º 2
0
 def __init__(self,
              X,
              Y,
              qids,
              kernel='LinearKernel',
              basis_vectors=None,
              regparams=None,
              measure=None,
              **kwargs):
     if regparams is None:
         grid = [2**x for x in range(-15, 15)]
     else:
         grid = regparams
     if measure is None:
         self.measure = cindex
     else:
         self.measure = measure
     learner = QueryRankRLS(X, Y, qids, grid[0], kernel, basis_vectors,
                            **kwargs)
     crossvalidator = LQOCV(learner, measure)
     self.cv_performances, self.cv_predictions, self.regparam = grid_search(
         crossvalidator, grid)
     self.predictor = learner.predictor
Ejemplo n.º 3
0
Archivo: rls.py Proyecto: godeva/RanKit
 def __init__(self,
              X,
              Y,
              folds,
              kernel='LinearKernel',
              basis_vectors=None,
              regparams=None,
              measure=None,
              save_predictions=False,
              **kwargs):
     if regparams is None:
         grid = [2**x for x in range(-15, 16)]
     else:
         grid = regparams
     if measure is None:
         self.measure = sqerror
     else:
         self.measure = measure
     learner = RLS(X, Y, grid[0], kernel, basis_vectors, **kwargs)
     crossvalidator = NfoldCV(learner, measure, folds)
     self.cv_performances, self.cv_predictions, self.regparam = grid_search(
         crossvalidator, grid)
     self.predictor = learner.predictor