📄 readme.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>ReadMe file for NeC4.5 Package</title>
<meta name="author" content="Ming Li">
<meta name="keywords" content="Machine Learning, Ensemble Learning, Decision Tree">
<meta name="generator" content="Namo WebEditor v3.0">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<h2><font face="Times New Roman"><br>
ReadMe File for NeC4.5 Package</font></h2>
<dl>
<dt><font face="Times New Roman">public class </font><font face="Times New Roman"><b>NeC45</b></font>
</dl>
<p><font face="Times New Roman"><b>Description:</b></font><font face="Times New Roman">
Use NeC4.5 to generate classification trees.<br>
<br> </font><font face="Times New Roman"><b>Reference:</b></font><font face="Times New Roman">
Z.-H. Zhou and Y. Jiang. NeC4.5: neural ensemble based C4.5. IEEE
Transactions on Knowledge and Data Engineering, 2004, 16(6): 770-773.</font></p>
<p><font face="Times New Roman"><b>ATTN:</b></font><font face="Times New Roman">
This package is free for academic
usage. You can run it at your own risk. For other purposes, please contact Prof.
Zhi-Hua Zhou (</font><a href="mailto:zhouzh@nju.edu.cn"><font face="Times New Roman">zhouzh@nju.edu.cn</font></a><font
face="Times New Roman"> ).</font></p>
<p><font face="Times New Roman"><b>Requirement:</b></font><font face="Times New Roman">
To use this package, the whole WEKA environment must be available. Refer: I.H.
Witten and E. Frank. Data Mining: Practical Machine Learning Tools and Techniques
with Java Implementations. Morgan Kaufmann, San Francisco, CA, 2000.</font></p>
<p><font face="Times New Roman"><b>Data format:</b></font><font face="Times New Roman">
Both the input and output formats are the same as those used by WEKA.</font></p>
<p><font face="Times New Roman"><b>ATTN2: </b></font><font face="Times New Roman"> This
package was developed by Mr. Ming Li ( </font><a href="mailto:liming@ai.nju.edu.cn"><font
face="Times New Roman">liming@ai.nju.edu.cn</font></a><font face="Times New Roman">
). There is a ReadMe file provided for roughly explaining the codes. But for
any problem concerning the code, please feel free to contact with Mr. Li. Please
note that since the C4.5 decision tree routine used by this package is its reimplementation
in WEKA, the performance of the package would be slightly different from that
reported in the paper.</font></p>
<p><font face="Times New Roman"> </font>
<table border cellpadding="3" cellspacing="0" width="100%">
<tr>
<td bgcolor="#CCCCFF"><p><font face="Times New Roman" size="5"><b>Field
Detail</b></font><font face="Times New Roman" size="5"> </font></td>
</tr>
</table>
<h3>m_bPrintBuildingProcess</h3>
<pre>private boolean <b>m_bPrintBuildingProcess</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The flag whether to print
the classifier-building process</font></span>
</dl>
<p><hr> </p>
<h3>m_decisionTree</h3>
<pre>private J48 <b>m_decisionTree</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The C4.5 classifier trained
on the preprocessed data set</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_baggingNN</h3>
<pre>private nec45.BaggingNN <b>m_baggingNN</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The object of neural network
ensemble via bagging</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_originalDataSet</h3>
<pre>private Instances <b>m_originalDataSet</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The original training
set</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_trainingSet</h3>
<pre>private Instances <b>m_trainingSet</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The Dataset generated
by N*, the neural network ensemble, to train a C4.5 decision tree</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_iMiu</h3>
<pre>private int <b>m_iMiu</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The ratio for extra data,
the default value is 1</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_dwAttMinValArr</h3>
<pre>private double[] <b>m_dwAttMinValArr</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The minimal value of each
attribute</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_dwAttValRangeArr</h3>
<pre>private double[] <b>m_dwAttValRangeArr</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The value range of each
attribute</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<h3>m_rand</h3>
<pre>Random <b>m_rand</b></pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The random object</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<table border cellpadding="3" cellspacing="0" width="100%">
<tr>
<td bgcolor="#CCCCFF"><p><font size="5"><b>Constructor Detail</b></font><font
size="5"> </font></td>
</tr>
</table>
<h3>NeC45</h3>
<pre>public <b>NeC45</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The Constructor</font></span>
</dl>
<dl>
<dd><hr>
</dl>
<table border cellpadding="3" cellspacing="0" width="100%">
<tr>
<td bgcolor="#CCCCFF"><p><font size="5"><b>Method Detail</b></font><font
size="5"> </font></td>
</tr>
</table>
<h3>setArgs</h3>
<pre>public void <b>setArgs</b>(int miu,
int NNs,
int hidUnit,
double learningrate,
double momentum,
int epoch,
int threshold)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">The function to Change
the Arguments of NeC4.5</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>miu:</code></font> - <span style="font-weight: 400"><font
size="3">the extra data ratio</font></span>
<dd><font size="2"><code>NNs:</code></font> - <span style="font-weight: 400"><font
size="3">the number of NNs used for ensembling via Baggging</font></span>
<dd><font size="2"><code>hidUnit:</code></font> - <span style="font-weight: 400"><font
size="3">the number of hidden units</font></span>
<dd><font size="2"><code>learningrate:</code></font> - <span style="font-weight: 400"><font
size="3">the learning rate</font></span>
<dd><font size="2"><code>momentum:</code></font> - <span style="font-weight: 400"><font
size="3">the momentum</font></span>
<dd><font size="2"><code>threshold</code></font><code>:</code> - <span style="font-weight: 400"><font
size="3">the threshold on validation set for training a neural network,
avoiding overfitting</font></span>
</dl>
<p><hr> </p>
<h3>getExtraDataRate</h3>
<pre>public int <b>getExtraDataRate</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the extra data ratio</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The extra data ratio,
miu</font></span>
</dl>
<p><hr> </p>
<h3>numHiddenUnits</h3>
<pre>public int <b>numHiddenUnits</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the number of hidden units</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The number of hidden units</font></span>
</dl>
<p><hr> </p>
<h3>getMomentum</h3>
<pre>public double <b>getMomentum</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the momentum for training a neural network</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The momentum</font></span>
</dl>
<p><hr> </p>
<h3>getLearingRate</h3>
<pre>public double <b>getLearingRate</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the Learning rate for training a neural network</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The learning rate</font></span>
</dl>
<p><hr> </p>
<h3>getValidationThreshold</h3>
<pre>public int <b>getValidationThreshold</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the validation threshold specified to avoid over fitting</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The validation threshold</font></span>
</dl>
<p><hr> </p>
<h3>getEpochs</h3>
<pre>public int <b>getEpochs</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the training epochs for a neural network</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The training epochs</font></span>
</dl>
<p><hr> </p>
<h3>isPrintBuildingProcess</h3>
<pre>public boolean <b>isPrintBuildingProcess</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call the function to get
the flag whether to print the neural network building process in training
or not</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The printing flag. true
for printing, otherwise false.</font></span>
</dl>
<p><hr> </p>
<h3>buildClassifier</h3>
<pre>public void <b>buildClassifier</b>(Instances i)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
build a NeC4.5 Classifier</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>i:</code></font> - <span style="font-weight: 400"><font
size="3">the original training set</font></span>
<dt><b>Throws:</b>
<dd><font size="2"><code>Exception: </code></font>- <span style="font-weight: 400"><font
size="3">some exception</font></span>
</dl>
<p><hr> </p>
<h3>setPrintBaggingProcess</h3>
<pre>public void <b>setPrintBaggingProcess</b>(boolean b)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
set the flag for printing the classifier-building process</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>b: </code></font>-<span style="font-weight: 400"><font
size="3"> true to print the bagging process, false otherwise</font></span>
</dl>
<p><hr> </p>
<h3>classifyInstance</h3>
<pre>public double <b>classifyInstance</b>(Instance ins)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
classify an instance with the built NeC4.5 model</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>ins:</code></font> - <span style="font-weight: 400"><font
size="3">th</font></span><span style="font-weight: 400"><font size="3">e
instance to be classified</font></span>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">the class value of the
instance</font></span>
<dt><b>Throws:</b>
<dd><font size="2"><code>Exception:</code></font> - <span style="font-weight: 400"><font
size="3">if the NeC4.5 model has not been trained before using this method</font></span>
</dl>
<p><hr> </p>
<h3>toString</h3>
<pre>public String <b>toString</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Returns a string describing
the model</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">The string describing
the model</font></span>
</dl>
<p><hr> </p>
<h3>measureSize</h3>
<pre>public double <b>measureSize</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
get the measure of the size of built decision tree </font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">Size of the tree</font></span>
</dl>
<p><hr> </p>
<h3>randomGenerateInstance</h3>
<pre>private Instance <b>randomGenerateInstance</b>()</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function the
generate the feature vector randomly </font></span><span style="font-weight: 400"><font
size="3"><i>Note</i></font></span><span style="font-weight: 400"><font size="3">:
each attribute value is within the range of original dataset</font></span>
</dl>
<dl>
<dt><b>Returns:</b>
<dd><span style="font-weight: 400"><font size="3">randomly generated feature
vector.</font></span>
</dl>
<p><hr> </p>
<h3>setRandomSeed</h3>
<pre>private void <b>setRandomSeed</b>(long seed)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call this function to
set the random seed for building the Random Object</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>seed:</code></font> - <span style="font-weight: 400"><font
size="3">the seed</font></span>
</dl>
<p><hr> </p>
<h3>setBaseAndRange</h3>
<pre>private void <b>setBaseAndRange</b>(Instances dataset)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">Call the function to set
the MinVal and Range arrays. So each value of Attribute</font></span><span
style="font-weight: 400"><font size="3"><i> i </i></font></span><span style="font-weight: 400"><font
size="3">is within the range of Min[i]~(Min[i]+Range[i])</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>dataset:</code></font> - <span style="font-weight: 400"><font
size="3">the dataset to be processed</font></span>
</dl>
<p><hr> </p>
<h3>main</h3>
<pre>public static void <b>main</b>(String[] args)</pre>
<dl>
<dd><span style="font-weight: 400"><font size="3">the static main function
for the sake of testing and comparing C4.5, NeC4.5 & Neural Network
Ensemble</font></span>
</dl>
<dl>
<dt><b>Parameters:</b>
<dd><font size="2"><code>args:</code></font> - <span style="font-weight: 400"><font
size="3">specify the dataset file path following the pattern " -t
<dataset full path> <dataset file name>"</font></span>
<dd><span style="font-weight: 400"><font size="3">
e.g. "-t D:\iris.arff"</font></span>
</dl>
<p><hr> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -