Download the PHP package medansoftware/c45-algorithm-php without Composer

On this page you can find all versions of the php package medansoftware/c45-algorithm-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package c45-algorithm-php

C4.5 Algorithm - PHP

Packagist Version Tests

A PHP implementation of the C4.5 decision tree algorithm, with support for building a tree from Excel/CSV files or plain PHP arrays, classifying new data, evaluating predictions, and exporting the resulting tree as a string, JSON, array, or Graphviz DOT diagram.

📄 Example spreadsheet

Table of Contents

Features

Requirements

PHP 5.x–7.x compatibility: If your project is running PHP 5.x, 6.x, or 7.x, use a package version below 2.0.0.

Version 2.0.0 and later require PHP ^8.1. For older PHP versions, install the latest compatible 1.x release:

Installation

Install via Composer:

Quick Start

From an Excel File

Or, using the fluent setup:

From a PHP Array

From a CSV File

Classifying New Data

Missing Values

If the split attribute required by a tree node is missing (null or an empty string), classification falls back to the branch with the highest number of training instances at that node.

This is useful when prediction data is incomplete:

If a value is present but was never observed during training, the result remains:

Evaluating Accuracy

Measure how well a built tree performs against a labeled test set:

The returned structure is:

Output Formats

As String

As JSON

As Array

As Graphviz DOT Diagram

Useful for visualizing the tree with tools like Graphviz Online or the dot CLI:

The repository contains a generated example based on the Play Tennis dataset:

Project Structure

Running Tests

Install dependencies:

Run the test suite:

The GitHub Actions workflow runs the PHPUnit suite on PHP 8.1, 8.2, and 8.3 for pushes and pull requests targeting the master and develop branches.

Upgrading from 2.0.0

The public namespace remains Algorithm\C45, but the package now uses Composer PSR-4 autoloading instead of classmap autoloading.

The implementation also introduces stricter parameter and return types. Existing valid usage should continue to work, but invalid argument types may now fail earlier with a TypeError.

The main behavioral change is how incomplete data is handled:

No application-level namespace migration is required.

License

Released under the MIT License.


Reference

Made with ❤️ + ☕ ~ Agung Dirgantara


All versions of c45-algorithm-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
phpoffice/phpspreadsheet Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package medansoftware/c45-algorithm-php contains the following files

Loading the files please wait ...