com.linkedin.dagli.preparer.TrivialPreparerDynamic 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.transformer.PreparedTransformer;
/**
* Trivial "preparer" that simply returns a provided, prepared transformer.
* @param the type of result produced by the prepared transformer.
* @param the type of prepared transformer that will be returned
*/
public class TrivialPreparerDynamic> extends AbstractStreamPreparerDynamic {
private final N _preparedForNewData;
private final PreparedTransformer extends R> _preparedForPreparationData;
/**
* Creates a new instance that will "prepare" the provided transformer.
*
* @param prepared the transformer which will result from this preparer.
*/
public TrivialPreparerDynamic(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 TrivialPreparerDynamic(PreparedTransformer extends R> preparedForPreparationData, N preparedForNewData) {
_preparedForNewData = preparedForNewData;
_preparedForPreparationData = preparedForPreparationData;
}
@Override
public void processUnsafe(Object[] values) { }
@Override
public PreparerResultMixed extends PreparedTransformer extends R>, N> finish() {
return new PreparerResultMixed<>(_preparedForPreparationData, _preparedForNewData);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy