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

hex.genmodel.algos.deepwater.DWTextConverter Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
package hex.genmodel.algos.deepwater;

import hex.genmodel.GenModel;
import hex.genmodel.easy.CategoricalEncoder;
import hex.genmodel.easy.EasyPredictModelWrapper;
import hex.genmodel.easy.RowToRawDataConverter;
import hex.genmodel.easy.exception.PredictException;

import java.util.Map;

public class DWTextConverter extends RowToRawDataConverter {

  DWTextConverter(GenModel m, Map modelColumnNameToIndexMap, Map domainMap,
                  EasyPredictModelWrapper.ErrorConsumer errorConsumer, EasyPredictModelWrapper.Config config) {
    super(m, modelColumnNameToIndexMap, domainMap, errorConsumer, config);
  }

  @Override
  protected boolean convertValue(String columnName, Object o, CategoricalEncoder catEncoder, int targetIndex, double[] rawData) throws PredictException {
    if (o instanceof String) {
      throw new PredictException("MOJO scoring for text classification is not yet implemented.");
    }
    return super.convertValue(columnName, o, catEncoder, targetIndex, rawData);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy