-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoARMA Algorithm for SyntheticHistory ROM #2309
Conversation
Job Test qsubs sawtooth on 1eb419e : invalidated by @joshua-cogliati-inl restarted civet |
fixes diff issue between Linux and Windows
""" | ||
Determines the charactistics of the signal based on this algorithm. | ||
@ In, signal, np.ndarray, time series with dims [time, target] | ||
@ In, pivot, np.1darray, time-like parameter values | ||
@ In, targets, list(str), names of targets in same order as signal | ||
@ In, settings, dict, settings for this ROM | ||
@ In, trainedParams, dict, running dict of trained algorithm params | ||
@ Out, params, dict, characteristic parameters | ||
""" | ||
# lazy import statsmodels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the fit function was called several times should we import each time? I am a little against having the import here. I know that this is not added by you, but do you think we'd better move it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python will only import it the first time, and after that the import is cached. imports inside of function means that the import only happens when the function is called, which can speed up RAVEN since otherwise the import needs to happen at the start of RAVEN even if statsmodels is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Josh. I am saying this to make you aware of it, as I have been directed not to do that before, but if you are aware of it, I am totally OK.
@ Out, segmentData, dict | ||
""" | ||
# | ||
segmentNonFeatures = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to write a comment in line 326?
@@ -189,7 +189,7 @@ def train(self, tdict, metric=None): | |||
|
|||
## Check if a label feature is provided by the user and in the training data | |||
if self.labelFeature in tdict: | |||
self.labelValues = tidct[self.labelFeature] | |||
self.labelValues = tdict[self.labelFeature] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this working? Did this if statement never get true in all the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like the statement was not being hit in the tests, I stumbled upon that typo by chance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GabrielSoto-INL, so far I have no issues with this PR, I will debug it locally and finalyze it. But one thing I noticed, ARMA doesn't have an xsd schema. Please refer to ./developer_tools/validate_xml.sh
and validate_xml.py
<arma target="signal0, signal1" auto_select="True" seed='42'> | ||
<P>1</P> <!-- NOTE: because `auto-select` is True, these are ignored --> | ||
<Q>0</Q> <!-- NOTE: because `auto-select` is True, these are ignored --> | ||
</arma> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest instead of ignoring the user-provided P and Q, if auto_select = "True", either to error out or to consider them as P_upper, or lower, and the same for Q.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P_upper and Q_upper are already used in the autoarma
algorithm, so I think maybe I'll just have it error out if the user provides P and Q here when auto-select
is True
regression; typically represented as $Q$ in literature.""")) | ||
specs.addParam('auto_select', param_type=InputTypes.BoolType, required=False, | ||
descr=r""" """, default=False) | ||
specs.addSub(InputData.parameterInputFactory('P', contentType=InputTypes.IntegerListType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the description of auto_select? desc=r""" """
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I missed that!
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
#2307 #2308
What are the significant changes in functionality due to this change request?
This is a re-do of PR #2176
autoARMA
algorithm to the list of TSA algorithms. This algorithm can only be used for global signals if we are using clustered ROMs.Changes to the ARMA algorithm:
ARMA
algorithm to receive trained parameters from theautoARMA
algorithm.SignalLag
andNoiseLag
back toP
andQ
for theARMA
algorithmP
andQ
inputs now can also accept an Integer List with size equal to the number of targets (can still accept a single value as before)For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.