clustMD r语言_R语言:dtwclust包里面,修改dist默认的选项

1。distmatrix

2.dtw(a,b, step=symmetric1,window.size=3L,window.type="sakoechiba", keep=T);

在1中计算距离矩阵的时候想用dtw这个方法,但是想改一下dtw默认的选项,哪位大神知道的话,求帮助

# ====================================================================================

# Registering a custom distance with the 'proxy' package and using it

# ====================================================================================

# Normalized asymmetric DTW distance

ndtw

dtw::dtw(x, y, step.pattern = asymmetric,

distance.only = TRUE, ...)$normalizedDistance

}

# Registering the function with 'proxy'

if (!pr_DB$entry_exists("nDTW"))

proxy::pr_DB$set_entry(FUN = ndtw, names=c("nDTW"),

loop = TRUE, type = "metric", distance = TRUE,

description = "Normalized asymmetric DTW")

# Subset of (original) data for speed

pc.ndtw

distance = "nDTW",

seed = 8319,

trace = TRUE,

args = tsclust_args(dist = list(window.size = 18L)))

# Which cluster would the first series belong to?

# Notice that newdata is provided as a list

predict(pc.ndtw, newdata = series[1L])

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值