Skip to content
Permalink
Browse files
Renamed XGBoostUDTF as XGBoostBaseUDTF
  • Loading branch information
myui committed Oct 31, 2019
1 parent c73ecde commit 0a10aac92674a533bb84806cb2cdecd5ec478af8
Showing 4 changed files with 11 additions and 10 deletions.
@@ -54,8 +54,8 @@
* This is a base class to handle the options for XGBoost and provide common functions among various
* tasks.
*/
public abstract class XGBoostUDTF extends UDTFWithOptions {
private static final Log logger = LogFactory.getLog(XGBoostUDTF.class);
public abstract class XGBoostBaseUDTF extends UDTFWithOptions {
private static final Log logger = LogFactory.getLog(XGBoostBaseUDTF.class);

// Settings for the XGBoost native library
static {
@@ -106,7 +106,7 @@ public abstract class XGBoostUDTF extends UDTFWithOptions {
params.put("base_score", 0.5);
}

public XGBoostUDTF() {
public XGBoostBaseUDTF() {
this.featuresList = new ArrayList<>(1024);
}

@@ -18,7 +18,7 @@
*/
package hivemall.xgboost.classification;

import hivemall.xgboost.XGBoostUDTF;
import hivemall.xgboost.XGBoostBaseUDTF;

import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.metadata.HiveException;
@@ -28,8 +28,9 @@
* https://github.com/dmlc/xgboost/tree/master/demo/binary_classification
*/
@Description(name = "train_xgboost_classifier",
value = "_FUNC_(string[] features, double target [, string options]) - Returns a relation consisting of <string model_id, array<byte> pred_model>")
public final class XGBoostBinaryClassifierUDTF extends XGBoostUDTF {
value = "_FUNC_(array<string> features, double target [, string options])"
+ " - Returns a relation consisting of <string model_id, array<byte> pred_model>")
public final class XGBoostBinaryClassifierUDTF extends XGBoostBaseUDTF {

public XGBoostBinaryClassifierUDTF() {
super();
@@ -18,7 +18,7 @@
*/
package hivemall.xgboost.classification;

import hivemall.xgboost.XGBoostUDTF;
import hivemall.xgboost.XGBoostBaseUDTF;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Options;
@@ -33,7 +33,7 @@
*/
@Description(name = "train_multiclass_xgboost_classifier",
value = "_FUNC_(string[] features, double target [, string options]) - Returns a relation consisting of <string model_id, array<byte> pred_model>")
public final class XGBoostMulticlassClassifierUDTF extends XGBoostUDTF {
public final class XGBoostMulticlassClassifierUDTF extends XGBoostBaseUDTF {

public XGBoostMulticlassClassifierUDTF() {
super();
@@ -21,15 +21,15 @@
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.metadata.HiveException;

import hivemall.xgboost.XGBoostUDTF;
import hivemall.xgboost.XGBoostBaseUDTF;

/**
* A XGBoost regression and the document is as follows; -
* https://github.com/dmlc/xgboost/tree/master/demo/regression
*/
@Description(name = "train_xgboost_regr",
value = "_FUNC_(string[] features, double target [, string options]) - Returns a relation consisting of <string model_id, array<byte> pred_model>")
public final class XGBoostRegressionUDTF extends XGBoostUDTF {
public final class XGBoostRegressionUDTF extends XGBoostBaseUDTF {

public XGBoostRegressionUDTF() {
super();

0 comments on commit 0a10aac

Please sign in to comment.