fanboykun/datamining
Composer 安装命令:
composer require fanboykun/datamining
包简介
data mining calculation in PHP
关键字:
README 文档
README
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
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-22