Library for developing an engine using luigi. Key features are:
- auto-naming capability defines the output file name from task parameters.
load_output
offers an interface to load the output object from a parental task.- Hyperparameter tuning task
- luigi
- numpy
- sklearn
pip install .
See example.py
.
There are four tasks in example.py
:
DataPreprocessing
task prepares training and validation data sets.Train
task, given the result ofDataPreprocessing
, trains a ridge regression model using the training data.PerformanceEvaluation
task, given the results of the above two tasks, evaluates the model on the validation set.HyperparameterOptimization
task optimizes the parameters included inPerformanceEvaluation
task so as to minimize the validation loss.
The following command is used to run HyperparameterOptimization
and evaluate the test score:
python example.py TestPerformanceEvaluation --working-dir example_working_dir
and the results (sqlite db) are stored under example_working_dir/OUTPUT/TestPerformanceEvaluation
.
Log is stored in ENGLOG/engine.log
- All tasks must inherit
AutoNamingTask
, instead ofluigi.Task
. - Task dependencies are described in
requires
in the same way asluigi
, except thatrequires
must return a list of task instances even if it depends on a single task. - Task process should be described in
run_task
(instead ofrun
), whose- input is
input_list
, a list of output Python objects of dependent tasks, and - output is Python objects of this task's computation results.
- input is
- The above Python objects are then processed by
save_output
to be pickled and gzipped.- If the user wants to choose other data formats, please implement
save_output
andload_output
, wheresave_output
is used to save the output objects ofrun_task
, andload_output
is used to load the Python objects for further processing. - A class variable
output_ext
specifies the file extension. - Please set it as
output_ext = luigi.Parameter('[your file extension]')
- If the user wants to choose other data formats, please implement
- Hiroshi Kajino
- Takeshi Teshima