Skip to content

Seeding DoubleML sampling #335

Discussion options

You must be logged in to vote

Hi @chiara-fb,

Thank you for your question about the DoubleML package!
Yes, it is possible to set a seed for reproducible sampling in DoubleML, including when using RDFlex. The key is to set the random seed before creating the RDFlex instance, it is not an argument for the data backend or the model itself. DoubleML relies on a numpy seed for reproducibility, the DoubleML Models, like RDFlex, are using the DoubleMLResampling class.

Here’s an example of how to ensure reproducibility:

import numpy as np
import pandas as pd
import doubleml as dml
from doubleml.rdd.datasets import make_simple_rdd_data
from sklearn.linear_model import LinearRegression

np.random.seed(42)
data_dict = make_simple…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chiara-fb
Comment options

Answer selected by chiara-fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants