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
f342a4f6
Commit
f342a4f6
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Identify blocks that satisfy the criteria for being a learning block.
parent
cedc14be
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
+19
-0
19 additions, 0 deletions
cml/domain/data_source.py
with
19 additions
and
0 deletions
cml/domain/data_source.py
+
19
−
0
View file @
f342a4f6
...
...
@@ -57,3 +57,22 @@ class Preprocessor:
class
LearnblockIdentifier
:
def
__init__
(
self
,
settings
):
self
.
settings
=
settings
self
.
column_pairs
=
((
"
T
"
,
"
Z
"
),
(
"
T
"
,
"
Sigma
"
),
(
"
Sigma
"
,
"
Z
"
))
def
identify
(
self
,
block
):
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
def
_is_learn_block
(
self
,
block_length
):
return
block_length
>
self
.
settings
.
learn_block_minimum
def
_identify_relatives
(
self
,
block
,
*
args
):
# TODO (dmt): Implement density and kmeans!
already_seen
=
set
()
for
value_pair
in
block
.
get_duplicated_pairs
(
args
[
0
],
args
[
1
]):
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
)
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