freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
28.1k stars 6.02k forks source link

warning during training about variable not used and performance issue also need to know if sharing knowledge is possible between different models #9062

Closed S-shekharDuggal closed 1 year ago

S-shekharDuggal commented 1 year ago

Describe your environment

Your question

1) this warning is given by compiler that there is some variable name activate that defined but not used "activate" where could it be defined as I didn't use any variable named activate? 2) i used the code as it is just changed the name of variable to store why this error is there in the log warning about performance? this warning just came for ETH/USDT but worked just fine for BTC/USDT... dataframe["&-target"]=( dataframe["close"] .shift(-self.freqai_info["feature_parameters"]["label_period_candles"]) .rolling(self.freqai_info["feature_parameters"]["label_period_candles"]) .mean() / dataframe["close"]

2023-08-16 10:53:12 2023-08-16 05:23:12,063 - freqtrade.freqai.base_models.BaseRegressionModel - INFO - -------------------- Done training ETH/USDT:USDT (17.37 secs) -------------------- 2023-08-16 10:53:12 2023-08-16 05:23:12,063 - freqtrade.freqai.freqai_interface - INFO - Saving backtest model to disk. 2023-08-16 10:53:12 [05:23:12] WARNING: ../src/learner.cc:767: 2023-08-16 10:53:12 Parameters: { "activate" } are not used. 2023-08-16 10:53:12 2023-08-16 10:53:12 2023-08-16 05:23:12,840 - freqtrade.freqai.freqai_interface - INFO - Training ETH/USDT:USDT, 2/8 pairs from 2022-10-07 00:00:00 to 2022-10-12 00:00:00, 2/102 trains 2023-08-16 10:53:12 2023-08-16 05:23:12,858 - freqtrade.freqai.data_kitchen - INFO - Could not find backtesting prediction file at /freqtrade/user_data/models/Raw5/backtesting_predictions/cb_eth_1665532800_prediction.feather 2023-08-16 10:53:12 /freqtrade/user_data/strategies/myAI2.py:309: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling frame.insert many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy() 2023-08-16 10:53:12 dataframe["&-target"]=( 2023-08-16 10:53:12 /freqtrade/user_data/strategies/myAI2.py:309: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling frame.insert many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy() 2023-08-16 10:53:12 dataframe["&-target"]=( 2023-08-16 10:53:13 2023-08-16 05:23:13,076 - freqtrade.freqai.freqai_interface - INFO - Could not find model at /freqtrade/user_data/models/Raw5/sub-train-ETH_1665532800/cb_eth_1665532800 2023-08-16 10:53:13 2023-08-16 05:23:13,077 - freqtrade.freqai.base_models.BaseRegressionModel - INFO - -------------------- Starting training ETH/USDT:USDT -------------------- 2023-08-16 10:53:13 2023-08-16 05:23:13,244 - freqtrade.freqai.data_kitchen - INFO - ETH/USDT:USDT: dropped 20 training points due to NaNs in populated dataset 2400. 2023-08-16 10:53:13 2023-08-16 05:23:13,245 - freqtrade.freqai.base_models.BaseRegressionModel - INFO - -------------------- Training on data from 2022-10-07 to 2022-10-11 -------------------- 2023-08-16 10:53:22 2023-08-16 05:23:22,622 - datasieve.pipeline - INFO - reduced feature dimension by 239 2023-08-16 10:53:22 2023-08-16 05:23:22,623 - datasieve.pipeline - INFO - explained variance 0.9990670996499674 2023-08-16 10:53:22 2023-08-16 05:23:22,718 - datasieve.pipeline - INFO - SVM detected 34 data points as outliers. 2023-08-16 10:53:23 2023-08-16 05:23:23,325 - datasieve.pipeline - INFO - SVM detected 6 data points as outliers. 2023-08-16 10:53:23 2023-08-16 05:23:23,520 - datasieve.pipeline - INFO - DI tossed 126 predictions for being too far from training data. 2023-08-16 10:53:23 2023-08-16 05:23:23,533 - freqtrade.freqai.base_models.BaseRegressionModel - INFO - Training model on 67 features 2023-08-16 10:53:23 2023-08-16 05:23:23,533 - freqtrade.freqai.base_models.BaseRegressionModel - INFO - Training model on 1560 data points 2023-08-16 10:53:23 [05:23:23] WARNING: ../src/learner.cc:767: 2023-08-16 10:53:23 Parameters: { "activate" } are not used. 2023-08-16 10:53:23 2023-08-16 10:53:24 [0] validation_0-rmse:0.24321

xmatthias commented 1 year ago

"activate" most likely comes from your freqAI configuration - most likely from model_training_parameters - and is a parameter that's not supported / used in the model you're using (but might be useful / used in other models).

the PerformanceWarning is just that - a warning that's actually pointless (we do the recommended copy() part after the populate_* calls). You can build the dataframe in a different way - but it'll make the code a lot less readable for no good reason.

S-shekharDuggal commented 1 year ago

what about sharing knowledge from one coin to other can we do that?

xmatthias commented 1 year ago

FreqAI trains one model per coin (if that's what you mean).

S-shekharDuggal commented 1 year ago

i mean is there any option to transfer knowledge from an model which is trained for btc/usdt to an model i'm training for eth/usdt or vice versa or in other words if we can train single model with multiple coins

xmatthias commented 1 year ago

i think the documentation explains this pretty well:

For each pair in the whitelist, FreqAI trains a model to predict the target values based on the input of custom indicators. The models are then consistently retrained, with a predetermined frequency, to adapt to market conditions. FreqAI offers the ability to both backtest strategies (emulating reality with periodic retraining on historic data) and deploy dry/live runs. In dry/live conditions, FreqAI can be set to constant retraining in a background thread to keep models as up to date as possible.

S-shekharDuggal commented 1 year ago

well I was curious because of two reasons when i trained first model with BTC/USDT from all the data available with binance it on example strategy i didn't performed well it give me about 8 usd draw down on 100 $ dry run having periods 15 ,7 respectively for training and testing then i retrain a model with same data 4,1 day periods and find that it improved performance drawdown was about 4$ for same period then i improved strategy by building custom indicators and achieved best 2$ draw down at best thats why i feel that it need more training data but its not available with exchange so rather letting it run for long period i wanted to train it with as much as data possible or need to build dummy data using augmentation to train it.