Skip to content

Core model

StrategyNotImplementedError

Bases: Exception

Custom exception for strategies that are not implemented.

TimeGraph

Stores already made graph, allows us to add edges and links between nodes.

Attributes:

  • graph: object networkx.Graph

add_edge(node_1, node_2, weight=None)

Adds edge between node_1 and node_2.

combine_identical_nodes()

Combines nodes that have same value of attribute self.attribute if graph is classical graph and nodes that are identical graphs if graph is created using sliding window mechanism.

combine_identical_subgraphs()

Combines nodes that have same value of attribute self.attribute if graph is classical graph and nodes that are identical graphs if graph is created using sliding window mechanism.

draw()

Draws the created graph

draw_sequence()

Draws timeseries.

Links nodes based on link_strategy. link_strategy is object of class Link.

plot_timeseries(sequence, title, x_legend, y_legend, color)

Function to sets parameters to draw timeseries.

Timeseries

Saves extracted data as timeseries.

TimeseriesPreprocessing

Processes timeseries.

TimeseriesPreprocessingComposite

Composites processing strategies, allowing us to use multiple of them.

Attributes:

  • ts: Timeseries object with extracted timeseries

TimeseriesPreprocessingSegmentation

Bases: TimeseriesPreprocessing

Returns a designated segment from timeseries.

Attributes:

  • segmen_start: start of the segment
  • segment_end: end of the segment

TimeseriesPreprocessingSlidingWindow

Bases: TimeseriesPreprocessing

Returns an array of segments made with sliding window mechanism.

Attributes:

  • win_size: size of the creted segments
  • move_len: tells for how many data does window move until next segment

TimeseriesView

Stores one or more already processed timeseries, then changes them to graph using provided strategy. If we have multiple timie series turned to graphs, we can link them into one multivariate graph.

Attributes:

  • ts: processed timeseries
  • graph: networkx.Graph object

ToSequenceVisitor

Bases: ToSequenceVisitorMaster

Converts ordinary graphs back to timeseries.

ToSequenceVisitorMaster

Turns graphs back to timeseries.

Attributes:

  • graph: networkx.Graph object
  • node_strategy: strategy_to_time_sequence.StrategySelectNextNode object
  • value_strategy: strategy_to_time_sequence.StrategyNextValueInNode object

to_sequence(graph)

Converts graph into time sequences.

ToSequenceVisitorOrdinalPartition

Bases: ToSequenceVisitorMaster

Converts graphs made using ordinal partition mechanism back to timeseries

ToSequenceVisitorSlidingWindow

Bases: ToSequenceVisitorMaster

Converts graphs made using sliding window mechanism back to timeseries