test_class.file: storm/trident-ml/src/test/java/com/github/pmerienne/trident/ml/regression/RegressionQueryTest.java
test_class.identifier: RegressionQueryTest
test_case.body: @Test
  	public void should_classify_instance_without_classifier() {
  		// Given
  		String regressorName = "TestLearner";
  		RegressionQuery query = new RegressionQuery(regressorName);
  
  		TridentTuple tuple1 = mock(TridentTuple.class);
  		TridentTuple tuple2 = mock(TridentTuple.class);
  		List<TridentTuple> tuples = Arrays.asList(tuple1, tuple2);
  
  		List<List<Object>> expectedKeys = asList(asList((Object) regressorName));
  		MapState<Regressor> state = mock(MapState.class);
  		given(state.multiGet(expectedKeys)).willReturn(EMPTY_LIST);
  
  		// When
  		List<Double> actualPredictions = query.batchRetrieve(state, tuples);
  
  		assertEquals(2, actualPredictions.size());
  		assertNull(actualPredictions.get(0));
  		assertNull(actualPredictions.get(1));
  	}
test_case.class_method_signature: RegressionQueryTest.should_classify_instance_without_classifier()
test_case.full_signature: @Test public void should_classify_instance_without_classifier()
test_case.identifier: should_classify_instance_without_classifier
test_case.invocations: mock mock asList asList asList mock willReturn given multiGet batchRetrieve assertEquals size assertNull get assertNull get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_classify_instance_without_classifier()
focal_class.declarator: serialVersionUID = 582183815675337782L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 582183815675337782L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: regressorName
focal_class.modifier: private
focal_class.original_string: private String regressorName;
focal_class.type: String
focal_class.var_name: regressorName
focal_class.file: storm/trident-ml/src/main/java/com/github/pmerienne/trident/ml/regression/RegressionQuery.java
focal_class.identifier: RegressionQuery
focal_class.class_method_signature: RegressionQuery.RegressionQuery(String regressorName)
focal_class.full_signature: public  RegressionQuery(String regressorName)
focal_class.identifier: RegressionQuery
focal_class.modifiers: public
focal_class.parameters: (String regressorName)
focal_class.signature:  RegressionQuery(String regressorName)
focal_class.class_method_signature: RegressionQuery.batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override public List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)
focal_class.identifier: batchRetrieve
focal_class.modifiers: @SuppressWarnings("unchecked") @Override public
focal_class.parameters: (MapState<Regressor> state, List<TridentTuple> tuples)
focal_class.return: List<Double>
focal_class.signature: List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)
focal_class.class_method_signature: RegressionQuery.execute(TridentTuple tuple, Double result, TridentCollector collector)
focal_class.full_signature: public void execute(TridentTuple tuple, Double result, TridentCollector collector)
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: (TridentTuple tuple, Double result, TridentCollector collector)
focal_class.return: void
focal_class.signature: void execute(TridentTuple tuple, Double result, TridentCollector collector)
focal_class.superclass: extends BaseQueryFunction<MapState<Regressor>, Double>
focal_method.body: @SuppressWarnings("unchecked")
  	@Override
  	public List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples) {
  		List<Double> labels = new ArrayList<Double>();
  
  		List<Regressor> regressors = state.multiGet(KeysUtil.toKeys(this.regressorName));
  		if (regressors != null && !regressors.isEmpty()) {
  			Regressor regressor = regressors.get(0);
  			if (regressor == null) {
  				for (int i = 0; i < tuples.size(); i++) {
  					labels.add(null);
  				}
  			} else {
  				Double label;
  				Instance<Double> instance;
  				for (TridentTuple tuple : tuples) {
  					instance = (Instance<Double>) tuple.get(0);
  					label = regressor.predict(instance.features);
  					labels.add(label);
  				}
  			}
  		} else {
  			for (int i = 0; i < tuples.size(); i++) {
  				labels.add(null);
  			}
  		}
  
  		return labels;
  	}
focal_method.class_method_signature: RegressionQuery.batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)
focal_method.full_signature: @SuppressWarnings("unchecked") @Override public List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)
focal_method.identifier: batchRetrieve
focal_method.invocations: multiGet toKeys isEmpty get size add get predict add size add
focal_method.modifiers: @SuppressWarnings("unchecked") @Override public
focal_method.parameters: (MapState<Regressor> state, List<TridentTuple> tuples)
focal_method.return: List<Double>
focal_method.signature: List<Double> batchRetrieve(MapState<Regressor> state, List<TridentTuple> tuples)