All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.expleague.ml.cli.builders.methods.impl.LassoGreedyObliviousTreeBuilder Maven / Gradle / Ivy

There is a newer version: 1.4.9
Show newest version
package com.expleague.ml.cli.builders.methods.impl;

import com.expleague.commons.func.Factory;
import com.expleague.ml.methods.VecOptimization;
import com.expleague.ml.methods.trees.GreedyObliviousTree;
import com.expleague.ml.methods.trees.LassoGreedyObliviousTree;

/**
 * User: noxoomo
 */

public class LassoGreedyObliviousTreeBuilder implements Factory {
  private int nlambda = 50;
  private double alpha = 0.5;
  private GreedyObliviousTree weak;
  private final GreedyObliviousTreeBuilder defaultWeakBuilder = new GreedyObliviousTreeBuilder();

  public void setWeak(final GreedyObliviousTree weak) {
    this.weak = weak;
  }

  public void setnlambda(final int nlambda) {
    this.nlambda = nlambda;
  }

  public void setAlpha(final double alpha) {
    this.alpha = alpha;
  }

  @Override
  public VecOptimization create() {
    if (weak == null) {
      weak = (GreedyObliviousTree) defaultWeakBuilder.create();

    }
    //noinspection unchecked
    return new LassoGreedyObliviousTree(weak,  nlambda, alpha);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy