Further increase typehints in freqAI interface

This commit is contained in:
Matthias
2023-04-23 19:36:17 +02:00
parent c5dc21e80c
commit ad4996259e
5 changed files with 19 additions and 14 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ Here we create a `PyTorchMLPRegressor` class that implements the `fit` method. T
For example, if you are using a binary classifier to predict price movements as up or down, you can set the class names as follows:
```python
def set_freqai_targets(self, dataframe: DataFrame, metadata: Dict, **kwargs):
def set_freqai_targets(self, dataframe: DataFrame, metadata: Dict, **kwargs) -> DataFrame:
self.freqai.class_names = ["down", "up"]
dataframe['&s-up_or_down'] = np.where(dataframe["close"].shift(-100) >
dataframe["close"], 'up', 'down')