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

hex.genmodel.easy.EnumEncoderColumnMapper Maven / Gradle / Ivy

There is a newer version: 3.46.0.5
Show newest version
package hex.genmodel.easy;

import hex.genmodel.GenModel;

import java.util.HashMap;
import java.util.Map;

public class EnumEncoderColumnMapper {

  protected final GenModel _m;

  public EnumEncoderColumnMapper(GenModel m) {
    _m = m;
  }

  public String[] getModelColumnNames() {
    return _m.getNames();
  }
  
  public Map create() {
    String[] modelColumnNames = getModelColumnNames();
    Map modelColumnNameToIndexMap = new HashMap<>(modelColumnNames.length);
    for (int i = 0; i < modelColumnNames.length; i++) {
      modelColumnNameToIndexMap.put(modelColumnNames[i], i);
    }
    return modelColumnNameToIndexMap;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy