fanboykun/datamining 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

fanboykun/datamining

Composer 安装命令:

composer require fanboykun/datamining

包简介

data mining calculation in PHP

README 文档

README

Total Downloads

This package provide calculation of datamining Algorithm, Current Algorithm that can be used is KMeans, C45 on working.

Installation

You can install the package via composer:

composer require fanboykun/datamining

Usage

Use the class

use Fanboykun\Datamining\Datamining

In this example, we going to use KMeans

example of the data go give

$points = Study::all()->map(function ($study, $k) {
        return [
            'key' => $study->student_id,
            'val' => [
            $study->matematika,
            $study->fisika,
            $study->kimia,
            $study->biologi,
            $study->sejarah,
            $study->akuntansi,
            $study->sosiologi,
            $study->geografi,
            ],
        ];
    })->toArray();

use one of the available method, init the custructor

// example, we use KMeans, init with desired space (data example above)
$space = (new Datamining)->initKMeans(8)

add all point into space

// give the array of the data as the point to insert into space as the first parameter
// give the key of the points(data to calculate) as the second parameter
// give to value of the data to calculate as the third parameter
 $space->addAllPointToSpace($points, 'key', 'val');

execute the calulation

// the required arguments are :

// the number of the cluster you want to set
// int $numberOfCluster

// the initialization method (set to 3 for set the first centroid manually)
// $initMethod = 1

// give the index of the array of the points you want set as the first centroid
// $selectedPoints = []
$dataset = $space->solveWithIterationCallback(2, 3, [0,1]);

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email irfanramadhan1812@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-22