INNER CODE UNIT · Python
run_analysis
ScottfreeLLC/AlphaPy · alphapy/analysis.py:137
def run_analysis(analysis, lag_period, forecast_period, leaders,
predict_history, splits=True):
r"""Run an analysis for a given model and group.
First, the data are loaded for each member of the analysis group.
Then, the target value is lagged for the ``forecast_period``, and
any ``leaders`` are lagged as well. Each frame is split along
the ``predict_date`` from the ``analysis``, and finally the
train and test files are generated.
Parameters
----------
analysis : alphapy.Analysis
The analysis to run.
lag_period : int
The number of lagged features for the analysis.
forecast_period : int
The period for forecasting the target of the analysis.