darch/searchers.py
def refit_model(self):
        """Learns a new surrogate model using the data observed so far.

        """

        # only fit the model if there is data for it.
        if len(self.known_models) > 0:

            self._build_feature_maps(self.known_models, self.ngram_maxlen, self.thres)

            X = sp.vstack([ self._compute_features(mdl)
                    for mdl in self.known_models], "csr")
            y = np.array(self.known_scores, dtype='float64')

            #A = np.dot(X.T, X) + lamb * np.eye(X.shape[1])
            #b = np.dot(X.T, y)
            self.surr_model = lm.Ridge(self.lamb_ridge)
            self.surr_model.fit(X, y)
Learns a new surrogate model using the data observed so far.

        
Learns a new surrogate model using the data observed so far.
Learns a new surrogate model using the data observed so far .
def refit_model(self):
        if len(self.known_models) > 0:
            self._build_feature_maps(self.known_models, self.ngram_maxlen, self.thres)
            X = sp.vstack([ self._compute_features(mdl)
                    for mdl in self.known_models], "csr")
            y = np.array(self.known_scores, dtype='float64')
            self.surr_model = lm.Ridge(self.lamb_ridge)
            self.surr_model.fit(X, y)
def refit_model ( self ) : if len ( self . known_models ) > 0 : self . _build_feature_maps ( self . known_models , self . ngram_maxlen , self . thres ) X = sp . vstack ( [ self . _compute_features ( mdl ) for mdl in self . known_models ] , "csr" ) y = np . array ( self . known_scores , dtype = 'float64' ) self . surr_model = lm . Ridge ( self . lamb_ridge ) self . surr_model . fit ( X , y )
Learns a new surrogate model using the data observed so far.
Learns a new surrogate model using the data observed so far .
"""Learns a new surrogate model using the data observed so far.

        """ # only fit the model if there is data for it. #A = np.dot(X.T, X) + lamb * np.eye(X.shape[1]) #b = np.dot(X.T, y)
self