RAPID machine learning Time Series Analysis python interface specifications

This document describes specifications of the RAPID machine learning Time Series Analysis(RAPID TSA) python interface.

Overview

This software is RAPID TSA python interface, which is python interface for RAPID TSA V2.2.

Below is procedure with API of RAPID TSA python interface.

Note

The procedure is the same with RAPID TSA V2.2.

  • For train

    1. Calculates the statistics
    2. Pre-processes the train data
    3. Trains with the label data, and generate the model
  • For predict

    1. Pre-processes the predict data with train’s statistics
    2. Predicts the label with the model

Quickstart

In [ ]:
import os

ROOT_DIR = os.path.abspath(os.path.curdir)
DATA_DIR = os.path.join(ROOT_DIR, 'data')
In [ ]:
# execute preprocess for train

from rapid_tsa_python import exec_preprocess

train_label_path = os.path.join(DATA_DIR, 'train_label_cls.lab')
preprocess_def_path = os.path.join(DATA_DIR, 'preprocess_cls.json')
exec_preprocess(preprocess_def_path, label_path=train_label_path)
In [ ]:
# execute train

from rapid_tsa_python import exec_train

train_preprocessed_label_path = os.path.join(DATA_DIR, 'train_label_cls_preprocessed.lab')
train_parameter_conf_path = os.path.join(DATA_DIR, 'train_param.conf')
model_dir = os.path.join(ROOT_DIR, 'model')
exec_train('cls', '1DCNN', train_preprocessed_label_path, model_dir,
           param_conf_path=train_parameter_conf_path)
In [ ]:
# execute preprocess for predict

predict_label_path = os.path.join(DATA_DIR, 'predict_label_cls.lab')
exec_preprocess(preprocess_def_path, label_path=predict_label_path)
In [ ]:
# execute predict

from rapid_tsa_python import exec_predict

predict_preprocessed_label_path = os.path.join(DATA_DIR, 'predict_label_cls_preprocessed.lab')
result_dir = os.path.join(ROOT_DIR, 'result')
exec_predict(model_dir, label_path=predict_preprocessed_label_path, output_dir=result_dir)

Input Specification

Data and config files of RAPID TSA python interface are same with RAPID TSA V2.2. So, refer to chapter 6 of RAPID TSA V2.2 User Guide.

Others

Logging and Error messages

Logging and error messages are output in log file following with RAPID TSA V2.2. So, refer to chapter 6.7 of RAPID TSA V2.2 User Guide.

Note

You can see log file with cat, less or etc. command at Jupyter Terminal. And log file is outputted at /var/log/nec/rapid/TSA_<index>.log and /var/log/nec/rapid/MLE_<index>.log by default.