예제 #1
0
 def _default(self, model, fit=False):
     if fit:
         self._modelfile = tempfile().name
     model = model or self._modelfile
     assert model is not None
     argv = map(str, self._argv)
     argv += ["--dimensionality", self._dim]
     argv += [("--test_file", "--training_file")[fit], self._data]
     argv += [("--model_in", "--model_out")[fit], model]
     if not fit:
         outfile = tempfile().name
         argv += ["--cluster_mapping_out", outfile]
         call(argv, verbose=self.verbose)
         X, y = read_svmlight(outfile)
         return X.todense()
     else:
         call(argv, verbose=self.verbose)
         self._modelfile = model
예제 #2
0
    def _default(self, argv, X, Y=None):

        infile, descfile = WiseRFRegressor._make_wiserf_csvs(X, Y)
        argv += ["--in-file", infile]
        argv += ["--desc-file", descfile]
        call(argv, verbose=self.verbose)
예제 #3
0
 def _default(self, argv):
     argv += ["--dimensionality", str(self._dim)]
     call(argv, verbose=self.verbose)