Returns a new CompositeScore with the filtering remainder replaced and
covering matches recalculated. Other matches are not recalculated.

@since 1.2
336157
public CompositeScore<S> withRemainderFilter(Filter<S> filter) {
        return new CompositeScore<S>(mFilteringScore.withRemainderFilter(filter),
                                     mOrderingScore);
    }
1142102
public int[] diffCols(int[] filterThese) {
    HashSet<Integer> filter = new HashSet<>();
    for(int i:filterThese)filter.add(i);
    ArrayList<Integer> res = new ArrayList<>();
    for(int i=0;i<_cols.length;++i) {
      if( _cols[i]._ignored || _cols[i]._response || filter.contains(i) ) continue;
      res.add(i);
    }
    return intListToA(res);
  }
1175732
public JavaDoubleRDD scoreExamples(JavaRDD<DataSet> data, boolean includeRegularizationTerms) {
        return scoreExamplesMultiDataSet(data.map(new DataSetToMultiDataSetFn()), includeRegularizationTerms);
    }
347014
protected void computeScoreFive( int top[] , int middle[] , int bottom[] , int score[] , int width ) {

		// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
		for( int d = minDisparity; d < maxDisparity; d++ ) {

			// take in account the different in image border between the sub-regions and the effective region
			int indexSrc = (d-minDisparity)*width + (d-minDisparity) + radiusX;
			int indexDst = (d-minDisparity)*width + (d-minDisparity);
			int end = indexSrc + (width-d-4*radiusX);
			while( indexSrc < end ) {
				int s = 0;

				// sample four outer regions at the corners around the center region
				int val0 = top[indexSrc-radiusX];
				int val1 = top[indexSrc+radiusX];
				int val2 = bottom[indexSrc-radiusX];
				int val3 = bottom[indexSrc+radiusX];

				// select the two best scores from outer for regions
				if( val1 < val0 ) {
					int temp = val0;
					val0 = val1;
					val1 = temp;
				}

				if( val3 < val2 ) {
					int temp = val2;
					val2 = val3;
					val3 = temp;
				}

				if( val3 < val0 ) {
					s += val2;
					s += val3;
				} else if( val2 < val1 ) {
					s += val2;
					s += val0;
				} else {
					s += val0;
					s += val1;
				}

				score[indexDst++] = s + middle[indexSrc++];
			}
		}
	}
1267452
public static <T> DecomposableMatchBuilder0<List<T>> nil() {
    List<Matcher<Object>> matchers = Lists.of();
    return new DecomposableMatchBuilder0<List<T>>(matchers, new ListConsNilFieldExtractor<>());
  }
1048757
public <K> JavaPairRDD<K, Double> scoreExamples(JavaPairRDD<K, DataSet> data, boolean includeRegularizationTerms,
                    int batchSize) {
        return scoreExamplesMultiDataSet(data.mapToPair(new PairDataSetToMultiDataSetFn<K>()),
                        includeRegularizationTerms, batchSize);
    }
1357853
public ByteBufMono aggregate() {
		return Mono.using(alloc::compositeBuffer,
				b -> this.reduce(b,
				                 (prev, next) -> {
				                     if (prev.refCnt() > 0) {
				                         return prev.addComponent(true, next.retain());
				                     }
				                     else {
				                         return prev;
				                     }
				                 })
				         .filter(ByteBuf::isReadable),
				b -> {
				    if (b.refCnt() > 0) {
				        b.release();
				    }
				})
				.as(ByteBufMono::new);
	}
1358947
public String remainder() {
        StringBuilder accum = new StringBuilder();
        while (!isEmpty()) {
            accum.append(consume());
        }
        return accum.toString();
    }
87545
public function getOverallScore()
    {
        if ($this->environmentalScore != $this->baseScore) {
            return $this->environmentalScore;
        }
        elseif ($this->temporalScore != $this->baseScore) {
            return $this->temporalScore;
        }
        else {
            return $this->baseScore;
        }
    }
961897
private List<ScoredHost> scoreMatches(final List<String> results) {
    final ImmutableList.Builder<ScoredHost> scored = ImmutableList.builder();
    for (final String name : results) {
      int score = Integer.MAX_VALUE;
      for (int i = 0; i < searchPath.length; i++) {
        if (name.endsWith(searchPath[i].toString())) {
          if (i < score) {
            score = i;
          }
        }
      }
      scored.add(new ScoredHost(name, score));
    }
    return scored.build();
  }
