亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? catgraph.java

?? Decision Tree 決策樹算法ID3 數據挖掘 分類
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package id3;
import java.io.*;
import java.util.*;
import shared.*;
import shared.Error;

/** CatGraph is a directed graph whose nodes have references to Categorizers.
 * Edges are labelled with the category number they match. The CatGraph can be
 * either complete or sparse. This is decided at the time of creation and
 * cannot be changed thereafter.								<P>
 *
 * For complete graphs:									<P>
 * Each node's first edge must be labelled either UNKNOWN_CATEGORY_VAL or
 * FIRST_CATEGORY_VAL. Each additional edge must be labelled with the next
 * category in ascending order.								<P>
 *
 * For sparse graphs:									<P>
 * A node may have zero or more children. Detection of a child can be done
 * using the get_child_if_exists() function, which returns a reference to the
 * child node if it exists, and otherwise returns a NULL reference.            <P>
 *
 * @author James Louis	2/25/2001	Ported to Java.
 * @author Jay DeSouza	8/13/97	Added handling for sparse graphs
 * @author Richard Long	8/20/93	Initial revision (.c)
 * @author Richard Long	8/19/93	Initial revision (.h)
 */
public class CatGraph {
    /** The CGraph object containing the graph used for this CatGraph.
     */
    protected CGraph cGraph;
    /** TRUE if the graph is allocated, FALSE if the graph is set to NULL.
     */
    boolean graphAlloc;
    /** TRUE if the graph is sparsely generated.
     */
    boolean isSparse;
    /** Logging options for this class.
     */
    protected LogOptions logOptions = new LogOptions();
    /** Distribution display help string.
     */
    protected String distDispHelp = "This option specifies whether to display the "+
    "distribution of instances of the nodes in the graph while displaying. ";
    /** The default value for distribution display. The default is FALSE.
     */
    protected boolean defaultDistDisp = false;
    
    
    /** Sets the logging level for this object.
     * @param level	The new logging level.
     */
    public void set_log_level(int level){logOptions.set_log_level(level);}
    
    /** Returns the logging level for this object.
     * @return The logging level for this object.
     */
    public int  get_log_level(){return logOptions.get_log_level();}
    
    /** Sets the stream to which logging options are displayed.
     * @param strm	The stream to which logs will be written.
     */
    public void set_log_stream(Writer strm)
    {logOptions.set_log_stream(strm);}
    
    /** Returns the stream to which logs for this object are written.
     * @return The stream to which logs for this object are written.
     */
    public Writer get_log_stream(){return logOptions.get_log_stream();}
    
    /** Returns the LogOptions object for this object.
     * @return The LogOptions object for this object.
     */
    public LogOptions get_log_options(){return logOptions;}
    
    /** Sets the LogOptions object for this object.
     * @param opt	The new LogOptions object.
     */
    public void set_log_options(LogOptions opt)
    {logOptions.set_log_options(opt);}
    
    /** Sets the logging message prefix for this object.
     * @param file	The file name to be displayed in the prefix of log messages.
     * @param line	The line number to be displayed in the prefix of log messages.
     * @param lvl1 The log level of the statement being logged.
     * @param lvl2	The level of log messages being displayed.
     */
    public void set_log_prefixes(String file, int line,int lvl1, int lvl2)
    {logOptions.set_log_prefixes(file, line, lvl1, lvl2);}
    
    /** Constructor.
     * @param isGraphSparse	TRUE if this CatGraph is sparsely populated. FALSE
     * otherwise.
     */
    public CatGraph(boolean isGraphSparse) {
        cGraph = new CGraph();
        isSparse = isGraphSparse;
        graphAlloc = true;
        logOptions = new LogOptions();
        logOptions.LOG(3, "CatGraph::CatGraph(Bool isGraphSparse): isSparse = "
        + isSparse + " is_sparse() = " + is_sparse() + '\n');
    }
    
    /** Constructor.
     * @param aGraph		CGraph on which all operations will take place. It
     * should remain unchanged while a part of this
     * CatGraph object.
     * @param isGraphSparse	TRUE if this CatGraph is sparsely populated. FALSE
     * otherwise.
     */
    public CatGraph(CGraph aGraph, boolean isGraphSparse) {
        cGraph = aGraph;
        isSparse = isGraphSparse;
        graphAlloc = false;
        logOptions = new LogOptions();
        logOptions.LOG(6, "CatGraph::CatGraph(CGraph, Bool): isSparse = "
        + isSparse + " is_sparse() = " + is_sparse() + '\n');
    }
    
    /** Checks if this CatGraph is sparsely populated.
     * @return TRUE if this CatGraph is sparsely populated.
     */
    public boolean is_sparse() {
        return isSparse;
    }
    
    /** Returns the number of Nodes in this CatGraph.
     * @return The number of Nodes in this CatGraph.
     */
    public int num_nodes() {
        return cGraph.number_of_nodes();
    }
    
    /** Returns the number of leaves in this CatGraph.
     * @return The number of leaves in this CatGraph.
     */
    public int num_leaves() {
        return cGraph.num_leaves();
    }
    
    /** Returns the CGraph stored in this CatGraph object.
     * @return The CGraph stored in this CatGraph object.
     */
    public CGraph get_graph() {
        return cGraph;
    }
    
    /** Returns the number of attributes stored in this CatGraph.
     * @return The number of attributes stored in this CatGraph.
     * @param maxAttr	The maximum number of attributes stored in the CatGraph.
     */
    public int num_attr(int maxAttr) {
        return cGraph.num_attr(logOptions.get_log_options() , maxAttr);
    }
    
    /** Creates a new Node.
     * @return The new Node.
     * @param cat		The Categorizer to be stored in the new Node.
     * @param level The level for the new node placement.
     */
    public Node create_node(NodeCategorizer[] cat, int level) {
        NodeInfo nodeInfo = cGraph.get_prototype() .create_my_type(level);
        nodeInfo.set_categorizer(cat);
        MLJ.ASSERT(cat[0] == null, "CatGraph::create_node: cat != NULL");
        return cGraph.new_node(nodeInfo);
    }
    
    /** Creates a directed Edge from Node "from" to Node "to". Assigns the Edge
     * the value "edgeLabel" and gets ownership of the AugCategory.             <P>
     * For non-sparse graphs:                                                 <BR>
     * The category given must be the category following the category for
     * the previous Edge.                                                       <BR>
     * The first Edge must have label UNKNOWN_CATEGORY_VAL or
     * FIRST_CATEGORY_VAL.
     *
     * @param from		The Node that is the source of the directed Edge.
     * @param to		The Node that is the destination of the directed Edge.
     * @param edgeLabel	The category to be assigned to the new Edge.
     */
    public void connect(Node from,Node to,
    AugCategory edgeLabel) {
        // grab these values in advance.  Makes debugging easier too.
        NodeInfo fromInfo =(NodeInfo) get_graph() .entry(from);
        NodeInfo toInfo =(NodeInfo) get_graph() .entry(to);
        NodeCategorizer fromCat = fromInfo.get_categorizer();
        NodeCategorizer toCat = toInfo.get_categorizer();
        
        if (!fromCat.in_graph())
            Error.fatalErr("CatGraph::connect: the \'from\' node "
            +fromCat.description()
            + " is not in the graph");
        if (!toCat.in_graph())
            Error.fatalErr("CatGraph::connect: the \'to\' node "
            +toCat.description()
            + " is not in the graph");
        logOptions.LOG(8, "CatGraph::connect: isSparse = " +isSparse
        + " is_sparse() = " +is_sparse()
        + " !is_sparse() = " +!is_sparse() + '\n');
        if (!is_sparse()) {
            if (from.outdeg() == 0 && edgeLabel.num() != Globals.FIRST_CATEGORY_VAL &&
            edgeLabel.num() != Globals.UNKNOWN_CATEGORY_VAL)
                Error.fatalErr("CatGraph::connect: The first edge must have label "
                +Globals.FIRST_CATEGORY_VAL+ " or "
                +Globals.UNKNOWN_CATEGORY_VAL+ ".  Given label was " +edgeLabel.num());
            if (from.outdeg() != 0 &&
            edgeLabel.num() != ((AugCategory) cGraph.inf(from.last_adj_edge())) .num() + 1)
                Error.fatalErr("CatGraph::connect: Edge label "
                + ((AugCategory) cGraph.inf(from.last_adj_edge())) .num() + 1
                + " must follow edge label "
                + ((AugCategory) cGraph.inf(from.last_adj_edge())) .num()
                + "; got edge label " + edgeLabel.num());
        }
        for(Edge edgePtr = from.First_Adj_Edge(0) ; edgePtr != null ; edgePtr = edgePtr.Succ_Adj_Edge(from))
            if ((cGraph.inf(edgePtr)) == edgeLabel) {
                Error.err("CatGraph::connect: Attempting to add a duplicate edge: "
                +edgeLabel
                + ".  Edge " + (cGraph.inf(edgePtr)) + " already exists. ");
            }
        cGraph.new_edge(from, to, edgeLabel);
        edgeLabel = null;
    }
    
    /** Returns the number of children the specified Node has.
     * @return The number of children the specified Node has.
     * @param parent	The specified Node.
     */
    public int num_children(Node parent) {
        return parent.outdeg();
    }
    
    /** Returns the NodeCategorizer stored in the specified Node.
     * @return The NodeCategorizer stored in the specified Node.
     * @param nodePtr The Node containing the NodeCategorizer.
     */
    public NodeCategorizer get_categorizer(Node nodePtr) {
        return((NodeInfo) cGraph.inf(nodePtr)) .get_categorizer();
    }
    
    /** Checks if specified Node is in this NatGraph object.
     * @return TRUE if the Node is a node that is in the CatGraph. Otherwise,
     * returns FALSE.
     * @param node			The Node to be looked for.
     * @param fatalOnFalse	TRUE if an error message should be displayed if the
     * specified Node is not in the CatGraph, FALSE
     * otherwise.
     */
    public boolean check_node_in_graph(Node node,
    boolean fatalOnFalse) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女www爽爽爽| 精品国产乱码久久久久久蜜臀| 精品亚洲porn| 久久精品72免费观看| 日一区二区三区| 亚洲丶国产丶欧美一区二区三区| 依依成人综合视频| 一区二区三区高清| 日韩福利视频导航| 亚洲成av人片www| 日韩经典中文字幕一区| 日本aⅴ免费视频一区二区三区| 亚洲香肠在线观看| 亚洲国产成人va在线观看天堂| 亚洲图片欧美综合| 五月婷婷欧美视频| 老司机精品视频一区二区三区| 日本美女视频一区二区| 精品亚洲欧美一区| 高清不卡在线观看av| av高清不卡在线| 91精品办公室少妇高潮对白| 欧美剧在线免费观看网站 | 国产99久久久精品| 国产成人av电影在线| 91片黄在线观看| 欧美亚洲免费在线一区| 91精品国产福利在线观看 | 激情综合色综合久久| 国产精品伊人色| 91丨porny丨中文| 欧美另类久久久品| 久久综合99re88久久爱| 国产精品久久久一本精品| 亚洲五码中文字幕| 精品午夜久久福利影院| 91免费在线播放| 国产精品久久网站| 视频一区中文字幕| 国产宾馆实践打屁股91| 欧洲视频一区二区| 久久久久久久网| 亚洲第一在线综合网站| 国产成人精品免费一区二区| 欧美视频中文字幕| 国产亚洲成av人在线观看导航| 亚洲一区二区精品3399| 国产成人a级片| 欧美人与z0zoxxxx视频| 自拍av一区二区三区| 久久99精品视频| 色八戒一区二区三区| 久久老女人爱爱| 亚洲成a人v欧美综合天堂| 成人免费av网站| 欧美tk—视频vk| 性做久久久久久| 91年精品国产| 中文字幕五月欧美| 国产美女av一区二区三区| 欧美日高清视频| 亚洲精品免费一二三区| 成人高清视频在线| 久久午夜色播影院免费高清| 日本怡春院一区二区| 欧美综合一区二区三区| 亚洲桃色在线一区| 国产99久久久久| 欧美国产日韩精品免费观看| 国产专区综合网| 日韩欧美国产电影| 免费看欧美美女黄的网站| 7777精品伊人久久久大香线蕉超级流畅| 国产精品视频一二| 成人深夜视频在线观看| 国产午夜精品久久| 国产成人三级在线观看| 久久精品这里都是精品| 国产一区二区剧情av在线| 精品裸体舞一区二区三区| 美女久久久精品| 亚洲女人小视频在线观看| 91在线精品一区二区| 中文字幕在线观看一区| 一本久久a久久免费精品不卡| 综合久久国产九一剧情麻豆| 色婷婷激情综合| 亚洲自拍偷拍欧美| 在线观看91精品国产麻豆| 日韩成人精品视频| 精品国产乱码久久| 国产激情一区二区三区| 欧美韩国日本不卡| 色网站国产精品| 同产精品九九九| 26uuu精品一区二区| 懂色av噜噜一区二区三区av| 亚洲欧洲另类国产综合| 欧美色欧美亚洲另类二区| 蜜芽一区二区三区| 欧美激情一区不卡| 欧美视频一区在线| 久草在线在线精品观看| 日本一区二区三区视频视频| 91丨porny丨首页| 三级成人在线视频| 国产精品五月天| 欧美日韩在线电影| 国产高清成人在线| 亚洲国产一区二区视频| 久久久综合网站| 日本韩国欧美一区二区三区| 蜜臂av日日欢夜夜爽一区| 国产精品毛片高清在线完整版| 欧美亚洲国产一区二区三区| 色先锋aa成人| 国产综合久久久久久久久久久久| 亚洲同性gay激情无套| 日韩欧美国产小视频| 99久久国产免费看| 黄页视频在线91| 亚洲制服丝袜av| 中文子幕无线码一区tr| 制服.丝袜.亚洲.中文.综合| 91污在线观看| 国内久久精品视频| 日韩综合小视频| 艳妇臀荡乳欲伦亚洲一区| 国产亚洲一区二区三区| 91麻豆精品国产无毒不卡在线观看 | 一本久道久久综合中文字幕| 狠狠色伊人亚洲综合成人| 亚洲成人综合在线| 亚洲欧洲99久久| 国产视频在线观看一区二区三区 | 久久国产欧美日韩精品| 一区二区在线观看免费| 日本一区二区免费在线| 日韩亚洲欧美中文三级| 欧美日韩综合在线免费观看| 一本在线高清不卡dvd| 成人avav在线| 岛国精品一区二区| 国产在线播放一区二区三区| 蜜臀av亚洲一区中文字幕| 亚洲国产毛片aaaaa无费看| 亚洲人成精品久久久久| 亚洲视频一区二区免费在线观看| 秋霞电影网一区二区| 午夜不卡在线视频| 视频一区欧美日韩| 五月综合激情日本mⅴ| 午夜影院久久久| 午夜av一区二区三区| 日韩在线观看一区二区| 日韩二区三区在线观看| 性欧美疯狂xxxxbbbb| 日韩av在线免费观看不卡| 日韩中文字幕区一区有砖一区| 亚洲国产成人av| 午夜亚洲国产au精品一区二区| 亚洲午夜久久久久久久久电影院 | 日韩欧美国产麻豆| 欧美一级电影网站| 欧美成人r级一区二区三区| 日韩欧美的一区二区| 精品久久免费看| 国产欧美一区二区精品性色| 国产精品乱子久久久久| 一区二区三区国产| 蜜桃一区二区三区在线观看| 久久精品国产在热久久| 国产不卡视频在线观看| 色综合视频一区二区三区高清| 欧洲色大大久久| 欧美va亚洲va| 日韩理论电影院| 天天综合日日夜夜精品| 精品在线观看视频| 成人一区二区三区视频| 欧美性受xxxx黑人xyx| 精品国产3级a| 中文字幕日韩一区| 午夜精品成人在线视频| 国模冰冰炮一区二区| 色综合天天综合网天天看片| 欧美日本国产视频| 国产香蕉久久精品综合网| 一区二区三区四区激情| 麻豆精品一区二区综合av| av在线不卡免费看| 欧美一区二区三区电影| 中文字幕日本不卡| 婷婷六月综合亚洲| 成人激情开心网| 欧美理论片在线| 国产精品久久久久久福利一牛影视 | 亚洲一区二区四区蜜桃| 国产一区二区三区香蕉| 欧美精三区欧美精三区|