AdaptiveLogisticRegression implements OnlineLearner, Writable { public static int stepSize(int recordNumber, double multiplier) { int[] bumps = {1, 2, 5}; double log = Math.floor(multiplier * Math.log10(recordNumber)); int bump = bumps[(int) log % bumps.length]; int scale = (int) Math.pow(10, Math.floor(log / bumps.length)); return bump * scale; } AdaptiveLogisticRegression();  AdaptiveLogisticRegression(int numCategories, int numFeatures, PriorFunction prior);  AdaptiveLogisticRegression(int numCategories, int numFeatures, PriorFunction prior, int threadCount,
      int poolSize); @Override void train(int actual, Vector instance); @Override void train(long trackingKey, int actual, Vector instance); @Override void train(long trackingKey, String groupKey, int actual, Vector instance); int nextStep(int recordNumber); static int stepSize(int recordNumber, double multiplier); @Override void close(); void setInterval(int interval); void setInterval(int minInterval, int maxInterval); final void setPoolSize(int poolSize); void setThreadCount(int threadCount); void setAucEvaluator(OnlineAuc auc); int numFeatures(); double auc(); State<Wrapper, CrossFoldLearner> getBest(); void setBest(State<Wrapper, CrossFoldLearner> best); int getRecord(); void setRecord(int record); int getMinInterval(); int getMaxInterval(); int getNumCategories(); PriorFunction getPrior(); void setBuffer(List<TrainingExample> buffer); List<TrainingExample> getBuffer(); EvolutionaryProcess<Wrapper, CrossFoldLearner> getEp(); void setEp(EvolutionaryProcess<Wrapper, CrossFoldLearner> ep); State<Wrapper, CrossFoldLearner> getSeed(); void setSeed(State<Wrapper, CrossFoldLearner> seed); int getNumFeatures(); void setAveragingWindow(int averagingWindow); void setFreezeSurvivors(boolean freezeSurvivors); @Override void write(DataOutput out); @Override void readFields(DataInput in); static final int DEFAULT_THREAD_COUNT; static final int DEFAULT_POOL_SIZE; }
@Test public void stepSize() { assertEquals(500, AdaptiveLogisticRegression.stepSize(15000, 2)); assertEquals(2000, AdaptiveLogisticRegression.stepSize(15000, 2.6)); assertEquals(5000, AdaptiveLogisticRegression.stepSize(24000, 2.6)); assertEquals(10000, AdaptiveLogisticRegression.stepSize(15000, 3)); }