Segment¶
Segment¶
Segment
¶
Bases: BaseModel
Segment of a time series.
Source code in src/trend_classifier/segment.py
start
instance-attribute
¶
Start index of the segment.
stop
instance-attribute
¶
Stop index of the segment.
slope = 0
class-attribute
instance-attribute
¶
Slope of the segment.
offset = 0
class-attribute
instance-attribute
¶
Offset of the segments.
slopes = []
class-attribute
instance-attribute
¶
List of slopes of linear trends in windows in the segment.
offsets = []
class-attribute
instance-attribute
¶
List of offsets of linear trends in windows in the segment.
slopes_std = 0
class-attribute
instance-attribute
¶
Standard deviation of the slopes of linear trends in windows in the segment.
offsets_std = 0
class-attribute
instance-attribute
¶
Standard deviation of the offsets of linear trends in windows in the segment.
std = 0
class-attribute
instance-attribute
¶
Standard deviation of the samples in the segment with removed trend.
span = 0
class-attribute
instance-attribute
¶
Span of the values in the segment normalized by the mean value of the segment. Indicator if the volatility of the segment is high or low.
reason_for_new_segment = ''
class-attribute
instance-attribute
¶
Reason for creating a new segment (which criterion was violated).
SegmentList¶
SegmentList
¶
Bases: list
List of segments. Each segment group samples with similar trend.
New methods dedicated e.g. to processing od displaying list of segments can be added here.
Source code in src/trend_classifier/segment.py
to_dataframe()
¶
Convert segments to a pandas DataFrame.
Returns:
| Type | Description |
|---|---|
|
A pandas DataFrame. |