Last active
February 26, 2023 12:18
-
-
Save a-agmon/ab0cb1366f530248e6986b55a0147d49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private def getForecastDatasets(app_id: String, | |
recordsIterator: Seq[FeaturesRecord]): | |
Try[(Seq[FeaturesRecord], Seq[FeaturesRecord])] = Try { | |
val dataPoints = recordsIterator.sortBy(_.ts.getTime) | |
// ignoring the last observation as it might be be partial | |
val trainSeq = dataPoints.slice(0, dataPoints.length - 3) | |
val actualValSeq = dataPoints.slice(dataPoints.length - 3, dataPoints.length - 1) | |
(trainSeq, actualValSeq) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment