kaydansky/correlation-coefficient
Composer 安装命令:
composer require kaydansky/correlation-coefficient
包简介
A numerical measure of some type of correlation, meaning a statistical relationship between two variables.
README 文档
README
A correlation coefficient is a numerical measure of some type of correlation, meaning a statistical relationship between two variables.
A statistic used to show how the scores from one measure relate to scores on a second measure for the same group of individuals. A high value (approaching +1.00) is a strong direct relationship, a low negative value (approaching -1.00) is a strong inverse relationship, and values near 0.00 indicate little, if any, relationship.
Features
Two types of correlation coefficient are implemented currently:
Unlimited instance number of every type's object.
Requirements
- PHP >= 7.4.0
Installation
$ composer require kaydansky/correlation-coefficient
Basic Usage
<?php use Correlation\{Correlation, Exception\CorrelationException}; $correlation = new Correlation(); $age = [43, 21, 25, 42, 57, 59]; $glucoseLevel = [99, 65, 79, 75, 87, 81]; try { var_dump($correlation->pearson($age, $glucoseLevel)); } catch (CorrelationException $e) { echo $e->getMessage(); } $IQ = [106, 86, 100, 101, 99, 103, 97, 113, 112, 110]; $hoursOfTvPerWeek = [7, 0, 27, 50, 28, 29, 20, 12, 6, 17]; try { var_dump($correlation->spearman($IQ, $hoursOfTvPerWeek)); } catch (CorrelationException $e) { echo $e->getMessage(); }
- The library provides 2 methods according to coefficient type:
$correlation->pearson($arrayX, $arrayY); $correlation->spearman($arrayX, $arrayY);
- Each method returns an object with 2 elements:
float|int $coefficient; // Value from -1 to 1 float|int $percentage; // Same value percentage
- Every argument array must contain numeric values only: integer, float, numeric string.
- Arrays pair must have equal number of elements.
License
This software is licensed under the MIT License. See the LICENSE file for details.
kaydansky/correlation-coefficient 适用场景与选型建议
kaydansky/correlation-coefficient 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.91k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「correlation」 「coefficient」 「Pearson」 「Spearman」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kaydansky/correlation-coefficient 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kaydansky/correlation-coefficient 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kaydansky/correlation-coefficient 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Deal with Request-ID and Correlation-ID in Laravel applications
Библиотека для отслеживание запроса между сервисами
Include a correlation identifier in all requests.
Analyze data and try to find a significant trend
统计信息
- 总下载量: 2.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-20