Skip to content

egodasa/C45-Algorithm-PHP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C45 Algorithm - PHP Language

Modifikasi untuk mempermudah visualisasi ke library VisJs

Use Example File

Installation

The recommended way to install the C45 PHP library is through Composer :

composer require medansoftware/c45-algorithm-php

Manual Installation

composer dump-autoload

Example

$c45 = new Algorithm\C45('example.xlsx', 'PLAY');
$initialize = $c45->initialize(); // initialize
$buildTree = $initialize->buildTree();
    
$tree = $buildTree->getTree();

// nodes and edges can be implemented to VisJS directly
$nodes = $buildTree->getNodes($tree);
$edges = $buildTree->getEdges($tree);

echo "<pre>";
print_r ($tree);
echo "</pre>";

Other Examples

$c45 = new Algorithm\C45();
$c45->loadFile('example.xlsx')->setTargetAttribute('PLAY')->initialize();

echo "<pre>";
print_r ($c45->buildTree()->toString()); // print as string
echo "</pre>";

echo "<pre>";
print_r ($c45->buildTree()->toJson()); // print as JSON
echo "</pre>";

echo "<pre>";
print_r ($c45->buildTree()->toArray()); // print as array
echo "</pre>";
$new_data = array(
	'OUTLOOK' => 'Sunny',
	'TEMPERATURE' => 'Hot',
	'HUMIDITY' => 'High',
	'WINDY' => FALSE
);

echo $c45->initialize()->buildTree()->classify($new_data); // print "No"

Refrence


PATREON

PAYPAL

ETH : 0x251b36840557cCe9A245f07E1b834bCfb7354FDb

DOGE : DFmES6KZLQXimXduXwKmooykMsjhWmT1tU

BITCOIN : 1MEqUeg7fXTkBMFWfJZE9yJREsKZ4SUxQM

BITCOIN CASH : qzrllcyrjwvpnuur5kpeyp03p246fzsgzvhleswr6f

Social Media :

Made with ❤️ + ☕ ~ Agung Dirgantara

About

Metode Algoritma C45 PHP dengan VisJS

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%