Evolutionary Algorithm

Chronetic begins by extracting temporal facts from the time-series dataset. Using these facts it mutates and breeds combinations in order to find patterns. Accurate patterns reproduce to form more complex patterns with increased accuracy.

Chronological Patterns

Chronetic is fully compatible with ISO calendar systems and most non-ISO calendar systems that define units of years, months and days, etc. Check ChronoUnit for a full list of units comptabile with ChronoPatterns.

Supports InfluxDB

Chronetic fully supports InfluxDB and can be used to analyze pre-existing datasets. For large streaming datasets InfluxDB can also be used as storage, which can be queried quickly, allowing for minimal memory overhead.

Highly Scalable

Supports parallel execution of evolutionary steps and several parameters to control the population of solutions and offspring as well as fitness & accuracy thresholds, time limits, and more.

Completely Dynamic

The scale, duration, and size of the time-series data makes no difference. Chronetic supports nanosecond to millennia precision or a dataset of two elements to a dataset of two hundred million.

Text Descriptions

Patterns found in the time-series data can be translated into human-readable text with a ChronoDescriptor. From simple descriptions to verbose descriptions offering deep insight.

Design

Chronotype/Chronosome

Chronetic provides solutions using an object called a Chronotype. A Chronotype is a genotype characterizing time and can be used to describe a time series dataset. Chronotypes can be made up of one-to-many Chronosomes, which represent a particular frequency and/or chronological pattern in a given time series dataset. Chronosomes under the same Chronotype cannot share the same time period, represented as a ChronoRange. Meaing a Chronotype with multiple Chronosomes is describing a single time series dataset using multiple distinct frequencies and/or patterns.

For example, suppose a dataset had two distinct events. One happens on Mondays at 10AM and the other happens on Thursdays at 3PM. One Chronosome would be used to describe the pattern of "Monday at 10AM" and the other would be used to describe "Thursday at 3PM". Since these two Chronosomes don't share the same time period they can exist under the same Chronotype to describe multiple patterns occurring in a single time series dataset.



ChronoPattern/ChronoFrequency

The ChronoPattern and ChronoFrequency represents the two ChronoGene allele types available to a Chronosome. ChronoPattern collects chronological patterns and limits the ChronoRange covered by a Chronosome. The ChronoFrequency collects the frequency at which the time series data is being collected. The ChronoFrequency not only serves to provide the frequency of the timeseries dataset but also as a fallback for data which follows no apparent patterns. Those sections of the dataset will be summed up with a single ChronoFrequency describing the frequency of data collection.



ChronoFitness

Currently the weakest part of Chronetic. Still working on this. Could use help from anyone that understands multi-objective optimization. The general approach taken is to optimize four objectives. These four objectives being:

Frequency precision describes the precision of a Chronotype which contains a ChronoFrequency. Pattern accuracy describes how accurate the Chronotype's ChronoPattern sequence is in comparison with the timeseries data by count. Pattern inclusion describes how much of the overall timeseries data is included in the Chronotype's ChronoPattern sequence. Finally, temporal inclusion describes the Duration of time a Chronotype occupies.



ChronoDescriptor

The ChronoDescriptor is used to provide human-readable descriptions of a given Chronotype. Given that a Chronotype may have multiple Chronosomes and those Chronosomes can have many ChronoPatterns, the descriptions produced may be verbose on data with no apparent patterns.



ChronoSeries

The ChronoSeries represents the time series dataset which Chronetic operates on. It has the ability to be constructed with a collection of events as Instants and Dates as well as with InfluxDB given the database, table, and column names. ChronoSeries requires at least two timeseries events in order to construct it, but for any insightful descriptions more will be neccessary.



ChronoRange

The ChronoRange represents the period(s) of time in which a given sequence of ChronoPatterns accounts for. For example, the ChronoPattern of "every second of November between 2014 to 2017" would create a ChronoRange in which the range accounted for every second of November 2014 and every second of November 2015, and so on. The ChronoRange can then be used to query InfluxDB to analyze the timeseries dataset.

Examples

ChronoSeries chronoSeries = ChronoSeries.of(
	Instant.parse("2011-11-04T08:48:11Z"),
	Instant.parse("2012-11-02T09:23:16Z"),
	Instant.parse("2013-11-01T09:51:49Z"),
	Instant.parse("2014-11-07T08:43:00Z"),
	Instant.parse("2015-11-06T08:22:25Z")
);

String description = Chronetic.defaultEngine()
	.analyze(chronoSeries).withHourPrecision()
	.describe().humanReadable();

//Outputs -> Once a year from 2011 to 2015 on the first Friday of November between 8AM - 10AM
System.out.println(description);

Custom Engine

ChronoSeries chronoSeries = ChronoSeries.of(
	Instant.parse("2011-11-04T08:48:11Z"),
	Instant.parse("2012-11-02T09:23:16Z"),
	Instant.parse("2013-11-01T09:51:49Z"),
	Instant.parse("2014-11-07T08:43:00Z"),
	Instant.parse("2015-11-06T08:22:25Z")
);

Chronetic chronetic = Chronetic.configure()
        .populationSize(500)
        .survivorsSize(250).offspringSize(250)
        .maxGeneration(15).build();

String description = chronetic.analyze(chronoSeries)
        .withHourPrecision()
        .describe().humanReadable();

//Once a year from 2011 to 2015 on the first Friday of November between 8AM - 10AM
System.out.println(description);

Build

Gradle

repositories {
     jcenter()
     maven { url "https://jitpack.io" }
}

dependencies {
      compile 'com.github.codebrig:chronetic:v1.0-alpha'
}

Maven

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependency>
	<groupId>com.github.codebrig</groupId>
	<artifactId>chronetic</artifactId>
	<version>v1.0-alpha</version>
</dependency>