定制 miqdadm/multidistance 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

miqdadm/multidistance

Composer 安装命令:

composer require miqdadm/multidistance

包简介

Calculate Multiple Distance Based Similarity Method

README 文档

README

Build Status Total Downloads Latest Unstable Version

Calculate 2 Vektor Using 8 Distance Based Similarity Method :

  • Euclidean Distance Method
  • Manhatan Distance Method
  • Minkowski Distance Method
  • Chebychef Distance Method
  • Canbera Distance Method
  • Bray Curtis Distance Method
  • Kullback Leibler Distance Method
  • Jensen Shannon Distance Method

Requirements

PHP 5.4 +

Installation

Run via composer

composer require miqdadm/multidistance

Or, you can put into your composer.json file.

"require": {
  "miqdadm/multidistance": "*"
}

Then run composer update

composer update

Basic Usage

<?php

require 'vendor/autoload.php';
use MiqdadM\Multidistance\multidistance as Calculate;

$test = new Calculate([4, 3, 6], [2, 3, 7]);
$test->distance(); //do this method first

echo 'Euclidean Distance Method';
echo'<pre>';
print_r($test->getEuclidean()); // 2.2360679774998
echo'</pre>';

echo '</br>';
echo 'Manhatan (City Block) Distance Method';
echo'<pre>';
print_r($test->getManhatan()); // 3
echo'</pre>';

echo '</br>';
echo 'Minkowski Distance (&#955 = 3) Method';
echo'<pre>';
print_r($test->getMinkowski()); // 1.9129311827724
echo'</pre>';

echo '</br>';
echo 'Chebychef Distance Method';
echo'<pre>';
print_r($test->getChebychef()); // 2
echo'</pre>';

echo '</br>';
echo 'Canbera Distance Method';
echo'<pre>';
print_r($test->getCanbera()); // 0.41025641025641
echo'</pre>';

echo '</br>';
echo 'Bray Curtis Distance Method';
echo'<pre>';
print_r($test->getBrayCurtis()); // 0.12
echo'</pre>';

echo '</br>';
echo 'Kullback Leibler Distance Method';
echo'<pre>';
print_r($test->getKullbackLeibler()); // 1.8476846432762
echo'</pre>';

echo '</br>';
echo 'Jensen Shannon Distance Method';
echo'<pre>';
print_r($test->getJensenShannon()); // 0.37829763262563
echo'</pre>';

统计信息

  • 总下载量: 38
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-08-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固