@Override protected Futures remove_impl( Futures fs ) { for (Key[] ks : _output._treeKeys) for (Key k : ks) if( k != null ) k.remove(fs); for (Key[] ks : _output._treeKeysAux) for (Key k : ks) if( k != null ) k.remove(fs); if (_output._calib_model != null) _output._calib_model.remove(fs); return super.remove_impl(fs); }
@Override protected Futures remove_impl(Futures fs) { if (_exemplar_assignment_vec_key!=null) _exemplar_assignment_vec_key.remove(); return super.remove_impl(fs); }
/** * Delete everything in the DKV that this points to. We currently need to be able to call this after deleteWithChildren(). */ void delete() { for (Key k : leaderboard_set_metrics.keySet()) k.remove(); remove(); }
public void deleteBaseModelPredictions() { if (_output._base_model_predictions_keys != null) { for (Key<Frame> key : _output._base_model_predictions_keys) { if (_output._levelone_frame_id != null && key.get() != null) Frame.deleteTempFrameAndItsNonSharedVecs(key.get(), _output._levelone_frame_id); else key.remove(); } _output._base_model_predictions_keys = null; } }
@Override protected Futures remove_impl(Futures fs) { if (_output.weights != null && _output.biases != null) { for (Key k : _output.weights) if (k!=null) k.remove(fs); for (Key k : _output.biases) if (k!=null) k.remove(fs); } if (actual_best_model_key!=null) DKV.remove(actual_best_model_key); DKV.remove(model_info().data_info()._key, fs); deleteElasticAverageModels(); return super.remove_impl(fs); }
/** * Same as delete() but also deletes all Objects made from this instance. */ void deleteWithChildren() { leaderboard.deleteWithChildren(); for (Key<Grid> gridKey : gridKeys) gridKey.remove(); // If the Frame was made here (e.g. buildspec contained a path, then it will be deleted if (buildSpec.input_spec.training_frame == null) { origTrainingFrame.delete(); } if (buildSpec.input_spec.validation_frame == null && validationFrame != null) { validationFrame.delete(); } if (buildSpec.input_spec.leaderboard_frame == null && leaderboardFrame != null) { leaderboardFrame.delete(); } delete(); }
preds.delete(); xvalKey.remove();
@Test public void testQuantilesRange() { int nbins = 13; int nbins_cats = nbins; byte isInt = 0; double min = 1; double maxEx = 6.900000000000001; long seed = 1234; SharedTreeModel.SharedTreeParameters.HistogramType histoType = SharedTreeModel.SharedTreeParameters.HistogramType.QuantilesGlobal; double[] splitPts = new double[]{1,1.5,2,2.5,3,4,5,6.1,6.2,6.3,6.7,6.8,6.85}; Key k = Key.make(); DKV.put(new DHistogram.HistoQuantiles(k,splitPts)); DHistogram hist = new DHistogram("myhisto",nbins,nbins_cats,isInt,min,maxEx,0,histoType,seed,k); hist.init(); assert(hist.binAt(0)==min); assert(hist.binAt(nbins-1)<maxEx); assert(hist.bin(min) == 0); assert(hist.bin(maxEx-1e-15) == nbins-1); k.remove(); }
parms._train.remove(); if( gbm != null ) gbm .delete(); if( pred != null ) pred.remove();
parms._train.remove(); if( gbm != null ) gbm .delete(); if( pred != null ) pred.remove();
gbm1.deleteCrossValidationModels(); gbm1.delete(); gbm1._output._cross_validation_fold_assignment_frame_id.remove();
parms._train.remove(); if( gbm != null ) gbm .delete(); if( pred != null ) pred.remove();
@Test public void testGBMPredict() { GBMModel gbm = null; GBMModel.GBMParameters parms = new GBMModel.GBMParameters(); Frame pred=null, res=null; Scope.enter(); try { Frame train = parse_test_file("smalldata/gbm_test/ecology_model.csv"); train.remove("Site").remove(); // Remove unique ID int ci = train.find("Angaus"); Scope.track(train.replace(ci, train.vecs()[ci].toCategoricalVec())); // Convert response 'Angaus' to categorical DKV.put(train); // Update frame after hacking it parms._train = train._key; parms._response_column = "Angaus"; // Train on the outcome parms._distribution = DistributionFamily.multinomial; gbm = new GBM(parms).trainModel().get(); pred = parse_test_file("smalldata/gbm_test/ecology_eval.csv" ); pred.remove("Angaus").remove(); // No response column during scoring res = gbm.score(pred); // Build a POJO, validate same results Assert.assertTrue(gbm.testJavaScoring(pred, res, 1e-15)); } finally { parms._train.remove(); if( gbm != null ) gbm .delete(); if( pred != null ) pred.remove(); if( res != null ) res .remove(); Scope.exit(); } }