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
2deae7a4
Commit
2deae7a4
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Add settings for construction.
parent
acbc5fb1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cml/shared/parameter.py
+43
-5
43 additions, 5 deletions
cml/shared/parameter.py
cml/shared/settings.py
+20
-1
20 additions, 1 deletion
cml/shared/settings.py
cml/static/settings.ini
+6
-0
6 additions, 0 deletions
cml/static/settings.ini
with
69 additions
and
6 deletions
cml/shared/parameter.py
+
43
−
5
View file @
2deae7a4
...
...
@@ -11,7 +11,18 @@ class SetFeatures:
return
self
.
set_features
def
__set__
(
self
,
instance
,
value
):
self
.
set_features
=
[
int
(
i
)
for
i
in
value
.
split
(
"
,
"
)]
if
isinstance
(
value
,
list
):
try
:
self
.
set_features
=
[
int
(
i
)
for
i
in
value
]
except
ValueError
:
# TODO (dmt): Provide proper exception handling
raise
Exception
(
"
Fehler
"
)
elif
isinstance
(
value
,
str
):
self
.
set_features
=
[
int
(
i
)
for
i
in
value
.
split
(
"
,
"
)]
else
:
raise
Exception
(
"
Fehler
"
)
class
CutTimeStamp
:
...
...
@@ -143,7 +154,14 @@ class LearnblockMinimum:
return
self
.
learnblock_minimum
def
__set__
(
self
,
instance
,
value
):
self
.
learnblock_minimum
=
value
if
isinstance
(
value
,
int
):
self
.
learnblock_minimum
=
value
elif
isinstance
(
value
,
str
):
try
:
self
.
learnblock_minimu
=
int
(
value
)
except
Exception
as
error
:
print
(
error
)
class
MaxCategories
:
...
...
@@ -154,7 +172,14 @@ class MaxCategories:
return
self
.
max_categories
def
__set__
(
self
,
instance
,
value
):
self
.
max_categories
=
value
if
isinstance
(
value
,
int
):
self
.
max_categories
=
value
elif
isinstance
(
value
,
str
):
try
:
self
.
max_categories
=
int
(
value
)
except
Exception
as
error
:
print
(
error
)
class
SigmaZetaCutoff
:
...
...
@@ -165,7 +190,13 @@ class SigmaZetaCutoff:
return
self
.
sigma_zeta_cutoff
def
__set__
(
self
,
instance
,
value
):
self
.
sigma_zeta_cutoff
=
value
if
isinstance
(
value
,
float
):
self
.
sigma_zeta_cutoff
=
value
elif
isinstance
(
value
,
str
):
try
:
self
.
sigma_zeta_cutoff
=
float
(
value
)
except
Exception
as
error
:
print
(
error
)
class
MinCategorySize
:
...
...
@@ -176,7 +207,14 @@ class MinCategorySize:
return
self
.
min_category_size
def
__set__
(
self
,
instance
,
value
):
self
.
min_category_size
=
value
if
isinstance
(
value
,
int
):
self
.
min_category_size
=
value
elif
isinstance
(
value
,
str
):
try
:
self
.
min_category_size
=
int
(
value
)
except
Exception
as
error
:
print
(
error
)
class
MaxModelTargets
:
...
...
This diff is collapsed.
Click to expand it.
cml/shared/settings.py
+
20
−
1
View file @
2deae7a4
...
...
@@ -78,6 +78,14 @@ class BlockProcessingSettings:
sigma_zeta_cutoff
:
float
=
SigmaZetaCutoff
()
@dataclass
class
ConstructionSettings
:
max_categories
:
int
=
MaxCategories
()
min_category_size
:
int
=
MinCategorySize
()
max_model_targets
:
int
=
MaxModelTargets
()
max_target_error
:
float
=
MaxTargetError
()
@dataclass
class
DeconstructionSettings
:
pass
...
...
@@ -101,6 +109,11 @@ def specific_settings_factory(settings_type: str):
Settings
.
STACK_ITERATIONS
,
Settings
.
LEARN_BLOCK_MINIMUM
,
Settings
.
SIGMA_ZETA_CUTOFF
)]),
"
construction
"
:
starmap
(
ConstructionSettings
,
[(
Settings
.
MAX_CATEGORIES
,
Settings
.
MIN_CATEGORY_SIZE
,
Settings
.
MAX_MODEL_TARGETS
,
Settings
.
MAX_TARGET_ERROR
)]),
"
deconstruction
"
:
starmap
(
DeconstructionSettings
,
[()]
)
...
...
@@ -116,7 +129,7 @@ def read_settings(path: str):
configure_main_settings_class
(
config
)
except
AttributeError
as
e
:
# TODO (dmt): Implement proper error handling.
pass
raise
Exception
(
"
Fehler
"
)
def
configure_main_settings_class
(
config
):
...
...
@@ -140,3 +153,9 @@ def configure_main_settings_class(config):
Settings
.
STACK_ITERATIONS
=
block_processing
[
"
stack_iterations
"
]
Settings
.
LEARN_BLOCK_MINIMUM
=
block_processing
[
"
learn_block_minimum
"
]
Settings
.
SIGMA_ZETA_CUTOFF
=
block_processing
[
"
sigma_zeta_cutoff
"
]
construction
=
config
[
"
CONSTRUCTION
"
]
Settings
.
MAX_TARGET_ERROR
=
construction
[
"
max_target_error
"
]
Settings
.
MAX_MODEL_TARGETS
=
construction
[
"
max_model_targets
"
]
Settings
.
MAX_CATEGORIES
=
construction
[
"
max_categories
"
]
Settings
.
MIN_CATEGORY_SIZE
=
construction
[
"
min_category_size
"
]
This diff is collapsed.
Click to expand it.
cml/static/settings.ini
+
6
−
0
View file @
2deae7a4
...
...
@@ -17,3 +17,9 @@ max_blocks = 100
stack_iterations
=
100
learn_block_minimum
=
1
sigma_zeta_cutoff
=
0.8
[CONSTRUCTION]
max_categories
=
10
min_category_size
=
10
max_model_targets
=
10
max_target_error
=
0.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