Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
skais
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Raphael Sturgis
skais
Merge requests
!15
Resolve "normalisation should raise exception when bad arguments given"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "normalisation should raise exception when bad arguments given"
22-normalisation-should-raise-exception-when-bad-arguments-given
into
develop
Overview
0
Commits
7
Pipelines
0
Changes
2
Merged
Resolve "normalisation should raise exception when bad arguments given"
Raphael Sturgis
requested to merge
22-normalisation-should-raise-exception-when-bad-arguments-given
into
develop
Apr 7, 2022
Overview
0
Commits
7
Pipelines
0
Changes
2
Closes
#22 (closed)
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
e837df89
7 commits,
Apr 7, 2022
2 files
+
40
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
skais/ais/ais_points.py
+
6
−
1
View file @ e837df89
Edit in single-file editor
Open in Web IDE
Show full file
@@ -44,6 +44,9 @@ class AISPoints:
def
normalize
(
self
,
min_max_features
=
(),
standardization_features
=
(),
third_quartile_features
=
(),
divide_by_value
=
(),
divide_by_max
=
(),
normalization_dict
=
None
):
if
normalization_dict
is
None
:
if
len
(
min_max_features
)
==
len
(
standardization_features
)
==
len
(
third_quartile_features
)
==
len
(
divide_by_value
)
==
len
(
divide_by_max
)
==
0
:
raise
ValueError
(
"
All arguments are empty
"
)
normalization_dict
=
{}
for
f
in
min_max_features
:
if
f
in
self
.
df
.
columns
:
@@ -94,7 +97,7 @@ class AISPoints:
normalization_dict
[
f
]
=
{
'
type
'
:
'
divide by max
'
,
'
maximum
'
:
maximum
}
self
.
df
[
f
]
=
self
.
df
[
f
]
/
maximum
el
se
:
el
if
type
(
normalization_dict
)
==
dict
:
for
f
in
normalization_dict
:
if
f
in
self
.
df
.
columns
:
if
normalization_dict
[
f
][
'
type
'
]
==
'
min-max
'
:
@@ -125,6 +128,8 @@ class AISPoints:
raise
ValueError
(
f
"
{
normalization_dict
[
f
][
'
type
'
]
}
not a valid normalization method. Must be on of [min-max,
"
f
"
standardization, 3rd quartile, divide by value]
"
)
else
:
raise
ValueError
(
"
normalization_dict not a dictionary
"
)
return
normalization_dict
# New features
Loading