当前位置: 首页>>代码示例>>Java>>正文


Java LocalFileSystem.DEFAULT_FS属性代码示例

本文整理汇总了Java中org.apache.hadoop.fs.LocalFileSystem.DEFAULT_FS属性的典型用法代码示例。如果您正苦于以下问题:Java LocalFileSystem.DEFAULT_FS属性的具体用法?Java LocalFileSystem.DEFAULT_FS怎么用?Java LocalFileSystem.DEFAULT_FS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.fs.LocalFileSystem的用法示例。


在下文中一共展示了LocalFileSystem.DEFAULT_FS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: incTrain

public void incTrain() {
  setConf();
  String inputPath = "../data/exampledata/LRLocalExampleData/a9a.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String loadPath = LOCAL_FS + TMP_PATH + "/model";
  String savePath = LOCAL_FS + TMP_PATH + "/newmodel";
  String logPath = LOCAL_FS + TMP_PATH + "/log";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set load model path
  conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, loadPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, savePath);
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType incremental train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_INC_TRAIN());

  LRRunner runner = new LRRunner();
  runner.incTrain(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:23,代码来源:SGDLRLocalExample.java

示例2: trainOnLocalCluster

public void trainOnLocalCluster() throws Exception {
  setConf();
  String inputPath = "../data/exampledata/LRLocalExampleData/a9a.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String savePath = LOCAL_FS + TMP_PATH + "/model";
  String logPath = LOCAL_FS + TMP_PATH + "/log";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, savePath);
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());


  LRRunner runner = new LRRunner();
  runner.train(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:21,代码来源:SGDLRLocalExample.java

示例3: predict

public void predict() {
  setConf();
  String inputPath = "../data/exampledata/LRLocalExampleData/a9a.test";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String loadPath = LOCAL_FS + TMP_PATH + "/model";
  String savePath = LOCAL_FS + TMP_PATH + "/model";
  String logPath = LOCAL_FS + TMP_PATH + "/log";
  String predictPath = LOCAL_FS + TMP_PATH + "/predict";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_PREDICT_DATA_PATH, inputPath);
  // Set load model path
  conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, loadPath);
  // Set predict result path
  conf.set(AngelConf.ANGEL_PREDICT_PATH, predictPath);
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType prediction
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_PREDICT());

  LRRunner runner = new LRRunner();

  runner.predict(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:25,代码来源:SGDLRLocalExample.java

示例4: trainOnLocalCluster

public void trainOnLocalCluster() throws Exception {
  setConf();
  String inputPath = "../data/exampledata/LinearRegression";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String logPath = "./src/test/log";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());


  LinearRegRunner runner = new LinearRegRunner();
  runner.train(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:20,代码来源:LinearRegLocalExample.java

示例5: incTrain

public void incTrain() {
  setConf();
  String inputPath = "../data/exampledata/LinearRegression/LinearReg100.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String logPath = "./src/test/log";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set load model path
  conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/newmodel");
  // Set actionType incremental train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_INC_TRAIN());
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);

  LinearRegRunner runner = new LinearRegRunner();
  runner.incTrain(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:21,代码来源:LinearRegLocalExample.java

示例6: predict

public void predict() {
  setConf();
  String inputPath = "../data/exampledata/LinearRegression/LinearReg100.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set load model path
  conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
  // Set predict result path
  conf.set(AngelConf.ANGEL_PREDICT_PATH, LOCAL_FS + TMP_PATH + "/predict");
  // Set actionType prediction
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_PREDICT());
  LinearRegRunner runner = new LinearRegRunner();

  runner.predict(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:18,代码来源:LinearRegLocalExample.java

示例7: trainOnLocalClusterTest

@Test
public void trainOnLocalClusterTest() throws Exception {
  String inputPath = "./src/test/data/fm/food_fm_libsvm";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String savePath = LOCAL_FS + TMP_PATH + "/model";
  String logPath = LOCAL_FS + TMP_PATH + "/LRlog";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, savePath);
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());

  FMRunner runner = new FMRunner();
  runner.train(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:20,代码来源:FMTest.java

示例8: FMClassificationTest

@Test
public void FMClassificationTest() throws Exception {
  String inputPath = "./src/test/data/fm/a9a.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String savePath = LOCAL_FS + TMP_PATH + "/model";
  String logPath = LOCAL_FS + TMP_PATH + "/LRlog";

  // Set trainning data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, savePath);
  // Set log path
  conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());
  // Set learnType
  conf.set(MLConf.ML_FM_LEARN_TYPE(), "c");
  // Set feature number
  conf.set(MLConf.ML_FEATURE_NUM(), String.valueOf(124));

  FMRunner runner = new FMRunner();
  runner.train(conf);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:24,代码来源:FMTest.java

示例9: trainOnLocalClusterTest

private void trainOnLocalClusterTest() throws Exception {
  try {
    String inputPath = "./src/test/data/LinearRegression/LinearReg100.train";
    String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
    String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
    String logPath = "./src/test/log";

    // Set trainning data path
    conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
    // Set save model path
    conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
    // Set log path
    conf.set(AngelConf.ANGEL_LOG_PATH, logPath);
    // Set actionType train
    conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());

    LinearRegRunner runner = new LinearRegRunner();
    runner.train(conf);
  } catch (Exception x) {
    LOG.error("run trainOnLocalClusterTest failed ", x);
    throw x;
  }
}
 
开发者ID:Tencent,项目名称:angel,代码行数:23,代码来源:LinearRegTest.java

示例10: incTrainTest

private void incTrainTest() throws Exception {
  try {
    String inputPath = "./src/test/data/LinearRegression/LinearReg100.train";
    String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
    String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
    String logPath = "./src/test/log";

    // Set trainning data path
    conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
    // Set load model path
    conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
    // Set save model path
    conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/newmodel");
    // Set actionType incremental train
    conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_INC_TRAIN());
    // Set log path
    conf.set(AngelConf.ANGEL_LOG_PATH, logPath);

    LinearRegRunner runner = new LinearRegRunner();
    runner.incTrain(conf);
  } catch (Exception x) {
    LOG.error("run incTrainTest failed ", x);
    throw x;
  }
}
 
开发者ID:Tencent,项目名称:angel,代码行数:25,代码来源:LinearRegTest.java

示例11: predictTest

private void predictTest() throws Exception {
  try {
    String inputPath = "./src/test/data/LinearRegression/LinearReg100.train";
    String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
    String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");

    // Set trainning data path
    conf.set(AngelConf.ANGEL_PREDICT_DATA_PATH, inputPath);
    // Set load model path
    conf.set(AngelConf.ANGEL_LOAD_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
    // Set predict result path
    conf.set(AngelConf.ANGEL_PREDICT_PATH, LOCAL_FS + TMP_PATH + "/predict");
    // Set log sava path
    conf.set(AngelConf.ANGEL_LOG_PATH, LOCAL_FS + TMP_PATH + "/LOG/log");
    // Set actionType prediction
    conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_PREDICT());

    LinearRegRunner runner = new LinearRegRunner();

    runner.predict(conf);
  } catch (Exception x) {
    LOG.error("run predictTest failed ", x);
    throw x;
  }
}
 
开发者ID:Tencent,项目名称:angel,代码行数:25,代码来源:LinearRegTest.java

示例12: setConf

public void setConf() throws Exception {
  String inputPath = "../data/exampledata/MFLocalExampleData";
  // Set local deploy mode
  conf.set(AngelConf.ANGEL_DEPLOY_MODE, "LOCAL");
  // Set basic configuration keys
  conf.setBoolean("mapred.mapper.new-api", true);
  conf.set(AngelConf.ANGEL_INPUTFORMAT_CLASS, CombineTextInputFormat.class.getName());
  conf.setBoolean(AngelConf.ANGEL_JOB_OUTPUT_PATH_DELETEONEXIST, true);

  // set angel resource parameters #worker, #task, #PS
  conf.setInt(AngelConf.ANGEL_WORKERGROUP_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_WORKER_TASK_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_PS_NUMBER, 1);

  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");

  // Set trainning data, and save model path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
  conf.set(AngelConf.ANGEL_LOG_PATH, LOCAL_FS + TMP_PATH + "/log");
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());

  // Set MF algorithm parameters
  conf.set(MLConf.ML_MF_RANK(), "200");
  conf.set(MLConf.ML_EPOCH_NUM(), "8");
  conf.set(MLConf.ML_MF_ROW_BATCH_NUM(), "2");
  conf.set(MLConf.ML_MF_ITEM_NUM(), "1683");
  conf.set(MLConf.ML_MF_LAMBDA(), "0.01");
  conf.set(MLConf.ML_MF_ETA(), "0.0054");
}
 
开发者ID:Tencent,项目名称:angel,代码行数:32,代码来源:MFLocalExample.java

示例13: setConf

public void setConf() {
  String inputPath = "../data/exampledata/GBDTLocalExampleData/agaricus.txt.train";

  // Feature number of train data
  int featureNum = 127;
  // Number of nonzero features
  int featureNzz = 25;
  // Tree number
  int treeNum = 2;
  // Tree depth
  int treeDepth = 2;
  // Split number
  int splitNum = 10;
  // Feature sample ratio
  double sampleRatio = 1.0;

  // Data format
  String dataFmt = "libsvm";

  // Learning rate
  double learnRate = 0.01;

  // Set basic configuration keys
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");

  conf.setBoolean("mapred.mapper.new-api", true);
  conf.setBoolean(AngelConf.ANGEL_JOB_OUTPUT_PATH_DELETEONEXIST, true);

  // Use local deploy mode and data format
  conf.set(AngelConf.ANGEL_DEPLOY_MODE, "LOCAL");
  conf.set(MLConf.ML_DATA_FORMAT(), String.valueOf(dataFmt));

  // set input, output path
  conf.set(AngelConf.ANGEL_INPUTFORMAT_CLASS, CombineTextInputFormat.class.getName());
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/out");
  conf.set(AngelConf.ANGEL_LOG_PATH, LOCAL_FS + TMP_PATH + "/log");

  // set angel resource parameters #worker, #task, #PS
  conf.setInt(AngelConf.ANGEL_WORKERGROUP_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_WORKER_TASK_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_PS_NUMBER, 1);

  // Set GBDT algorithm parameters
  conf.set(MLConf.ML_FEATURE_NUM(), String.valueOf(featureNum));
  conf.set(MLConf.ML_FEATURE_NNZ(), String.valueOf(featureNzz));
  conf.set(MLConf.ML_GBDT_TREE_NUM(), String.valueOf(treeNum));
  conf.set(MLConf.ML_GBDT_TREE_DEPTH(), String.valueOf(treeDepth));
  conf.set(MLConf.ML_GBDT_SPLIT_NUM(), String.valueOf(splitNum));
  conf.set(MLConf.ML_GBDT_SAMPLE_RATIO(), String.valueOf(sampleRatio));
  conf.set(MLConf.ML_LEARN_RATE(), String.valueOf(learnRate));
}
 
开发者ID:Tencent,项目名称:angel,代码行数:53,代码来源:GBDTLocalExample.java

示例14: setConf

public static Configuration setConf() {
  Configuration conf = new Configuration();

  // Feature number of train data
  int featureNum = 124;
  // Total iteration number
  int epochNum = 20;
  // Learning rate
  double learnRate = 1.0;
  // Regularization coefficient
  double reg = 0.2;

  String inputPath = "./angel-ps/mllib/src/test/data/lr/a9a.train";
  String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
  String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");
  String savePath = LOCAL_FS + TMP_PATH + "/model";

  // Set local deploy mode
  conf.set(AngelConf.ANGEL_DEPLOY_MODE, "LOCAL");

  // Set basic configuration keys
  conf.setBoolean("mapred.mapper.new-api", true);
  conf.set(AngelConf.ANGEL_INPUTFORMAT_CLASS, CombineTextInputFormat.class.getName());
  conf.setBoolean(AngelConf.ANGEL_JOB_OUTPUT_PATH_DELETEONEXIST, true);

  //set angel resource parameters #worker, #task, #PS
  conf.setInt(AngelConf.ANGEL_WORKERGROUP_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_WORKER_TASK_NUMBER, 1);
  conf.setInt(AngelConf.ANGEL_PS_NUMBER, 1);

  //set sgd LR algorithm parameters #feature #epoch
  conf.set(MLConf.ML_FEATURE_NUM(), String.valueOf(featureNum));
  conf.set(MLConf.ML_EPOCH_NUM(), String.valueOf(epochNum));
  conf.set(MLConf.ML_LEARN_RATE(), String.valueOf(learnRate));
  conf.set(MLConf.ML_REG_L2(), String.valueOf(reg));

  // Set input data path
  conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
  // Set save model path
  conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, savePath);
  // Set actionType train
  conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());
  conf.set(MLConf.ML_DATA_FORMAT(), "libsvm");
  return conf;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:45,代码来源:QSLRLocalExample.java

