Skip to content

Commit 34cf20e

Browse files
committed
Update README.md
1 parent 924d3c9 commit 34cf20e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# ts2g<sup>2</sup>
22

3-
TS2G<sup>2</sup> stands for "timeseries to graphs and back". The library implements a variety of strategies to convert timeseries into graphs, and convert graphs into sequences.
3+
TS2G<sup>2</sup> stands for "timeseries to graphs and back". The library implements a variety of strategies to convert timeseries into graphs, and convert graphs into sequences. Below, we provide a code snippet to generate a graph from timeseries:
44

55
# load time series from a file
6-
model.Timeseries(CsvStock(some_file_path, "ColumnOfInterest").from_csv())\
6+
timegraph = model.Timeseries(CsvStock(some_file_path, "ColumnOfInterest").from_csv())\
77

88
# and preprocess the timeseries with multiple preprocessing strategies
99
.with_preprocessing(model.TimeseriesPreprocessingComposite()\
@@ -238,15 +238,15 @@ The package is a joint effort between the [Jožef Stefan Institute](https://www.
238238

239239
### Graphs to timeseries conversion
240240

241-
Graphs are converted back to timeseries by sampling node values from the graph following different strategies. The following strategies have been implemented so far:
241+
Graphs are converted back to timeseries by sampling node values from the graph following different strategies. Below, we provide a short snippet of code, to illustrate how this can be done.
242242

243-
- random node
244-
- random node neighbour
245-
- random node degree
246-
- random walk
247-
- random walk with restart
248-
- random walk with jump
243+
timegraph.to_sequence(model.ToSequenceVisitorSlidingWindow()\
244+
.next_node_strategy(tts.StrategySelectNextNodeRandomlyFromFirstGraph())\
245+
.next_value_strategy(tts.StrategyNextValueInNodeRandomForSlidingWindow().skip_every_x_steps(1))\
246+
.ts_length(50))\
247+
.draw_sequence()
249248

249+
When choosing the next node, the following strategies have been implemented so far: random node, random node neighbour, random node degree, random walk, random walk with restart, random walk with jump.
250250

251251
## Publications
252252

0 commit comments

Comments
 (0)