Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Simple data segmenter

Install

pip install git+https://github.com/XavierTolza/python-timeseries-segmenter.git

Or add git+https://github.com/XavierTolza/python-timeseries-segmenter.git to you requirements.txt:

Usage

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)

Dependencies

  • matplotlib
  • numpy
  • Does not require pandas, you might have some trouble if you don't have it ;)

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages