com.flipkart.fdp.ml.adapter.AlgebraicTransformModelInfoAdapter Maven / Gradle / Ivy
package com.flipkart.fdp.ml.adapter;
import com.flipkart.fdp.ml.AlgebraicTransform;
import com.flipkart.fdp.ml.modelinfo.AlgebraicTransformModelInfo;
import org.apache.spark.sql.DataFrame;
import java.util.LinkedHashSet;
import java.util.Set;
/**
* Created by shubhranshu.shekhar on 18/08/16.
*/
public class AlgebraicTransformModelInfoAdapter extends AbstractModelInfoAdapter {
@Override
public AlgebraicTransformModelInfo getModelInfo(final AlgebraicTransform from, DataFrame df) {
AlgebraicTransformModelInfo modelInfo = new AlgebraicTransformModelInfo();
modelInfo.setCoefficients(from.getCoefficients());
Set inputKeys = new LinkedHashSet();
inputKeys.add(from.getInputCol());
modelInfo.setInputKeys(inputKeys);
Set outputKeys = new LinkedHashSet();
outputKeys.add(from.getOutputCol());
modelInfo.setOutputKeys(outputKeys);
return modelInfo;
}
@Override
public Class getSource() {
return AlgebraicTransform.class;
}
@Override
public Class getTarget() {
return AlgebraicTransformModelInfo.class;
}
}