示例15: testMF

@Test
public void testMF() throws Exception {
  try {
    String inputPath = "./src/test/data/recommendation/MovieLensDataSet";

    // Set local deploy mode
    conf.set(AngelConf.ANGEL_DEPLOY_MODE, "LOCAL");
    // Set basic configuration keys
    conf.setBoolean("mapred.mapper.new-api", true);
    conf.set(AngelConf.ANGEL_INPUTFORMAT_CLASS, CombineTextInputFormat.class.getName());
    conf.setBoolean(AngelConf.ANGEL_JOB_OUTPUT_PATH_DELETEONEXIST, true);

    //set angel resource parameters #worker, #task, #PS
    conf.setInt(AngelConf.ANGEL_WORKERGROUP_NUMBER, 1);
    conf.setInt(AngelConf.ANGEL_WORKER_TASK_NUMBER, 1);
    conf.setInt(AngelConf.ANGEL_PS_NUMBER, 1);

    String LOCAL_FS = LocalFileSystem.DEFAULT_FS;
    String TMP_PATH = System.getProperty("java.io.tmpdir", "/tmp");

    // Set trainning data, save model, log path
    conf.set(AngelConf.ANGEL_TRAIN_DATA_PATH, inputPath);
    conf.set(AngelConf.ANGEL_SAVE_MODEL_PATH, LOCAL_FS + TMP_PATH + "/model");
    conf.set(AngelConf.ANGEL_LOG_PATH, LOCAL_FS + TMP_PATH + "/Log/log");
    conf.set(MLConf.ML_MF_USER_OUTPUT_PATH(), LOCAL_FS + TMP_PATH + "/usermodel");
    // Set actionType train
    conf.set(AngelConf.ANGEL_ACTION_TYPE, MLConf.ANGEL_ML_TRAIN());

    // Set MF algorithm parameters
    conf.set(MLConf.ML_MF_RANK(), "200");
    conf.set(MLConf.ML_EPOCH_NUM(), "5");
    conf.set(MLConf.ML_MF_ROW_BATCH_NUM(), "2");
    conf.set(MLConf.ML_MF_ITEM_NUM(), "1683");
    conf.set(MLConf.ML_MF_LAMBDA(), "0.01");
    conf.set(MLConf.ML_MF_ETA(), "0.0005");

    MatrixFactorizationRunner runner = new MatrixFactorizationRunner();
    runner.train(conf);
  } catch (Exception x) {
    LOG.error("run testMF failed ", x);
    throw x;
  }
}
 
开发者ID:Tencent,项目名称:angel,代码行数:43,代码来源:matrixfactorizationTest.java


注:本文中的org.apache.hadoop.fs.LocalFileSystem.DEFAULT_FS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。