Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
68f466b0
Commit
68f466b0
authored
3 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
fixed curvefit.py
parent
410a3ea7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
7 merge requests
!685
Release 2.4
,
!684
Release 2.4
,
!567
Release 2.2.1
,
!566
Release 2.2
,
!501
Release 2.1
,
!372
fix doctest snippets
,
!355
docstring cleanup - part1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/curvefit.py
+19
-16
19 additions, 16 deletions
saqc/funcs/curvefit.py
with
19 additions
and
16 deletions
saqc/funcs/curvefit.py
+
19
−
16
View file @
68f466b0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from
__future__
import
annotations
from
math
import
floor
from
typing
import
Tuple
,
Union
from
typing_extensions
import
Literal
import
numpy
as
np
...
...
@@ -25,7 +25,7 @@ def fitPolynomial(
data
:
DictOfSeries
,
field
:
str
,
flags
:
Flags
,
window
:
Union
[
int
,
str
]
,
window
:
int
|
str
,
order
:
int
,
min_periods
:
int
=
0
,
**
kwargs
...
...
@@ -53,36 +53,39 @@ def fitPolynomial(
Parameters
----------
data : dios.DictOfSeries
The data.
The data
container
.
field : str
The
column
, holding the data-to-be-modelled
.
A
column
in flags and data
.
flags :
saqc.
Flags
Container to store quality flags to data
.
flags : Flags
The flags container
.
window :
{
str, int
}
The s
ize of the window you want to use for fitting. If an integer is passed,
window : str, int
S
ize of the window you want to use for fitting. If an integer is passed,
the size refers to the number of periods for every fitting window. If an
offset string is passed, the size refers to the total temporal extension. The
window will be centered around the vaule-to-be-fitted. For regularly sampled
timeseries the period number will be casted down to an odd number if even.
data always a odd number of periods will be used for the fit (periods-1 if
periods is even).
order : int
The d
egree of the polynomial used for fitting
D
egree of the polynomial used for fitting
min_periods : int or None, default 0
The m
inimum number of
periods, that has to be available in every values
fitting surrounding for the polynomial fit to be performed. If there are not
enough values, np.nan gets assigned. Default (0) results in fitting
regardless of the number of values pre
se
n
t
(results in overfitting for too
sparse intervals). To automatically set the minimum number of periods to the
number of values in an offset defined window size, pass np.nan
.
M
inimum number of
observations in a window required to perform the fit,
otherwise NaNs will assigned.
If ``None``, `min_periods` default to 1 for integer windows and to the
size of the window for off
set
based windows.
Passing 0, disables the feature and will result in over-fitting for too
sparse windows
.
Returns
-------
data : dios.DictOfSeries
Modified data
flags : saqc.Flags
Flags
"""
reserved
=
[
"
residues
"
,
"
set_flags
"
]
filterKwargs
(
kwargs
,
reserved
)
...
...
This diff is collapsed.
Click to expand it.
David Schäfer
@schaefed
mentioned in commit
63b55c6d
·
2 years ago
mentioned in commit
63b55c6d
mentioned in commit 63b55c6d7dadb0e612b23a897f292d5ffc14cb52
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
684dc8a0
·
2 years ago
mentioned in commit
684dc8a0
mentioned in commit 684dc8a0515470d644fc85fee95d07661c8dd572
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
8f7a90e4
·
1 year ago
mentioned in commit
8f7a90e4
mentioned in commit 8f7a90e4aed61c79a9dc8d67541a46beba0907e8
Toggle commit list
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