carldata / timeseries Goto Github PK
View Code? Open in Web Editor NEWTime Series library for Scala
License: Apache License 2.0
Time Series library for Scala
License: Apache License 2.0
Support for:
-x * * * *
-* x * * *
,for after/equal.
Join should work on index and the output value is tuple with values from first and second series
def rollingWindow(windowSize: Duration, stepSize: Duration, f: Seq[V] => V): TimeSeries[V]
It should be: βAt 00:00 on every day-of-month.β
Currently TimeConverter set time for this cron to 23:00
This will at least require changes to:
Group data by time range
Repeat series for given period
Currently this function takes as a parameter Duration.
Instead it should take function LocalDateTime => LocalDateTime and reset to 0 when transformed DateTime has new value.
This transformation is used only to find switch point. The index will remain the same.
-> refactor resample
This function is motivated by the following use case:
Older sensor equipment often used simple counters to record events. These counters would continue to some max value (i.e. 100) and then rollover to 0
This function should return timeseries with length of indexes vector less than provided in arguments.
def almostEqual[V: Numeric](xs: TimeSeries[V], ys: TimeSeries[V], epsilon: Numeric[V]): Boolean
Provide min and max value as a parameters
Duration can be used with negative values for shifting backward in time
def repeat(start: Instant, end: Instant, repetitionStart: Instant, repetitionEnd: Instant): TimeSeries[V]
Current implementation is not effective
this function adds missing points without resampling index
Create time series for a given time range with constant value
def joinOuter[U](ts: TimeSeries[U], defaultLeft: V, defaultRight: U): TimeSeries[(V, U)]
This join will work similar to SQL full outer join
New module name: Outliers..
Functions to move:
Resample based on index
TimeSeries.join(series: Seq[TimeSeries]): TimeSeries
Create inner join within all series in the sequence.
Integrate series for selected time ranges.
Example:
Lets say that we have series with data every 15 minutes.
(10:00, 1), (10:15, 2), (10:30, 3), (10:45, 4), (11:00, 5), (11:15, 6)
And we want to integrate it for every hour. So we expected the following series:
(10:00, 1), (10:15, 3), (10:30, 6), (10:45, 10), (11:00, 5), (11:15, 11)
The sum is reseted after every hour
mkConvert(c: CronLike): LocalDateTime => LocalDateTime
Change
def groupByTime(g: LocalDateTime => LocalDateTime, f: Seq[V] => V): TimeSeries[V]
to
def groupByTime(g: LocalDateTime => LocalDateTime, f: Seq[(LocalDateTime, V)] => V): TimeSeries[V]
Add a new (version of) findSessions function to Sessions object, with the following signature
def findSessions[V: Numeric](ts: TimeSeries[V], maxTolerance: Duration): Seq[Session]
where Duration is java.time.Duration, which works exactly as
def findSessions[V: Numeric](ts: TimeSeries[V]): Seq[Session]
with the additional tolerance of non-positive samples for at most maxDuration window.
Differentiate d times
Add a function which give a last element of TimeSeries.
Add object Analysis with function:
def findSessions[V: Fractional](ts: TimeSeries[V]): Seq[Session]
Where session contains start and end date.
Session is defined as period where values are > 0.
For example in a given series values:
1, 3, 2, 0, 4,5
We have 2 sessions (0,3) and (4,6) (startIndex, endIndex)
End date is on the first sample where the value is == 0
1. Measure: map
100000 points: 10.568595 ms.
500000 points: 55.22252 ms.
1000000 points: 45.036296 ms.
2. Measure: groupBy
100000 points: 339.662496 ms.
500000 points: 2098.315767 ms.
1000000 points: 5014.337623 ms.
3. Measure: rollingWindow
1000 points: 23.720139 ms.
5000 points: 597.484543 ms.
10000 points: 2347.1362 ms.
Series are merged on index.
This operation merges series A into B which means that, the output series will contain all values from B and all from A not presented in B (values from B overwrites values in A)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.