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
1cbe4158
Commit
1cbe4158
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Expand knowledge search with reconstruction step.
parent
7e8c23df
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/usecases/query.py
+10
-2
10 additions, 2 deletions
cml/usecases/query.py
with
10 additions
and
2 deletions
cml/usecases/query.py
+
10
−
2
View file @
1cbe4158
...
...
@@ -3,6 +3,7 @@ from os.path import expanduser, join
from
datetime
import
datetime
from
logging
import
getLogger
,
FileHandler
,
StreamHandler
from
cml.shared.errors
import
NoModelReconstructedError
from
cml.shared.parameter
import
PROTOCOL_LEVEL
from
cml.usecases.usecase
import
Usecase
from
cml.domain
import
(
...
...
@@ -44,24 +45,31 @@ class FeatureSelectionUsecase(Usecase):
class
ReconstructionUsecase
(
Usecase
):
def
process
(
self
,
request
):
return
Reconstructor
()
return
Reconstructor
(
request
.
settings
,
request
.
ml_models
,
request
.
knowledge_domain
)
class
KnowledgeSearchUsecase
(
Usecase
):
def
process
(
self
,
request
):
source
,
constr
,
f_selectr
,
reconstr
=
self
.
_init_loggers
(
request
)
reconstr
.
category
=
constr
.
construction_type
for
learnblock
in
source
.
learnblocks
:
for
complete_learnblock
in
constr
.
construct
(
learnblock
):
try
:
reduced_learnblock
=
f_selectr
.
select
(
complete_learnblock
)
pragmatic_model
=
reconstr
.
reconstruct
(
reduced_learnblock
)
except
ValueError
as
error
:
# Can't reduce learnblock
# log
continue
except
NoModelReconstructedError
:
continue
else
:
# process with reconstruction
pass
if
pragmatic_model
:
print
(
pragmatic_model
.
model
.
mean_error
)
def
_init_loggers
(
self
,
request
):
log_dir
=
create_log_dir
()
...
...
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