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
Iterations
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leipzig Machine Learning Group
conML
python
Commits
e528f829
"...wiki-rasa.git" did not exist on "3c5b7ffc8f6eb71a3d926d33feae1cc463d8f534"
Commit
e528f829
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Drop columns by name and not by index.
parent
ca487650
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
cml/domain/data_source.py
+8
-6
8 additions, 6 deletions
cml/domain/data_source.py
with
8 additions
and
6 deletions
cml/domain/data_source.py
+
8
−
6
View file @
e528f829
...
...
@@ -37,8 +37,9 @@ class DataSource:
class
Preprocessor
:
TARGET_COLUMN
=
"
Z
"
TIME_COLUMN
=
"
T
"
TARGET_COLUMN
=
"
Z
"
SIGMA_COLUMN
=
"
Sigma
"
def
__init__
(
self
,
settings
):
self
.
settings
=
settings
...
...
@@ -55,12 +56,13 @@ class Preprocessor:
if
self
.
settings
.
cut_time_stamp
:
self
.
_remove_common_time_stamp_prefix
(
table
)
return
table
def
_drop_irrelevant_columns
(
self
,
table
):
# TODO (dmt): Don't drop T, Z and Sigma columns!
for
column
in
table
.
get_columns
():
column_index
=
table
.
get_column_index_by_name
(
column
)
if
column_index
not
in
self
.
settings
.
set_features
:
table
.
drop_column_by_index
(
column_index
)
features_to_be_removed
=
[
table
.
get_column_name_by_index
(
i
)
for
i
in
self
.
settings
.
set_features
]
for
column
in
features_to_be_removed
:
table
.
drop_column_by_name
(
column
)
def
_overwrite_target_column
(
self
,
table
):
table
.
set_column_value
(
self
.
TARGET_COLUMN
,
self
.
settings
.
set_targets
)
...
...
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