Skip to content
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

[ML] Missing variable initialisation causing spurious model reinitialisation for lat/long function #641

Merged
merged 2 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ train time. (See {ml-pull}622[#622].)

* Rename outlier detection method values knn and tnn to distance_kth_nn and distance_knn
respectively to match the API. (See {ml-pull}598[#598].)
* Fix occasional (non-deterministic) reinitialisation of modelling for the lat_long
function. (See {ml-pull}641[#641].)

== {es} version 7.3.1

Expand Down
5 changes: 2 additions & 3 deletions lib/maths/CTimeSeriesModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1607,8 +1607,6 @@ CUnivariateTimeSeriesModel::updateTrend(const TTimeDouble2VecSizeTrVec& samples,
}
}

EUpdateResult result = E_Success;

// Time order is not reliable, for example if the data are polled
// or for count feature, the times of all samples will be the same.
TSizeVec timeorder(samples.size());
Expand All @@ -1623,6 +1621,7 @@ CUnivariateTimeSeriesModel::updateTrend(const TTimeDouble2VecSizeTrVec& samples,
// Do the update.

TFloatMeanAccumulatorVec window;
EUpdateResult result{E_Success};
auto componentChangeCallback = [&window, &result](TFloatMeanAccumulatorVec window_) {
window = std::move(window_);
result = E_Reset;
Expand Down Expand Up @@ -2944,7 +2943,7 @@ CMultivariateTimeSeriesModel::updateTrend(const TTimeDouble2VecSizeTrVec& sample

// Do the update.

EUpdateResult result;
EUpdateResult result{E_Success};
auto componentChangeCallback = [&result](TFloatMeanAccumulatorVec) {
result = E_Reset;
};
Expand Down