com.linkedin.dagli.preparer.PreparerVariadic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
DAG-oriented machine learning framework for bug-resistant, readable, efficient, maintainable and trivially deployable models in Java and other JVM languages
package com.linkedin.dagli.preparer;
import com.linkedin.dagli.objectio.ObjectReader;
import com.linkedin.dagli.transformer.PreparedTransformerVariadic;
import java.util.Arrays;
import java.util.List;
/**
* Base interface for preparers of variadic-arity transformers.
*
* @param the type of value produced by the transformer.
* @param the type of the resultant prepared transformer.
*/
public interface PreparerVariadic> extends Preparer {
@Override
default void processUnsafe(Object[] values) {
// we don't own values, so we create a clone to prevent values from escaping
process((List) Arrays.asList(values.clone()));
}
/**
* Processes a single example of preparation data. To prepare a {@link Preparer}, process(...) will be called on
* each and every preparation example before finish(...) is called to complete preparation.
*
* This method is not assumed to be thread-safe and will not be invoked concurrently on the same {@link Preparer}.
*
* @param values The input values. The Preparer must not modify this list.
*/
void process(List values);
@Override
default PreparerResultMixed extends PreparedTransformerVariadic super V, ? extends R>, N> finishUnsafe(
ObjectReader
© 2015 - 2024 Weber Informatics LLC | Privacy Policy