An easy TimeSeries spliter into "size" batches.
You should have all your legitimate and DDoS TimeSeries stored in diferent folders. The format should looks like:
<date>_<time>-<metric>-<granularity>
Example:
2018-03-29_18.06.20-difInput_OutputBytes-60000
- Build a folder where you have all your granularities together (diferent folder eachone)
- Store all metric folders inside the corresponding granularities
- Finally, inside metric folders, all the TimeSeries will be saved inside "Legitimo" or "DDoS" folders.
Data should looks like:
Granualrity1
Granularity2
Granularity2
|
- - - - metric1
metric2
metric3
|
- - - timeserie1
timeserie2
timeserie3
.
.
.
Go to projects folder and fire up a terminal:
python divider.py <dataset root folder> <size>
Example:
python divider.py /home/andres/dataset 150
*NOTE: "size" is the number of elements every new timeseries will have.
- If you want to build the whole structure:
- First translate legitime TimeSeries
- Seconda, convert DDoS TimeSeries
python split.py <path to TS's folders> <"legitimo" / "ddos">
Example:
python split.py /home/andres/legitime_timeseries legitimo
python split.py /home/andres/ddos_timeseries ddos