Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PARADISE
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
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
SIG
Theses
Pierre Lotte
PARADISE
Commits
35a0e455
Commit
35a0e455
authored
9 months ago
by
Pierre LOTTE
Browse files
Options
Downloads
Patches
Plain Diff
Ajout boucle résultats concis + modification arg split
parent
cd6b84c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+1
-1
1 addition, 1 deletion
main.py
results/roc.py
+18
-4
18 additions, 4 deletions
results/roc.py
with
19 additions
and
5 deletions
main.py
+
1
−
1
View file @
35a0e455
...
@@ -135,7 +135,7 @@ if __name__ == "__main__":
...
@@ -135,7 +135,7 @@ if __name__ == "__main__":
# Split data
# Split data
# =================================================================================================================
# =================================================================================================================
if
args
.
split
:
if
args
.
split
and
args
.
task
in
[
"
train
"
,
"
all
"
]
:
splitter
=
BaseSplitter
(
f
"
{
INPUT_DIR
}
/
{
config_name
}
"
)
splitter
=
BaseSplitter
(
f
"
{
INPUT_DIR
}
/
{
config_name
}
"
)
splitter
.
split_data
()
splitter
.
split_data
()
...
...
This diff is collapsed.
Click to expand it.
results/roc.py
+
18
−
4
View file @
35a0e455
...
@@ -42,9 +42,9 @@ class ROCResults(BaseResults):
...
@@ -42,9 +42,9 @@ class ROCResults(BaseResults):
fpr
,
tpr
,
_
=
roc_curve
(
labels
,
y_pred
)
fpr
,
tpr
,
_
=
roc_curve
(
labels
,
y_pred
)
if
algo
in
self
.
result
:
if
algo
in
self
.
result
:
self
.
result
[
algo
][
config_name
]
=
{
"
classic
"
:
round
(
score
,
2
)}
self
.
result
[
algo
][
config_name
]
=
{
"
classic
"
:
round
(
score
,
4
)}
else
:
else
:
self
.
result
[
algo
]
=
{
config_name
:
{
"
classic
"
:
round
(
score
,
2
)}}
self
.
result
[
algo
]
=
{
config_name
:
{
"
classic
"
:
round
(
score
,
4
)}}
plt
.
rcParams
[
"
figure.figsize
"
]
=
(
10
,
10
)
plt
.
rcParams
[
"
figure.figsize
"
]
=
(
10
,
10
)
plt
.
plot
(
fpr
,
tpr
)
plt
.
plot
(
fpr
,
tpr
)
...
@@ -71,7 +71,7 @@ class ROCResults(BaseResults):
...
@@ -71,7 +71,7 @@ class ROCResults(BaseResults):
result
=
np
.
maximum
(
result
,
y_pred
)
result
=
np
.
maximum
(
result
,
y_pred
)
score
=
roc_auc_score
(
labels
,
result
)
score
=
roc_auc_score
(
labels
,
result
)
self
.
result
[
algo
][
f
"
{
config_name
}
"
][
"
auto_split
"
]
=
round
(
score
,
2
)
self
.
result
[
algo
][
f
"
{
config_name
}
"
][
"
auto_split
"
]
=
round
(
score
,
4
)
# Compute results for splitted dataset
# Compute results for splitted dataset
files
=
__exec
(
f
"
find -L
{
self
.
path
}
/
{
config_name
}
/results_
{
algo
}
-regex
'
^.*dataset[_0-9]+_
{
algo
}
.ts
'"
)
files
=
__exec
(
f
"
find -L
{
self
.
path
}
/
{
config_name
}
/results_
{
algo
}
-regex
'
^.*dataset[_0-9]+_
{
algo
}
.ts
'"
)
...
@@ -87,10 +87,24 @@ class ROCResults(BaseResults):
...
@@ -87,10 +87,24 @@ class ROCResults(BaseResults):
result
=
np
.
maximum
(
result
,
y_pred
)
result
=
np
.
maximum
(
result
,
y_pred
)
score
=
roc_auc_score
(
labels
,
result
)
score
=
roc_auc_score
(
labels
,
result
)
self
.
result
[
algo
][
f
"
{
config_name
}
"
][
"
split
"
]
=
round
(
score
,
2
)
self
.
result
[
algo
][
f
"
{
config_name
}
"
][
"
split
"
]
=
round
(
score
,
4
)
print
(
json
.
dumps
(
self
.
result
))
print
(
json
.
dumps
(
self
.
result
))
# for algo, algo_res in self.result.items():
# l_classic = []
# l_auto_split = []
# l_split = []
# for details in algo_res.values():
# l_classic.append(details["classic"])
# l_auto_split.append(details["auto_split"])
# l_split.append(details["split"])
# print(f"{algo}:")
# print(f"\tClassic: {np.mean(l_classic)} ({np.std(l_classic)})")
# print(f"\tAuto split: {np.mean(l_auto_split)} ({np.std(l_auto_split)})")
# print(f"\tSplit: {np.mean(l_split)} ({np.std(l_split)})")
def
__vote_for_score
(
self
,
scores
,
length
):
def
__vote_for_score
(
self
,
scores
,
length
):
"""
"""
Compute the score for each point of the dataset instead of a per window basis.
Compute the score for each point of the dataset instead of a per window basis.
...
...
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