时间标准化(从0到100%,步长间隔)
tnorma的Python项目详细描述
tnorma
时间标准化(从0到100%,步长间隔)。在
时间标准化通常用于不同持续时间(点数)的不同试验获得的数据的时间比对。这段代码实现了一个过程known作为标准化到百分比循环。在
此代码可以执行简单的线性插值通过每个基准或样条插值(最多五次样条曲线)通过每个基准(结)或不通过(如果输入平滑参数>;0)。在
由于该代码不执行外推法,所以作为掩码参数输入并出现在极值处的任何值可能会被删除或替换为插值前的第一个/最后一个not NaN值。
对于二维数组,由于来自不同列的数据的对齐问题,可能会删除外部具有NaN或掩码值的整行。结果,如果数据中只有nan的列,则无法执行时间规范化(空的nan和作为掩码参数输入并出现在数据中间的任何值(可能表示丢失的数据)被忽略,并通过这些点执行插值。在
安装
pip install tnorma
或者
^{pr2}$示例
>>># Default options: cubic spline interpolation passing through>>># each datum, 101 points, and no plot>>>y=[5,4,10,8,1,10,2,7,1,3]>>>tnorma(y)>>># Deal with missing data (use NaN as mask)>>>x=np.linspace(-3,3,100)>>>y=np.exp(-x**2)+np.random.randn(100)/10>>>y[:10]=np.NaN# first ten points are missing>>>y[30:41]=np.NaN# make other 10 missing points>>>yn,tn,indie=tnorma(y,step=-50,k=3,smooth=1,show=True)>>># Deal with 2-D array>>>x=np.linspace(-3,3,100)>>>y=np.exp(-x**2)+np.random.randn(100)/10>>>y=np.vstack((y-1,y[::-1])).T>>>yn,tn,indie=tnorma(y,step=-50,k=3,smooth=1,show=True)
如何引用这部作品
以下是引用GitHub存储库的建议:
Duarte, M. (2020) tnorma: A Python module for temporal normalization (from 0 to 100% with step interval), https://github.com/demotu/tnorma.
以及可能的BibTeX入口:
@misc{Duarte2020, author = {Duarte, M.}, title = {tnorma: A Python module for temporal normalization (from 0 to 100% with step interval)}, year = {2020}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/demotu/tnorma}}}
许可证
此项目的非软件内容在Creative Commons Attribution 4.0 International License下授权,软件代码在MIT license下授权。在
- 项目
标签: