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

com.linkedin.dagli.preparer.TrivialPreparerVariadic Maven / Gradle / Ivy

Go to download

DAG-oriented machine learning framework for bug-resistant, readable, efficient, maintainable and trivially deployable models in Java and other JVM languages

There is a newer version: 15.0.0-beta9
Show newest version
package com.linkedin.dagli.preparer;

import com.linkedin.dagli.transformer.PreparedTransformerVariadic;
import java.util.List;

/**
 * Trivial "preparer" that simply returns a provided, prepared transformer.
 * @param  the nominal type of the values provided as an input to the preparer (these will be ignored)
 * @param  the type of result produced by the prepared transformer.
 * @param  the type of prepared transformer that will be returned
 */
public class TrivialPreparerVariadic>
    extends AbstractStreamPreparerVariadic {
  private final N _preparedForNewData;
  private final PreparedTransformerVariadic _preparedForPreparationData;

  /**
   * Creates a new instance that will "prepare" the provided transformer.
   *
   * @param prepared the transformer which will result from this preparer.
   */
  public TrivialPreparerVariadic(N prepared) {
    _preparedForNewData = prepared;
    _preparedForPreparationData = prepared;
  }

  /**
   * Creates a new instance that will "prepare" the provided transformers.
   *
   * @param preparedForPreparationData the transformer to be used for preparation data
   * @param preparedForNewData the transformer to be used for new data
   */
  public TrivialPreparerVariadic(PreparedTransformerVariadic preparedForPreparationData,
      N preparedForNewData) {
    _preparedForNewData = preparedForNewData;
    _preparedForPreparationData = preparedForPreparationData;
  }

  @Override
  public void process(List values) { }

  @Override
  public PreparerResultMixed, N>  finish() {
    return new PreparerResultMixed<>(_preparedForPreparationData, _preparedForNewData);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy