def cc_setup(calc_pred_int=True): PI = PredictionIntervals() results = gf.setup_pseudo_results() PI._assign_features_from_results_structure(results=results) testchain, s2chain, lims, sstype, nsample, iisample = PI._setup_generation_requirements( nsample=400, calc_pred_int=calc_pred_int, sstype=0) DS = gf.basic_data_structure() datapred = PI._setup_data_structure_for_prediction(data=DS, ndatabatches=1) return PI, results, testchain, s2chain, lims, sstype, nsample, iisample, datapred
def test_basic_datapred(self): PI = PredictionIntervals() DS = gf.basic_data_structure() datapred = PI._setup_data_structure_for_prediction(data=DS, ndatabatches=1) self.assertTrue(np.array_equal(datapred[0].xdata[0], DS.xdata[0]), msg='Arrays should match') self.assertTrue(np.array_equal(datapred[0].ydata[0], DS.ydata[0]), msg='Arrays should match')
def test_non_basic_modelfunction(self): PI = PredictionIntervals() DS = gf.non_basic_data_structure() datapred = PI._setup_data_structure_for_prediction(data=DS, ndatabatches=2) nrow, ncol = PI._determine_shape_of_response( modelfunction=gf.predmodelfun, ndatabatches=2, datapred=datapred, theta=[3.0, 5.0]) self.assertEqual(nrow, [100, 100], msg='Expect [100, 100]') self.assertEqual(ncol, [1, 1], msg='Expect [1, 1]')
def setup_interval(cls): PI = PredictionIntervals() DS = gf.basic_data_structure() datapred = PI._setup_data_structure_for_prediction(data=DS, ndatabatches=1) return PI, datapred