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
0b14346b
Commit
0b14346b
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Mode meta information of model to separate dataclass.
parent
56fda637
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/reconstruction.py
+71
-1
71 additions, 1 deletion
cml/domain/reconstruction.py
with
71 additions
and
1 deletion
cml/domain/reconstruction.py
+
71
−
1
View file @
0b14346b
from
random
import
sample
from
random
import
sample
from
collections
import
defaultdict
from
collections
import
defaultdict
from
dataclasses
import
dataclass
from
functools
import
partial
from
functools
import
partial
import
krippendorff
import
krippendorff
...
@@ -12,10 +13,79 @@ __all__ = (
...
@@ -12,10 +13,79 @@ __all__ = (
)
)
@dataclass
class
Metadata
:
knowledge_domain
:
str
knowledge_tier
:
int
identifier
:
int
pre_image
:
list
t_min
:
int
t_max
:
int
sigma
:
list
zeta
:
list
def
__str__
(
self
):
return
f
"
Knowledge domain: <
{
self
.
knowledge_domain
}
>
"
\
f
"
Knowledge tier: <
{
self
.
knowledge_tier
}
>
"
\
f
"
Identifier: <
{
self
.
identifier
}
>
"
\
f
"
Pre image: <
{
self
.
pre_image
}
>
"
\
f
"
T min: <
{
self
.
t_min
}
>
"
\
f
"
T max: <
{
self
.
t_max
}
>
"
\
f
"
Subjects: <
{
self
.
sigma
}
>
"
\
f
"
Puposes: <
{
self
.
zeta
}
>
"
class
PragmaticMachineLearningModel
:
class
PragmaticMachineLearningModel
:
def
__init__
(
self
,
model
,
learnblock
):
def
__init__
(
self
,
meta
,
model
,
learnblock
):
self
.
meta
=
meta
self
.
model
=
model
self
.
model
=
model
self
.
domain_size
=
learnblock
.
n_features
self
.
domain_size
=
learnblock
.
n_features
self
.
domain
=
learnblock
.
indexes
def
__hash__
(
self
):
return
hash
(
self
.
uid
)
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
PragmaticMachineLearningModel
):
return
hash
(
self
)
==
hash
(
other
)
raise
NotImplementedError
()
@property
def
tier
(
self
):
return
self
.
meta
.
knowledge_tier
@property
def
min_timestamp
(
self
):
return
self
.
meta
.
t_min
@property
def
max_timestamp
(
self
):
return
self
.
meta
.
t_max
@property
def
pre_image
(
self
):
return
self
.
meta
.
pre_image
@property
def
subject
(
self
):
return
self
.
meta
.
sigma
@property
def
purpose
(
self
):
return
self
.
meta
.
zeta
@property
def
uid
(
self
):
return
"
.
"
.
join
([
self
.
meta
.
knowledge_domain
,
str
(
self
.
meta
.
knowledge_tier
),
str
(
self
.
meta
.
identifier
)])
@property
def
sample_times
(
self
):
pass
def
fusion
(
self
,
prag_model
):
pass
class
Reconstructor
:
class
Reconstructor
:
...
...
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