Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the batch generation method of update parameters in the v1 version of VNPY parameter optimization function

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about the VNPY parameter optimization function v1 version of the update parameter batch generation method is what, the editor thinks it is very practical, so share it with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

Parameter optimization function of VNPY is an important function of policy optimization. The main thing is to generate a batch combination of parameters according to the range, and then run in batches to select the best method.

The addParameter method in ctaBaclesting.py provides a way to import parameters in bulk. It is such a parameter to fill in. AddParameter will generate a parameter queue with 1 as the beginning, 5 as the end, and 2 as the step.

Setting.addParameter ('barMins', 1, 5, 2)

However, sometimes there are many parameters, so it is difficult to support them if the parameters have already been maintained in list. I wrote a v2 version. What is passed in is key, and a parameter definition, which can be tuple meta-ancestor, queue list, or a single value.

#-def addParameterV2 (self, key, value): "add optimization parameters"if isinstance (value)" Tuple): if len (value) = 4: if value [3] = = "int": self.paramDict [key] = np.linspace (value [0], value [1], value [2]) .astype (int) .tolist () else: self.paramDict [key] = np.linspace (value [0], value [1]) Value [2]) .tolist () elif len (value) = = 3: l = [] param = value [0] while param

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report