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
acbc5fb1
Commit
acbc5fb1
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Handle Sigma Z relatives in learn block creation.
parent
9f9d12fb
No related branches found
Branches containing commit
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
+16
-3
16 additions, 3 deletions
cml/domain/data_source.py
with
16 additions
and
3 deletions
cml/domain/data_source.py
+
16
−
3
View file @
acbc5fb1
...
...
@@ -110,15 +110,24 @@ class Preprocessor:
class
LearnblockIdentifier
:
def
__init__
(
self
,
settings
):
def
__init__
(
self
,
settings
,
density_estimator
,
relative_extrema
):
self
.
settings
=
settings
self
.
column_pairs
=
((
"
T
"
,
"
Z
"
),
(
"
T
"
,
"
Sigma
"
),
(
"
Sigma
"
,
"
Z
"
))
self
.
density_estimator
=
density_estimator
self
.
_relative_extrema
=
relative_extrema
def
identify
(
self
,
block
):
biggest_learn_block
=
None
biggest_block_size
=
0
for
pair
in
self
.
column_pairs
:
for
possible_learnblock
in
self
.
_identify_relatives
(
block
,
*
pair
):
if
self
.
_is_learn_block
(
possible_learnblock
.
length
):
yield
possible_learnblock
if
possible_learnblock
.
length
>
biggest_block_size
:
biggest_learn_block
=
possible_learnblock
biggest_learn_block
.
relatives
=
pair
return
biggest_learn_block
def
_is_learn_block
(
self
,
block_length
):
return
block_length
>
self
.
settings
.
learn_block_minimum
...
...
@@ -130,7 +139,11 @@ class LearnblockIdentifier:
if
value_pair
not
in
already_seen
:
already_seen
.
add
(
value_pair
)
kw
=
{
args
[
0
]:
value_pair
[
0
],
args
[
1
]:
value_pair
[
1
]}
yield
block
.
get_values
(
**
kw
)
if
args
[
0
]
==
"
Sigma
"
and
args
[
1
]
==
"
Z
"
:
for
block
in
self
.
_get_sigma_zeta_relatives
(
block
,
**
kw
):
yield
block
else
:
yield
block
.
get_values
(
**
kw
)
def
_get_sigma_zeta_relatives
(
self
,
block
,
**
kw
):
relatives
=
block
.
get_values
(
**
kw
)
...
...
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