Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbee committed Nov 28, 2018
2 parents f47e88a + 6940c05 commit ec96e28
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions seglearn/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ class SegmentX(BaseEstimator, XyTransformerMixin):
width : int > 0
width of segments (number of samples)
overlap : float range [0,1)
amount of overlap between segments. must be in range: 0 <= overlap < 1.
shuffle : bool, optional
shuffle the segments before fitting the ``est`` pipeline (recommended)
amount of overlap between segments. must be in range: 0 <= overlap <= 1
(note: setting overlap to 1.0 results in the segments to being advanced by a single sample)
shuffle : bool, optional
shuffle the segments after transform (recommended for batch optimizations)
random_state : int, default = None
Expand All @@ -123,7 +122,7 @@ def __init__(self, width=100, overlap=0.5, shuffle=False, random_state=None):

self.f_labels = None
self.step = int(self.width * (1. - self.overlap))
self.step = self.step if self.step >= 1 else 1
self.step = max(1, self.step)

def _validate_params(self):
if not self.width >= 1:
Expand Down Expand Up @@ -230,7 +229,8 @@ class SegmentXY(BaseEstimator, XyTransformerMixin):
width : int > 0
width of segments (number of samples)
overlap : float range [0,1)
amount of overlap between segments. must be in range: 0 <= overlap < 1.
amount of overlap between segments. must be in range: 0 <= overlap <= 1
(note: setting overlap to 1.0 results in the segments to being advanced by a single sample)
y_func : function
returns target from array of target segments (eg ``last``, ``middle``, or ``mean``)
shuffle : bool, optional
Expand All @@ -255,7 +255,7 @@ def __init__(self, width=100, overlap=0.5, y_func=last, shuffle=False, random_st
self._validate_params()

self.step = int(self.width * (1. - self.overlap))
self.step = self.step if self.step >= 1 else 1
self.step = max(1, self.step)

def _validate_params(self):
if not self.width >= 1:
Expand All @@ -275,7 +275,7 @@ def fit(self, X, y=None):
There is no need of a target in a transformer, yet the pipeline API requires this
parameter.
Returnsself._validate_params()
Returns
-------
self : object
Returns self.
Expand Down Expand Up @@ -356,7 +356,8 @@ class SegmentXYForecast(BaseEstimator, XyTransformerMixin):
width : int > 0
width of segments (number of samples)
overlap : float range [0,1)
amount of overlap between segments. must be in range: 0 <= overlap < 1.
amount of overlap between segments. must be in range: 0 <= overlap <= 1
(note: setting overlap to 1.0 results in the segments to being advanced by a single sample)
forecast : int
The number of samples ahead in time to forecast
y_func : function
Expand Down Expand Up @@ -385,7 +386,7 @@ def __init__(self, width=100, overlap=0.5, forecast=10, y_func=last, shuffle=Fal
self._validate_params()

self.step = int(self.width * (1. - self.overlap))
self.step = self.step if self.step >= 1 else 1
self.step = max(1, self.step)

def _validate_params(self):
if not self.width >= 1:
Expand Down

0 comments on commit ec96e28

Please sign in to comment.