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

com.flipkart.fdp.ml.adapter.Log1PScalerModelInfoAdapter 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.Log1PScaler;
import com.flipkart.fdp.ml.modelinfo.Log1PScalerModelInfo;
import org.apache.spark.sql.DataFrame;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Transforms {@link Log1PScaler} in MlLib to  {@link Log1PScalerModelInfo} object
 * that can be exported through {@link com.flipkart.fdp.ml.export.ModelExporter}
 */
public class Log1PScalerModelInfoAdapter extends AbstractModelInfoAdapter {

    @Override
    public Log1PScalerModelInfo getModelInfo(final Log1PScaler from, DataFrame df) {
        Log1PScalerModelInfo modelInfo = new Log1PScalerModelInfo();

        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 Log1PScaler.class;
    }

    @Override
    public Class getTarget() {
        return Log1PScalerModelInfo.class;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy