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

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

?? catgraph.java

?? 機器學習算法中的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一区二区三区免费野_久草精品视频
国产日韩欧美高清在线| 国产精品888| 在线免费观看日本欧美| 国产精品成人免费精品自在线观看| 国内久久婷婷综合| 2023国产一二三区日本精品2022| 久草这里只有精品视频| 精品国产不卡一区二区三区| 国内成+人亚洲+欧美+综合在线 | 成人午夜在线播放| 国产午夜精品美女毛片视频| 丁香六月综合激情| 国产精品日韩成人| 在线看一区二区| 五月天网站亚洲| 日韩美女在线视频| 国产一区二区91| 中文在线资源观看网站视频免费不卡 | 欧美日韩在线三级| 五月天丁香久久| 久久综合九色综合97_久久久| 国产高清成人在线| 亚洲欧美日韩小说| 在线成人高清不卡| 国产精品小仙女| 夜夜精品视频一区二区| 欧美一区二区三区思思人| 久久国产精品免费| 亚洲日本在线看| 欧美一级专区免费大片| 国产精品亚洲视频| 性久久久久久久久久久久| 精品国产一区二区精华| 99久久久久免费精品国产| 首页国产欧美日韩丝袜| 亚洲少妇屁股交4| 欧美日韩在线播放三区四区| 韩国三级在线一区| 一区二区三区精品| 久久精品夜色噜噜亚洲a∨| 色8久久精品久久久久久蜜| 免费成人在线观看视频| 国产精品超碰97尤物18| 欧美大片日本大片免费观看| 色悠久久久久综合欧美99| 麻豆91精品91久久久的内涵| 亚洲欧美日韩小说| 久久免费的精品国产v∧| 欧美性大战xxxxx久久久| 国产毛片精品一区| 午夜日韩在线电影| 1000精品久久久久久久久| 日韩视频中午一区| 91福利社在线观看| 成人国产精品免费网站| 美女精品一区二区| 亚洲午夜三级在线| 国产精品欧美一区二区三区| 欧美一区二区日韩一区二区| 91黄色免费版| 丁香婷婷综合激情五月色| 青青草国产精品97视觉盛宴| 亚洲最大成人综合| 欧美经典一区二区| 欧美一区二区播放| 欧美日韩精品综合在线| 99九九99九九九视频精品| 国产乱码精品一区二区三 | 久久中文娱乐网| 欧美日韩国产高清一区| 一本一道综合狠狠老| 国产成人啪免费观看软件| 极品少妇xxxx精品少妇偷拍| 日本欧美一区二区在线观看| 亚洲chinese男男1069| 一区二区高清视频在线观看| 国产精品国产馆在线真实露脸| 久久久精品免费网站| 亚洲精品一区二区在线观看| 欧美一级欧美三级在线观看 | 亚洲天堂2014| 国产精品久99| 国产精品白丝在线| ...av二区三区久久精品| 国产精品久久福利| 成人免费在线播放视频| 自拍视频在线观看一区二区| 中文字幕字幕中文在线中不卡视频| 国产亚洲一二三区| 欧美激情一区二区| 亚洲视频综合在线| 亚洲欧洲精品一区二区精品久久久| 国产精品久久久久久久裸模| 国产精品国产a| 最好看的中文字幕久久| 亚洲欧美日韩国产中文在线| 一区二区三区成人| 亚洲国产wwwccc36天堂| 日本在线不卡视频一二三区| 日韩av在线播放中文字幕| 久久超碰97中文字幕| 国产一区二区成人久久免费影院| 丰满亚洲少妇av| 91视视频在线观看入口直接观看www | 日韩午夜电影av| 亚洲精品一区二区三区蜜桃下载| 久久久久国产精品麻豆| 国产精品美女久久久久久久网站| 中文字幕在线观看不卡| 一区二区高清免费观看影视大全| 五月激情丁香一区二区三区| 蜜桃久久久久久久| 丰满岳乱妇一区二区三区| 91免费在线播放| 欧美精选午夜久久久乱码6080| 欧美一区二区三区婷婷月色| 国产日韩精品视频一区| 亚洲免费观看高清完整版在线 | 91精品国产综合久久精品| 久久日一线二线三线suv| 国产精品国产三级国产三级人妇 | 91精品午夜视频| 久久精品欧美日韩精品| 亚洲精选视频在线| 麻豆国产欧美一区二区三区| 成人一区二区三区在线观看| 欧美视频精品在线| 欧美精品一区二区三区久久久| 国产精品不卡一区二区三区| 偷偷要91色婷婷| 成人在线视频一区| 欧美情侣在线播放| 国产精品色哟哟网站| 天堂在线亚洲视频| 成人三级伦理片| 欧美一区二区三区免费大片| 国产精品美女久久久久久久久| 五月婷婷激情综合网| 成人一区二区三区中文字幕| 欧美老人xxxx18| 国产精品白丝在线| 国内欧美视频一区二区| 欧美日韩高清在线播放| 国产精品夫妻自拍| 久久aⅴ国产欧美74aaa| 91久久国产综合久久| 国产精品三级av在线播放| 美女视频免费一区| 精品视频色一区| 综合欧美一区二区三区| 国产成人精品aa毛片| 91精品国产乱码久久蜜臀| 亚洲激情欧美激情| 成人亚洲精品久久久久软件| 精品国一区二区三区| 调教+趴+乳夹+国产+精品| 日本精品一区二区三区四区的功能| 久久久不卡网国产精品一区| 免费观看在线综合| 欧美日韩在线播放三区四区| ...xxx性欧美| 99久久久精品免费观看国产蜜| 久久精品视频一区二区三区| 麻豆精品一区二区av白丝在线| 欧美乱妇一区二区三区不卡视频| 亚洲免费电影在线| 91免费看视频| 亚洲精品日韩一| 91麻豆国产自产在线观看| 一区在线观看视频| 99国产欧美久久久精品| 中文字幕一区二区三区视频| 成人国产精品免费观看动漫 | 国产原创一区二区| 久久亚洲捆绑美女| 国产伦精品一区二区三区免费迷 | 亚洲女人小视频在线观看| 99re成人在线| 亚洲欧美日韩国产综合| 在线亚洲一区观看| 亚洲国产精品麻豆| 717成人午夜免费福利电影| 日韩专区一卡二卡| 日韩一卡二卡三卡国产欧美| 日本伊人精品一区二区三区观看方式| 欧美精品一卡两卡| 人人超碰91尤物精品国产| 亚洲国产婷婷综合在线精品| 欧美综合在线视频| 日韩国产欧美在线视频| 日韩精品一区二区三区视频| 国模冰冰炮一区二区| 国产欧美精品区一区二区三区| 丰满少妇在线播放bd日韩电影| 1024国产精品| 欧美日韩在线播放一区| 激情文学综合丁香| 中文av一区二区| 欧美综合色免费| 免费人成网站在线观看欧美高清|