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

com.flipkart.fdp.ml.adapter.AlgebraicTransformModelInfoAdapter Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy