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

com.expleague.ml.cli.builders.data.impl.CatBoostPoolReader Maven / Gradle / Ivy

package com.expleague.ml.cli.builders.data.impl;

import com.expleague.ml.data.tools.CatBoostPoolDescription;
import com.expleague.ml.data.tools.DataTools;
import com.expleague.ml.data.tools.Pool;
import com.expleague.ml.cli.builders.data.PoolReader;

import java.io.File;
import java.io.IOException;

/**
 * Created by noxoomo on 15/10/2017.
 */
public class CatBoostPoolReader  implements PoolReader {
  private CatBoostPoolDescription poolDescription;

  public CatBoostPoolReader(final CatBoostPoolDescription poolDescription) {
    this.poolDescription = poolDescription;
  }

  @Override
  public Pool read(String path) {
    try {
      return DataTools.loadFromCatBoostPool(poolDescription, DataTools.gzipOrFileReader(new File(path)));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy