001/*
002 * Copyright (c) 2015-2020, Oracle and/or its affiliates. All rights reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.tribuo.classification.sgd.linear;
018
019import org.tribuo.Trainer;
020import org.tribuo.classification.sgd.objectives.LogMulticlass;
021import org.tribuo.math.optimisers.AdaGrad;
022
023import java.util.logging.Logger;
024
025/**
026 * A logistic regression trainer that uses a reasonable objective, optimiser,
027 * number of epochs and minibatch size. If you wish to modify any of these 
028 * aspects, you can create your own LinearSGDTrainer.
029 * <p>
030 * This is strictly a convenience class for folks who are looking for
031 * a simple logistic regression.
032 */
033public class LogisticRegressionTrainer extends LinearSGDTrainer {
034    private static final Logger logger = Logger.getLogger(LogisticRegressionTrainer.class.getName());
035    
036    public LogisticRegressionTrainer() {
037        super(new LogMulticlass(), new AdaGrad(1.0, 0.1), 5, Trainer.DEFAULT_SEED);
038    }
039}