Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycroscopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
Vasudevan, Rama K.
pycroscopy
Commits
5f5a02dd
Commit
5f5a02dd
authored
8 years ago
by
Chris Smith
Browse files
Options
Downloads
Patches
Plain Diff
Small changes to function calls to expose functions to outside
parent
87fd62e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!9
fixed lots of stuff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycroscopy/processing/cluster.py
+7
-6
7 additions, 6 deletions
pycroscopy/processing/cluster.py
with
7 additions
and
6 deletions
pycroscopy/processing/cluster.py
+
7
−
6
View file @
5f5a02dd
...
...
@@ -65,11 +65,11 @@ class Cluster(object):
h5_group : HDF5 Group reference
Reference to the group that contains the clustering results
"""
self
.
_
_
fit
()
mean_response
=
self
.
_
_
getMeanResponse
(
self
.
results
.
labels_
)
return
self
.
_
_
writeToHDF5
(
self
.
results
.
labels_
,
mean_response
)
self
.
_fit
()
mean_response
=
self
.
_getMeanResponse
(
self
.
results
.
labels_
)
return
self
.
_writeToHDF5
(
self
.
results
.
labels_
,
mean_response
)
def
_
_fit
(
self
):
def
_fit
(
self
):
"""
Fits the provided dataset
...
...
@@ -79,8 +79,9 @@ class Cluster(object):
"""
# perform fit on the real dataset
self
.
results
=
self
.
estimator
.
fit
(
self
.
data_transform_func
(
self
.
h5_main
[
self
.
data_slice
]))
def
_
_getMeanResponse
(
self
,
labels
):
def
_getMeanResponse
(
self
,
labels
):
"""
Gets the mean response for each cluster
...
...
@@ -107,7 +108,7 @@ class Cluster(object):
mean_resp
[
clust_ind
]
=
transformToTargetType
(
avg_data
,
self
.
h5_main
.
dtype
)
return
mean_resp
def
_
_writeToHDF5
(
self
,
labels
,
mean_response
):
def
_writeToHDF5
(
self
,
labels
,
mean_response
):
"""
Writes the labels and mean response to the h5 file
...
...
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