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
af68dcca
Commit
af68dcca
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Update demo file test_construction.
parent
080e7739
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
tests/func/test_construction.py
+29
-9
29 additions, 9 deletions
tests/func/test_construction.py
with
29 additions
and
9 deletions
tests/func/test_construction.py
+
29
−
9
View file @
af68dcca
import
cml
from
cml
import
load_knowledge
from
sklearn.cluster
import
KMeans
from
sklearn.cluster
import
SpectralClustering
...
...
@@ -6,26 +7,45 @@ from sklearn.feature_selection import VarianceThreshold
from
sklearn.ensemble
import
ExtraTreesClassifier
from
sklearn.tree
import
DecisionTreeClassifier
from
sklearn.svm
import
SVC
from
pprint
import
pprint
def
demo
():
cml
.
load_settings
()
source
=
cml
.
get_data_source
(
"
/home/dmt/.cml/data/double_toyset.csv
"
)
source
=
cml
.
get_source
(
"
/home/dmt/.cml/data/double_toyset.csv
"
)
kmeans
=
KMeans
(
precompute_distances
=
True
,
algorithm
=
"
elkan
"
)
spectral
=
SpectralClustering
(
affinity
=
'
rbf
'
)
constructor
=
cml
.
construction
(
"
conceptual
"
,
kmeans
,
spectral
)
algorithms
=
[(
"
Kme
"
,
kmeans
),
(
"
Spe
"
,
spectral
)]
constructor
=
cml
.
construction
(
"
conceptual
"
,
algorithms
)
variance
=
VarianceThreshold
(
1000
)
forest
=
ExtraTreesClassifier
(
n_estimators
=
250
,
random_state
=
1
)
selector
=
cml
.
feature_selection
(
variance
,
forest
)
selector
=
cml
.
feature_selection
(
filter_method
=
variance
,
embedded_method
=
forest
)
svc
=
SVC
(
gamma
=
2
,
C
=
1
)
tree
=
DecisionTreeClassifier
(
max_depth
=
5
)
reconstructor
=
cml
.
reconstruction
(
"
conceptual
"
,
svc
,
tree
)
result
=
cml
.
search_knowledge
(
constructor
,
selector
,
reconstructor
,
source
,
stdout
=
True
)
algos
=
[(
"
Svc
"
,
svc
),
(
"
Tre
"
,
tree
)]
reconstructor
=
cml
.
reconstruction
(
"
conceptual
"
,
algos
)
deconstructor
=
cml
.
deconstruction
(
"
conceptual
"
,
source
)
result
=
cml
.
search_knowledge
(
constructor
,
selector
,
reconstructor
,
deconstructor
,
stdout
=
True
,
parallel
=
True
)
result
.
dump
(
"
./lol
"
)
knowledge
=
load_knowledge
(
"
./lol
"
)
source
=
cml
.
get_source
(
"
/home/dmt/.cml/data/double_toyset.csv
"
)
deconstructor
=
cml
.
deconstruction
(
"
conceptual
"
,
source
,
knowledge
=
knowledge
)
print
(
"
Starting Next Deconstruction
"
)
input
()
result_2
=
cml
.
search_knowledge
(
constructor
,
selector
,
reconstructor
,
deconstructor
,
stdout
=
True
)
if
__name__
==
'
__main__
'
:
...
...
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