Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pes_to_spec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
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
Machine Learning projects.
pes_to_spec
Commits
326fa661
Commit
326fa661
authored
2 years ago
by
Danilo Ferreira de Lima
Browse files
Options
Downloads
Patches
Plain Diff
Using Z-value for the consistency check.
parent
27cbdaad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Improve fit
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pes_to_spec/__init__.py
+1
-1
1 addition, 1 deletion
pes_to_spec/__init__.py
pes_to_spec/model.py
+8
-7
8 additions, 7 deletions
pes_to_spec/model.py
with
9 additions
and
8 deletions
pes_to_spec/__init__.py
+
1
−
1
View file @
326fa661
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
Estimate high-resolution photon spectrometer data from low-resolution non-invasive measurements.
Estimate high-resolution photon spectrometer data from low-resolution non-invasive measurements.
"""
"""
VERSION
=
"
0.0.
4
"
VERSION
=
"
0.0.
5
"
This diff is collapsed.
Click to expand it.
pes_to_spec/model.py
+
8
−
7
View file @
326fa661
...
@@ -772,11 +772,12 @@ class Model(TransformerMixin, BaseEstimator):
...
@@ -772,11 +772,12 @@ class Model(TransformerMixin, BaseEstimator):
for
ch
in
channels
}
for
ch
in
channels
}
chi2
=
{
ch
:
np
.
sum
(
deviation
[
ch
]
**
2
,
axis
=
1
,
keepdims
=
True
)
chi2
=
{
ch
:
np
.
sum
(
deviation
[
ch
]
**
2
,
axis
=
1
,
keepdims
=
True
)
for
ch
in
channels
}
for
ch
in
channels
}
cutoff
=
{
ch
:
scipy
.
stats
.
chi2
.
ppf
(
0.05
,
df
=
deviation
[
ch
].
shape
[
1
]
-
1
)
chi2_mu
=
{
ch
:
scipy
.
stats
.
chi2
.
mean
(
ndof
[
ch
])
for
ch
in
channels
}
chi2_sigma
=
{
ch
:
scipy
.
stats
.
chi2
.
std
(
ndof
[
ch
])
for
ch
in
channels
}
return
{
ch
:
(
chi2
[
ch
]
-
chi2_mu
[
ch
])
/
chi2_sigma
[
ch
]
for
ch
in
channels
}
for
ch
in
channels
}
ts
=
{
ch
:
(
chi2
[
ch
]
-
cutoff
[
ch
])
/
ndof
[
ch
]
for
ch
in
channels
}
return
ts
# checking channel relevance
# checking channel relevance
#pca_model = self.x_model['pca']
#pca_model = self.x_model['pca']
...
@@ -812,9 +813,9 @@ class Model(TransformerMixin, BaseEstimator):
...
@@ -812,9 +813,9 @@ class Model(TransformerMixin, BaseEstimator):
deviation
=
(
low_pca
-
self
.
x_pca_mean
)
/
self
.
x_pca_std
deviation
=
(
low_pca
-
self
.
x_pca_mean
)
/
self
.
x_pca_std
ndof
=
float
(
deviation
.
shape
[
1
]
-
1
)
ndof
=
float
(
deviation
.
shape
[
1
]
-
1
)
chi2
=
np
.
sum
(
deviation
**
2
,
axis
=
1
,
keepdims
=
True
)
chi2
=
np
.
sum
(
deviation
**
2
,
axis
=
1
,
keepdims
=
True
)
c
utoff
=
scipy
.
stats
.
chi2
.
ppf
(
0.05
,
df
=
deviation
.
shape
[
1
]
-
1
)
c
hi2_mu
=
scipy
.
stats
.
chi2
.
mean
(
ndof
)
ts
=
(
chi2
-
cutoff
)
/
ndof
chi2_sigma
=
scipy
.
stats
.
chi2
.
std
(
ndof
)
return
ts
return
(
chi2
-
chi2_mu
)
/
chi2_sigma
#low_pca_rec = pca_model.inverse_transform(low_pca)
#low_pca_rec = pca_model.inverse_transform(low_pca)
#low_pca_unc = self.x_model['unc'].uncertainty()
#low_pca_unc = self.x_model['unc'].uncertainty()
...
...
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