MCPcopy
hub / github.com/microsoft/qlib / run

Method run

examples/run_all_model.py:225–381  ·  view source on GitHub ↗

Please be aware that this function can only work under Linux. MacOS and Windows will be supported in the future. Any PR to enhance this method is highly welcomed. Besides, this script doesn't support parallel running the same model for multiple times, and this will be fixed

(
        self,
        times=1,
        models=None,
        dataset="Alpha360",
        universe="",
        exclude=False,
        qlib_uri: str = "git+https://github.com/microsoft/qlib#egg=pyqlib",
        exp_folder_name: str = "run_all_model_records",
        wait_before_rm_env: bool = False,
        wait_when_err: bool = False,
    )

Source from the content-addressed store, hash-verified

223 # function to run the all the models
224 @only_allow_defined_args
225 def run(
226 self,
227 times=1,
228 models=None,
229 dataset="Alpha360",
230 universe="",
231 exclude=False,
232 qlib_uri: str = "git+https://github.com/microsoft/qlib#egg=pyqlib",
233 exp_folder_name: str = "run_all_model_records",
234 wait_before_rm_env: bool = False,
235 wait_when_err: bool = False,
236 ):
237 """
238 Please be aware that this function can only work under Linux. MacOS and Windows will be supported in the future.
239 Any PR to enhance this method is highly welcomed. Besides, this script doesn't support parallel running the same model
240 for multiple times, and this will be fixed in the future development.
241
242 Parameters:
243 -----------
244 times : int
245 determines how many times the model should be running.
246 models : str or list
247 determines the specific model or list of models to run or exclude.
248 exclude : boolean
249 determines whether the model being used is excluded or included.
250 dataset : str
251 determines the dataset to be used for each model.
252 universe : str
253 the stock universe of the dataset.
254 default "" indicates that
255 qlib_uri : str
256 the uri to install qlib with pip
257 it could be URI on the remote or local path (NOTE: the local path must be an absolute path)
258 exp_folder_name: str
259 the name of the experiment folder
260 wait_before_rm_env : bool
261 wait before remove environment.
262 wait_when_err : bool
263 wait when errors raised when executing commands
264
265 Usage:
266 -------
267 Here are some use cases of the function in the bash:
268
269 The run_all_models will decide which config to run based no `models` `dataset` `universe`
270 Example 1):
271
272 models="lightgbm", dataset="Alpha158", universe="" will result in running the following config
273 examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
274
275 models="lightgbm", dataset="Alpha158", universe="csi500" will result in running the following config
276 examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158_csi500.yaml
277
278 .. code-block:: bash
279
280 # Case 1 - run all models multiple times
281 python run_all_model.py run 3
282

Callers 3

data_cache_demo.pyFile · 0.45
fitMethod · 0.45

Calls 10

_init_qlibMethod · 0.95
_collect_resultsMethod · 0.95
get_all_foldersFunction · 0.85
get_all_filesFunction · 0.85
create_envFunction · 0.85
executeFunction · 0.85
writeMethod · 0.45
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected