⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtcategorizer.java

📁 机器学习算法中的ID3算法
💻 JAVA
字号:
package id3;
import java.io.*;
import shared.*;

/** DTCategorizer performs the same way as a RDGCategorizer, but for the
 * DTCategorizer the associated graph must be a tree.  See "RDGCat.c" for
 * details. Assume graph exists.
 * @author James Louis 5/30/2001 Ported to Java.
 * @author Richard Long 9/05/93 Initial revision
 */
public class DTCategorizer extends RDGCategorizer {
    /** Constructor.
     * @param dt The DecisionTree on which this categorizer will be based.
     * @param descr A description of this categorizer.
     * @param numCat The number of categories possible.
     * @param sch The Schema of data this categorizer will be used on.
     */
    public DTCategorizer(DecisionTree dt, String descr, int numCat,
    Schema sch) {
        super(constructor_cast(dt), descr, numCat, sch);
    }
    
    /** Casts this object to a RootedCatGraph object.
     * @return This object as a RootedCatGraph object.
     * @param dt	The DecisionTree to be stored in this DTCategorizer.
     */
    private static RootedCatGraph constructor_cast(DecisionTree dt) {
        RootedCatGraph rcg;
        
        rcg = dt; //cast
        dt = null;
        return rcg;
    }
    
    /***************************************************************************
     * Displays this DTCategorizer object.
     * @param stream	The BufferedWriter to which information will be displayed.
     * @param dp		The preferences for display.
     ***************************************************************************
     * public void display_struct(BufferedWriter stream, DisplayPref dp)
     * {
     * try{
     * stream.write("DTCategorizer::display_struct: not implemented yet."+'\n');
     * }catch(IOException e){e.printStackTrace();}
     * }
     */
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -