Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Troubled Cell Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Christine Kühle
Troubled Cell Detection
Commits
3e4d5284
Commit
3e4d5284
authored
2 years ago
by
Laura Christine Kühle
Browse files
Options
Downloads
Patches
Plain Diff
Added option to choose method for quartile calculation for Boxplot method.
parent
7b5b70f3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Troubled_Cell_Detector.py
+12
-18
12 additions, 18 deletions
Troubled_Cell_Detector.py
with
12 additions
and
18 deletions
Troubled_Cell_Detector.py
+
12
−
18
View file @
3e4d5284
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
TODO: Give option to choose from multiwavelet degrees (first, last or
TODO: Give option to choose from multiwavelet degrees (first, last or
highest magnitude) -> Done
highest magnitude) -> Done
TODO: Change method of calculating quartiles
TODO: Change method of calculating quartiles
-> Done
TODO: Include overlapping cells in quartile calculation (if needed)
TODO: Include overlapping cells in quartile calculation (if needed)
-> Done
TODO: Determine max_value for Theoretical only over highest degree
TODO: Determine max_value for Theoretical only over highest degree
-> Done (optional)
-> Done (
now
optional)
TODO: Check if indexing in wavelets is correct
TODO: Check if indexing in wavelets is correct
TODO: Combine get_cells() and _get_cells()
TODO: Combine get_cells() and _get_cells()
TODO: Add TC condition to only flag cell if left-adjacent one is flagged as
TODO: Add TC condition to only flag cell if left-adjacent one is flagged as
...
@@ -380,7 +380,9 @@ class Boxplot(WaveletDetector):
...
@@ -380,7 +380,9 @@ class Boxplot(WaveletDetector):
Flag whether outer fences should be adjusted using global mean.
Flag whether outer fences should be adjusted using global mean.
extreme_outlier_only : bool
extreme_outlier_only : bool
Flag whether outliers also have to be detected in neighbouring folds.
Flag whether outliers also have to be detected in neighbouring folds.
folds : ndarray
quantile_method : str
Method used to calculate quantiles.
fold_indices : ndarray
Array with indices for elements of each fold (including
Array with indices for elements of each fold (including
overlaps).
overlaps).
...
@@ -405,6 +407,7 @@ class Boxplot(WaveletDetector):
...
@@ -405,6 +407,7 @@ class Boxplot(WaveletDetector):
if
self
.
_mesh
.
num_grid_cells
<
self
.
_fold_len
:
if
self
.
_mesh
.
num_grid_cells
<
self
.
_fold_len
:
self
.
_fold_len
=
self
.
_mesh
.
num_grid_cells
self
.
_fold_len
=
self
.
_mesh
.
num_grid_cells
self
.
_quantile_method
=
config
.
pop
(
'
quantile_method
'
,
'
weibull
'
)
num_overlapping_cells
=
config
.
pop
(
'
num_overlapping_cells
'
,
1
)
num_overlapping_cells
=
config
.
pop
(
'
num_overlapping_cells
'
,
1
)
num_folds
=
self
.
_mesh
.
num_grid_cells
//
self
.
_fold_len
num_folds
=
self
.
_mesh
.
num_grid_cells
//
self
.
_fold_len
self
.
_fold_indices
=
np
.
zeros
([
num_folds
,
self
.
_fold_indices
=
np
.
zeros
([
num_folds
,
...
@@ -432,21 +435,12 @@ class Boxplot(WaveletDetector):
...
@@ -432,21 +435,12 @@ class Boxplot(WaveletDetector):
List of indices of all detected troubled cells.
List of indices of all detected troubled cells.
"""
"""
#
Select and sort fold domain
s
#
Determine quartiles of fold
s
folds
=
coeffs
[
self
.
_fold_indices
]
folds
=
coeffs
[
self
.
_fold_indices
]
folds
.
sort
()
first_quartiles
=
np
.
quantile
(
folds
,
0.25
,
axis
=
1
,
method
=
self
.
_quantile_method
)
# Determine quartile parameters
third_quartiles
=
np
.
quantile
(
folds
,
0.75
,
axis
=
1
,
boundary_index
=
self
.
_fold_len
//
4
method
=
self
.
_quantile_method
)
balance_factor
=
self
.
_fold_len
/
4.0
-
boundary_index
# Determine first and third quartiles
first_quartiles
=
(
1
-
balance_factor
)
\
*
folds
[:,
boundary_index
-
1
]
\
+
balance_factor
*
folds
[:,
boundary_index
]
third_quartiles
=
(
1
-
balance_factor
)
\
*
folds
[:,
3
*
boundary_index
-
1
]
\
+
balance_factor
*
folds
[:,
3
*
boundary_index
]
# Determine bounds based on quartiles of a boxplot
# Determine bounds based on quartiles of a boxplot
lower_bounds
=
np
.
zeros
(
len
(
first_quartiles
)
+
2
)
lower_bounds
=
np
.
zeros
(
len
(
first_quartiles
)
+
2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment