Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RSE 23 Group Assignment Shervud Pitawanik Franz
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Niklas Franz
RSE 23 Group Assignment Shervud Pitawanik Franz
Commits
43f77b90
Commit
43f77b90
authored
1 year ago
by
Sortofamudkip
Browse files
Options
Downloads
Patches
Plain Diff
get_combined_anxiety_score()
parent
12180f6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Dataset.py
+14
-0
14 additions, 0 deletions
src/Dataset.py
with
14 additions
and
0 deletions
src/Dataset.py
+
14
−
0
View file @
43f77b90
...
...
@@ -17,9 +17,23 @@ class Dataset:
pd.DataFrame: resulting preprocessed dataframe.
"""
dataframe
=
raw_dataframe
.
drop
([
"
League
"
],
axis
=
"
columns
"
)
dataframe
[
"
Anxiety_score
"
]
=
self
.
get_combined_anxiety_score
(
dataframe
)
# more preprocessing goes here
return
dataframe
def
get_combined_anxiety_score
(
self
,
dataframe
:
pd
.
DataFrame
):
gad_max
=
21
gad_min
=
0
gad_normalised
=
(
dataframe
[
"
GAD_T
"
]
-
gad_min
)
/
gad_max
spin_max
=
68
spin_min
=
0
spin_normalised
=
(
dataframe
[
"
SPIN_T
"
]
-
spin_min
)
/
spin_max
swl_max
=
35
swl_min
=
5
swl_flipped
=
1
-
(
dataframe
[
"
SWL_T
"
]
-
swl_min
)
/
swl_max
combined
=
(
gad_normalised
+
spin_normalised
+
swl_flipped
)
/
3
return
combined
def
get_dataframe
(
self
)
->
pd
.
DataFrame
:
"""
A getter function for the dataframe.
...
...
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