<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Three questions about the qnbt.backtest_ml used in  Machine Learning on a Rolling Basis example.]]></title><description><![CDATA[<p dir="auto">The questions are about the qnbt.backtest_ml used in  Machine Learning on a Rolling Basis example from <a href="https://quantiacs.com/documentation/en/examples/q18_machine_learning_on_a_rolling_basis.html" rel="nofollow ugc">https://quantiacs.com/documentation/en/examples/q18_machine_learning_on_a_rolling_basis.html</a></p>
<p dir="auto">weights = qnbt.backtest_ml(<br />
train                         = train_model,<br />
predict                       = predict_weights,<br />
train_period                  =  2 *365,  # the data length for training in calendar days<br />
retrain_interval              = 10 *365,  # how often we have to retrain models (calendar days)<br />
retrain_interval_after_submit = 1,        # how often retrain models after submission during evaluation (calendar days)<br />
predict_each_day              = False,    # Is it necessary to call prediction for every day during backtesting?<br />
# Set it to True if you suspect that get_features is looking forward.<br />
competition_type              = "stocks_nasdaq100",  # competition type<br />
lookback_period               = 365,                 # how many calendar days are needed by the predict function to generate the output<br />
start_date                    = "2005-01-01",        # backtest start date<br />
analyze                       = True,<br />
build_plots                   = True  # do you need the chart?<br />
)</p>
<p dir="auto">Questions</p>
<ol>
<li>
<p dir="auto">It seems that the models are trained in the train_period of the final data and that trained models are used  in all the chunks of data, is that correct ?</p>
</li>
<li>
<p dir="auto">Is the re-training after every retrain_interval done with incremental learning of the type that the fitting that partial_fit  does (see following link) ?</p>
</li>
</ol>
<p dir="auto"><a href="https://datascience.stackexchange.com/questions/68599/incremental-learning-with-sklearn-warm-start-partial-fit-fit" rel="nofollow ugc">https://datascience.stackexchange.com/questions/68599/incremental-learning-with-sklearn-warm-start-partial-fit-fit</a>?</p>
<ol start="3">
<li>How can i provide qnbt.backtest_ml with and already trained model  have the model trained with incremental learning  every retrain_interval    (would train_period = 0  and have  train_model retruning the trained models  work for this)</li>
</ol>
]]></description><link>http://quantiacs.com/community/topic/541/three-questions-about-the-qnbt-backtest_ml-used-in-machine-learning-on-a-rolling-basis-example</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 04:05:13 GMT</lastBuildDate><atom:link href="http://quantiacs.com/community/topic/541.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Mar 2024 04:44:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Three questions about the qnbt.backtest_ml used in  Machine Learning on a Rolling Basis example. on Wed, 27 Mar 2024 15:02:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://quantiacs.com/community/uid/372">@gjhernandezp</a> Dear gjhernandezp,</p>
<ol>
<li>No, models are trained from scratch taking the train_period of the data that is changing depending on the processing day.</li>
<li>No, the retraining is done from scratch, taking the whole available data up until that point in time.</li>
<li>That is not available at the moment, but take a note that when submitting a ML strategy it should be in a single-pass mode. For example instead of using backtest_ml function that is designed for testing purposes, one should use single-pass, for example:</li>
</ol>
<pre><code>data_train = load_data(train_period)
models = train_model(data_train)

data_predict = load_data(lookback_period)
weights_predict = predict(models, data_predict)

print_stats(data_predict, weights_predict)
qnout.write(weights_predict) # To participate in the competition, save this code in a separate cell.
</code></pre>
]]></description><link>http://quantiacs.com/community/post/1516</link><guid isPermaLink="true">http://quantiacs.com/community/post/1516</guid><dc:creator><![CDATA[support]]></dc:creator><pubDate>Wed, 27 Mar 2024 15:02:26 GMT</pubDate></item></channel></rss>