966364
public OrderingList<S> mergeRemainderOrdering(CompositeScore<S> other) {
        return getOrderingScore().mergeRemainderOrdering(other.getOrderingScore());
    }
118615
static Matcher removeSequentialMatchAny(Matcher matcher) {
    if (matcher instanceof ZeroOrMoreMatcher) {
      ZeroOrMoreMatcher zm1 = matcher.as();
      if (zm1.repeated() instanceof AnyMatcher && zm1.next() instanceof ZeroOrMoreMatcher) {
        ZeroOrMoreMatcher zm2 = zm1.next().as();
        if (zm2.repeated() instanceof AnyMatcher) {
          return zm2;
        }
      }
    }
    return matcher;
  }
1147642
@Override protected double[] score0(double[] data, double[] preds, double offset, int ntrees) {
    super.score0(data, preds, offset, ntrees);
    if (ntrees >= 1) preds[1] = preds[0] / ntrees;
    preds[0] = normalizePathLength(preds[0]);
    return preds;
  }
440719
@SuppressWarnings("unused") // called through reflection by RequestServer
  public ModelMetricsListSchemaV3 score(int version, ModelMetricsListSchemaV3 s) {
    // parameters checking:
    if (null == s.model) throw new H2OIllegalArgumentException("model", "predict", s.model);
    if (null == DKV.get(s.model.name)) throw new H2OKeyNotFoundArgumentException("model", "predict", s.model.name);

    if (null == s.frame) throw new H2OIllegalArgumentException("frame", "predict", s.frame);
    if (null == DKV.get(s.frame.name)) throw new H2OKeyNotFoundArgumentException("frame", "predict", s.frame.name);

    ModelMetricsList parms = s.createAndFillImpl();

    String customMetricFunc = s.custom_metric_func;
    if (customMetricFunc == null) {
      customMetricFunc = parms._model._parms._custom_metric_func;
    }
    parms._model.score(parms._frame, parms._predictions_name, null, true, CFuncRef.from(customMetricFunc)).remove(); // throw away predictions, keep metrics as a side-effect
    ModelMetricsListSchemaV3 mm = this.fetch(version, s);

    // TODO: for now only binary predictors write an MM object.
    // For the others cons one up here to return the predictions frame.
    if (null == mm)
      mm = new ModelMetricsListSchemaV3();

    if (null == mm.model_metrics || 0 == mm.model_metrics.length) {
      Log.warn("Score() did not return a ModelMetrics for model: " + s.model + " on frame: " + s.frame);
    }

    return mm;
  }
70451
public double normalize() {
        double propSum = this.getSum();
        if (propSum == s.zero()) {
            this.fill(s.divide(s.one(), s.fromReal(this.size())));
        } else if (propSum == s.posInf()) {
            int count = count(s.posInf());
            if (count == 0) {
                throw new RuntimeException("Unable to normalize since sum is infinite but contains no infinities: " + this.toString());
            }
            double constant = s.divide(s.one(), s.fromReal(count));
            for (int d=0; d<this.size(); d++) {
                if (this.getValue(d) == s.posInf()) {
                    this.setValue(d, constant);
                } else {
                    this.setValue(d, s.zero());
                }
            }
        } else {
            this.divide(propSum);
            assert !this.containsNaN();
        }
        return propSum;
    }
448946
function composite ( comb, zero ) {
        return function ( conf, value, fieldMeta ) {
            var validators = conf.value;
            return reduce(function ( acc, v ) {
                var f = VALIDATORS[ v.rule ];
                checkRuleExistence( f, v.rule );
                return comb( acc, f( v, value, fieldMeta ) );
            }, zero, validators ); 
        };
    }
119574
public static TransposeDataCollection weightedProbabilitySampling(AssociativeArray2D strataFrequencyTable, AssociativeArray nh, boolean withReplacement) {
        TransposeDataCollection sampledIds = new TransposeDataCollection(); 
    
        for(Map.Entry<Object, AssociativeArray> entry : strataFrequencyTable.entrySet()) {
            Object strata = entry.getKey();
            
            Number sampleN =  ((Number)nh.get(strata));
            if(sampleN==null) {
                continue;
            }
            
            sampledIds.put(strata, SimpleRandomSampling.weightedSampling(entry.getValue(), sampleN.intValue(), withReplacement));
        }
        
        return sampledIds;
    }