Hi all!
I recently got into Quantopian again and I have a question regarding testing an irregularly occuring custom factor in alphalens.
I created a self-serve dataset which consists of roughly 200 securities with sentiment scores occuring irregularly every 2-15 days.
As an illustrative example, say I have the following data.
AAPL 1.1.2015 0.014
TSLA 1.1.2015 0.482
CSCO 1.12015 -0.282
TSLA 1.4.2015 -0.132
CSCO 1.42015 0.721
AAPL 1.7.2015 0.810
TSLA 1.7.2015 0.654
CSCO 1.72015 0.591
If I use
pipe = Pipeline(
columns={
'my_dataset': dataset.sentiment_score.latest
},
screen=dataset.sentiment_score.latest.notnull()
)
df = run_pipeline(pipe, '2015-01-01', '2018-12-11')
Then the AAPL score will be 0.014 for every day from 1.1.2015 to 1.7.2015.
Is there a way to only consider the actual values of my dataset?