hybrid_jp.change_points module#
Chagne point detection using ruptures library.
- hybrid_jp.change_points.binseg(arr: ndarray, nseg=3) list[int][source]#
Use Binary Segmentation algorithm to detect change points.
- Parameters:
arr (np.ndarray) – 2d array of [x,features]
nseg (int, optional) – number of change points to return. Defaults to 3.
- Returns:
index of change points
- Return type:
list[int]
- hybrid_jp.change_points.find_shock_index_from_gradnd(gradnd: ndarray) int[source]#
Find the index of the shock from gradient of the number density.
If gradnd is 2d then find the peak of the mean.
Assume the shock is located at the peak of grad nd
- Parameters:
gradnd (np.ndarray) – gradient of the number density.
- Returns:
index of the shock.
- Return type:
int