muddy-28 / php-decision-tree Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kokukuma/php-decision-tree
This project forked from kokukuma/php-decision-tree
【ソフト名】決定木作成モジュール 【著作権者】狩野達也 【制作日】2011/11/18 【種 別】決定木、CART 【連絡先】[email protected] 【動作環境】CentOS 6 【開発環境】CentOS 6 ――――――――――――――――――――――――――――――――――――― ≪著作権および免責事項≫ ――――――――――――――――――――――――――――――――――――― 【はじめに】 このモジュールは、CARTアルゴリズムを使った決定木の作成、 利用を行うためのモジュールです。 【インストール方法】 以下の通り. ・php-decision-tree $ git clone git://github.com/kokukuma/php-decision-tree.git 【使い方例】 1, モジュールの読み込み require_once('Make_Decision_Tree.php'); 2, データの準備 $data = array(); $data[0] = array("生死"=>"生還","年齢"=>"35","性別"=>"男","等級"=>"1等"); $data[1] = array("生死"=>"生還","年齢"=>"12","性別"=>"女","等級"=>"1等"); $data[2] = array("生死"=>"生還","年齢"=>"35","性別"=>"女","等級"=>"1等"); $data[3] = array("生死"=>"死亡","年齢"=>"26","性別"=>"男","等級"=>"1等"); $data[4] = array("生死"=>"生還","年齢"=>"23","性別"=>"女","等級"=>"1等"); 目的変数は2値変数のみ、 カテゴリ変数は「2値変数」「多値変数」「連続変数」に対応している。 判別基準としては、以下のようになっている. ・多値変数 : 値の種類が3種類以上、数字のみでない。 ・連続変数 : 値の種類が3種類以上、数字のみ ・2値変数 : 上記以外の場合 3, データの読み込み $dt = new Decision_Tree($data); 4, 決定木の生成 $tree = $dt->classify('生死','生還','死亡'); 第1引数 : 目的変数名 第2引数 : 正とする目的変数の値 第3引数 : 誤とする目的変数の値 5, 決定木の利用 $target = array("年齢"=>"40","性別"=>"男","等級"=>"2等"); $res = $dt->prognosis($target); $targetのデータ構造は, $dataの1要素から目的変数を除いた形式とする。 返値には、決定木から想定される目的変数の値が返却される。 ―――――――――――――――――――――――――――――――――――――
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.