Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Rink
python
Commits
e51f1eee
Commit
e51f1eee
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
113f4b42
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/icing/pirep_goes.py
+9
-0
9 additions, 0 deletions
modules/icing/pirep_goes.py
with
9 additions
and
0 deletions
modules/icing/pirep_goes.py
+
9
−
0
View file @
e51f1eee
...
...
@@ -2609,6 +2609,10 @@ def analyze(preds_file, labels, prob_avg, test_file):
preds
=
np
.
where
(
prob_avg
>
0.5
,
1
,
0
)
num_0
=
np
.
sum
(
nda
==
0
)
num_1
=
np
.
sum
(
nda
==
1
)
num_2
=
np
.
sum
(
nda
==
2
)
true_ice
=
(
labels
==
1
)
&
(
preds
==
1
)
false_ice
=
(
labels
==
0
)
&
(
preds
==
1
)
...
...
@@ -2643,6 +2647,10 @@ def analyze(preds_file, labels, prob_avg, test_file):
mcc_1
=
((
tp_1
*
tn_1
)
-
(
fp_1
*
fn_1
))
/
np
.
sqrt
((
tp_1
+
fp_1
)
*
(
tp_1
+
fn_1
)
*
(
tn_1
+
fp_1
)
*
(
tn_1
+
fn_1
))
mcc_2
=
((
tp_2
*
tn_2
)
-
(
fp_2
*
fn_2
))
/
np
.
sqrt
((
tp_2
+
fp_2
)
*
(
tp_2
+
fn_2
)
*
(
tn_2
+
fp_2
)
*
(
tn_2
+
fn_2
))
acc_0
=
np
.
sum
(
labels
[
nda
==
0
]
==
preds
[
nda
==
0
])
/
num_0
acc_1
=
np
.
sum
(
labels
[
nda
==
1
]
==
preds
[
nda
==
1
])
/
num_1
acc_2
=
np
.
sum
(
labels
[
nda
==
2
]
==
preds
[
nda
==
2
])
/
num_2
print
(
'
Total (Positive/Icing Prediction:
'
)
print
(
'
True icing:
'
,
np
.
sum
(
true_ice
&
(
nda
==
0
)),
np
.
sum
(
true_ice
&
(
nda
==
1
)),
np
.
sum
(
true_ice
&
(
nda
==
2
)))
print
(
'
-------------------------
'
)
...
...
@@ -2656,6 +2664,7 @@ def analyze(preds_file, labels, prob_avg, test_file):
print
(
'
* False icing (False Positive/False Alarm) *:
'
,
np
.
sum
(
false_ice
&
(
nda
==
0
)),
np
.
sum
(
false_ice
&
(
nda
==
1
)),
np
.
sum
(
false_ice
&
(
nda
==
2
)))
print
(
'
-------------------------
'
)
print
(
'
ACC:
'
,
acc_0
,
acc_1
,
acc_2
)
print
(
'
Recall:
'
,
recall_0
,
recall_1
,
recall_2
)
print
(
'
Precision:
'
,
precision_0
,
precision_1
,
precision_2
)
print
(
'
MCC:
'
,
mcc_0
,
mcc_1
,
mcc_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