pip install git+https://github.com/XavierTolza/python-timeseries-segmenter.gitOr add git+https://github.com/XavierTolza/python-timeseries-segmenter.git to you requirements.txt:
Inputs are pandas dataframe with x axis as index. A plot will be drawn for each column and you need to specify the class with a column labelled "class" See the example below:
# Generate sample datan_values=1000n_classes=4columns="A,B,C,D".split(",")
data=np.cumsum(np.random.normal(0, .1, (n_values, len(columns))), 0)
data=DataFrame(data,
index=np.linspace(0, 5, n_values), columns=columns)
# Now data is correct, generate class for each sampleclasses=np.array(["Class %i"%iforiinrange(n_classes)])[np.linspace(0, n_classes-1, n_values).astype(int)]
data["class"] =classes# Run the UIs=dfs.Segmenter(data)
res=s.run()
# The result is the same dataframe as input, but with classes updatedprint(res)- matplotlib
- numpy
- Does not require pandas, you might have some trouble if you don't have it ;)
