stdlib-js / stdlib-js/stdlib

[RFC]: Canberra distance between two strided arrays

未关闭
#831 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
C difficulty: 3 Feature JavaScript Math Native Addons priority: Normal RFC
主要语言
JavaScript
星标
6k
派生
1.3k
平均合并
1 天 3 小时
30 天内合并 PR
611

描述

### Description

This RFC proposes adding a function to calculate the Canberra distance between two strided arrays.

Package: `@stdlib/math/strided/distances/canberra`

The function should have the following signature `canberra( N, x, strideX, y, strideY )`.

The Canberra distance is a measure of dissimilarity between two samples in a data set.

The Canberra distance between two elements is as follows:

```js
(abs(x[i] - y[i]) / (abs(x[i]) + abs(y[i]))
```

See:
- [SciPy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.canberra.html#scipy.spatial.distance.canberra)
- [compute-io](https://github.com/compute-io/canberra-distance)

### Related Issues

None.

### Questions

No.

### Other

No.

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `RFC:`.

贡献指南

打开贡献指南

调研方向

Start with the @stdlib/math/strided/distances/canberra package path and review the RFC's proposed signature and Canberra-distance formula. Compare the package's conventions with the linked SciPy and compute-io references; the work is complete when the package provides the specified calculation for strided arrays.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
data
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。