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

com.linkedin.dagli.transformer.Value4FromTuple 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
// AUTOGENERATED CODE.  DO NOT MODIFY DIRECTLY!  Instead, please modify the transformer/ValueXFromTuple.ftl file.
// See the README in the module's src/template directory for details.
package com.linkedin.dagli.transformer;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import com.linkedin.dagli.annotation.equality.ValueEquality;
import com.linkedin.dagli.producer.Producer;
import com.linkedin.dagli.reducer.InverseClassReducer;
import com.linkedin.dagli.reducer.Reducer;
import com.linkedin.dagli.tuple.TupleValue4;


/**
 * Transformer that extracts the fifth element from a tuple.
 */
@ValueEquality
public class Value4FromTuple extends
    AbstractPreparedTransformer1WithInput, E, Value4FromTuple> {
  private static final long serialVersionUID = 1;
  private static final List REDUCERS = Collections.singletonList(new InverseClassReducer(4,
      Tupled5.class, Tupled6.class, Tupled7.class, Tupled8.class, Tupled9.class, Tupled10.class));

  /**
   * Creates a new instance that will extract elements from the provided input tuple.
   *
   * @param input the producer providing tuples whose fifth element will be extracted
   */
  public Value4FromTuple(Producer> input) {
    super(input);
  }

  @Override
  protected Collection>> getGraphReducers() {
    return REDUCERS;
  }

  @Override
  public E apply(TupleValue4 value) {
    return value.get4();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy