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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? splitscore.java

?? 本程序是用java語言編寫的數(shù)據(jù)挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
     *
     * @return TRUE if there is a splitAndLabel distribution, FALSE otherwise.
     */
    public boolean has_distribution(){return has_distribution(true);}
    
    /** Checks if there exists a splitAndLabel distribution.
     *
     * @param fatalOnFalse TRUE if an error message is to be displayed if there is no splitAndLabel
     * distribution.
     * @return TRUE if there is a splitAndLabel distribution, FALSE otherwise.
     */
    public boolean has_distribution(boolean fatalOnFalse) {
        if (!(splitAndLabelDist == null))
            return true;
        if (fatalOnFalse)
            Error.err("SplitScore::has_distribution: no distribution-->"+
            "fatal_error");
        return false;
    }
    
    /** Returns cache.condEntropy, first checking to see if it has yet been set.
     * This method updates the cache.
     * @return The condEntropy stored in the cache.
     */
    public double get_cond_entropy() {
        valid_cache(); // Percolate validCache to the cache members.
        if (cache.condEntropy == Globals.UNDEFINED_REAL && has_distribution(true))
            this.cache.condEntropy =
            Entropy.cond_entropy(get_split_and_label_dist(),
            get_split_dist(), total_weight());
        return cache.condEntropy;
    }
    
    
    private boolean valid_cache() {
        if (validCache && has_distribution(false))
            return true;
        // When the cache is not valid, set the ancillary arrays NULL,
        //   invalidate the numeric data, and set the valid flag TRUE.
        cache.splitDist = null;
        cache.labelDist = null;
        cache.totalWeight = Globals.UNDEFINED_REAL;
        cache.mutualInfo = Globals.UNDEFINED_REAL;
        cache.entropy = Globals.UNDEFINED_REAL;
        cache.condEntropy = Globals.UNDEFINED_REAL;
        cache.gainRatio = Globals.UNDEFINED_REAL;
        cache.splitEntropy = Globals.UNDEFINED_REAL;
        validCache = true;
        return false;
    }
    
    /** Returns the total weight from the cache. This method updates the cache.
     *
     * @return The total weight.
     */
    public double total_weight() {
        valid_cache(); // Percolate validCache to the cache members.
        if (cache.totalWeight != Globals.UNDEFINED_REAL)
            return cache.totalWeight;
        if (!has_distribution(true))
            Error.err("SplitScore::num_instancess: splitAndLabelDist not yet "+
            "set-->fatal_error");
        else {
            if (cache.splitDist != null)
                cache.totalWeight = MLJArray.sum(cache.splitDist);
            else {
                get_label_dist();
                cache.totalWeight = MLJArray.sum(cache.labelDist);
            }
        }
        return cache.totalWeight;
    }
    
    /** The label distribution is calculated from the split and label distribution.
     * This method updates the cache.
     * @return The label distribution.
     */
    public double[] get_label_dist() {
        valid_cache(); // Percolate validCache to the cache members.
        if (cache.labelDist != null)
            return cache.labelDist;
        if (!has_distribution(false))
            Error.err("SplitScore::get_label_dist: splitAndLabelDist has not "+
            "been set-->fatal_error");
        else {
            //      cache.labelDist = new double[splitAndLabelDist[0].length];
            cache.labelDist = new double[splitAndLabelDist.length];
            Matrix.sum_rows(cache.labelDist,splitAndLabelDist);
        }
        return cache.labelDist;
    }
    
    /** Returns a reference to the requested distribution array.
     *
     * @return The splitAndLabel distribution array.
     */
    public double[][] get_split_and_label_dist() {
        valid_cache();
        if (splitAndLabelDist == null)
            Error.err("SplitScore::get_split_and_label_dist: Array has not "+
            "been allocated-->fatal_error");
        return splitAndLabelDist;
    }
    
    /** Returns cache.entropy, first checking to see if it has yet been set.
     * This method updates the cache.
     *
     *
     * @return The entropy stored in the cache.
     */
    public double get_entropy() {
        valid_cache(); // Percolate validCache to the cache members.
        if (cache.entropy == Globals.UNDEFINED_REAL && has_distribution(true))
            cache.entropy = Entropy.entropy(get_label_dist());
        return cache.entropy;
    }
    
    
    private void verify_strictly_greater(double lhs, double rhs,
    String additionalErrMsg) {//basicCore class function
        if (lhs <= (rhs + (MLJ.realEpsilon))) {
            Error.err(additionalErrMsg + "\n verify_strictly_greater(Real): "+
            "variable is not at least " + MLJ.realEpsilon + " greater than its"+
            "lower bound (" + rhs + ")-->fatal_error");
            //      Error.err(additionalErrMsg + "\n verify_strictly_greater(Real): variable (" + MString(lhs, 20, 0, MString::general) +
            //	  ") is not at least " + MLJ.realEpsilon + " greater than its lower bound (" + rhs + ")-->fatal_error");
        }
    }
    
    /** The criterion calculation depends on the score criterion. For gainRatio it's
     * (surprise) gain ratio.  For mutualInfo and normalizedMutualInfo it's mutualInfo.
     * For mutualInfoRatio it's mutualInfo / entropy. This method updates the cache.
     *
     * @return The score for the split.
     */
    public double score() {
        switch (get_split_score_criterion()) {
            case mutualInfo:
                return get_mutual_info(false);
            case normalizedMutualInfo:
                return get_mutual_info(true);
            case gainRatio:
                return get_gain_ratio();
            case mutualInfoRatio:
                return get_mutual_info_ratio();
            case externalScore:
                return get_external_score();
            default:
                Error.err("SplitScore::score: split score criterion of " +
                get_split_score_criterion() +
                " is out of range-->fatal_error");
                return 0;
        }
    }
    
    /** Computes the scores and updates the cache when there are being computed many
     * times for the same number of instances and entropy. This would happen, for
     * instance, when determining the best threshold for a split.
     * @param sAndLDist The split and label distribution.
     * @param sDist The split distribution.
     * @param lDist The label distribution.
     * @param passedEntropy The entropy value for this split.
     * @param passedWeight The weight of instances for this split.
     * @return The score for this split distribution.
     * @see Entropy#find_best_threshold
     */
    public double score(double[][] sAndLDist, double[] sDist,
    double[] lDist, double passedEntropy,
    double passedWeight) {
        // Distribution arrays are passed as consts; handed over to
        //   SplitScore; then released back to the invoker.
        
        // Save the both the current cache and the splitAndLabelDist reference.
        // Restore them prior to returning.  Note:  the cache saves the
        //   references to the old dists, not the dists themselves.
        double theOldExternalScore = theExternalScore;
        boolean oldValidCache = validCache;
        double[][] oldSplitAndLabelDist = splitAndLabelDist;
        CacheStruct oldCache = cache;
        splitAndLabelDist = null;
        cache.splitDist = null;
        cache.labelDist = null;
        
        double[][] sAndLDistP = sAndLDist;  // No const.
        set_split_and_label_dist(sAndLDistP);
        if (sDist != null) {
            double[] sDistP = sDist; // No const.
            set_split_dist(sDistP);
        }
        if (lDist != null) {
            double[] lDistP = lDist; // No const.
            set_split_dist(lDistP);
        }
        valid_cache();
        if (passedEntropy != Globals.UNDEFINED_REAL) {
            //      DBG(mlc.verify_approx_equal(passedEntropy, get_entropy(),
            //	                          "SplitScore::score: given entropy "
            //	                          "not equal to calculated entropy");
            //	  );
            cache.entropy = passedEntropy;
        }
        cache.totalWeight = passedWeight;
        
        double theScore = score();
        
        if (sDist != null) {
            double[] releasedSplitDist = release_split_dist();
            //      (void)releasedSplitDist;
            //      DBG(ASSERT(mlc.approx_equal(*releasedSplitDist, *sDist)));
        }
        if (lDist != null) {
            double[] releasedLabelDist = release_label_dist();
            //      (void)releasedLabelDist;
            //      DBG(ASSERT(mlc.approx_equal(*releasedLabelDist, *lDist)));
        }
        double[][] releasedSplitAndLabelDist = release_split_and_label_dist();
        //   (void)releasedSplitAndLabelDist;
        //   DBG(ASSERT(mlc.approx_equal(*releasedSplitAndLabelDist, *sAndLDist)));
        
        // Restore
        cache = oldCache;
        splitAndLabelDist = oldSplitAndLabelDist;
        validCache = oldValidCache;
        theExternalScore = theOldExternalScore;
        
        return theScore;
    }
    
    
    
    /** Returns the type of criterion used in scoring splits.
     * @return The scoring criterion.
     * @see #mutualInfo
     * @see #normalizedMutualInfo
     * @see #gainRatio
     * @see #mutualInfoRatio
     * @see #externalScore
     */
    public byte get_split_score_criterion()
    {return splitScoreCriterion;}
    
    /** Returns the value, set externally, for the score.
     *
     * @return The externally set score value.
     */
    public double get_external_score() {
        if (splitAndLabelDist == null && theExternalScore != Globals.UNDEFINED_REAL)
            Error.err("SplitScore::get_external_score:  splitAndLabelDist was "+
            "deleted without theExternalScore being invalidated-->fatal_error");
        if (theExternalScore == Globals.UNDEFINED_REAL)
            Error.err("SplitScore::get_external_score: no score set-->"+
            "fatal_error");
        return theExternalScore;
    }
    
    /** Returns the mutual information ratio, which is the ratio between the mutual
     * info and entropy. The mutual information must be >= 0. Although const, this
     * method updates the cache.
     *
     * @return Mutual information ratio.
     */
    public double get_mutual_info_ratio() {
        double denominator = get_entropy();
        MLJ.verify_strictly_greater(denominator, 0,
        "SplitScore::get_mutual_info_ratio: Need to divide by entropy, which "+
        "is too small");
        DoubleRef ratio = new DoubleRef(get_mutual_info(false) / denominator);
        MLJ.clamp_to_range(ratio, 0, 1, "SplitScore::get_mutual_info_ratio: "+
        "ratio not in required range [0, 1]");
        return ratio.value;
    }
    
    /** Determines, and returns, cache.gainRatio. This method updates the cache.
     *
     * @return The gainRatio stored in the cache.
     */
    public double get_gain_ratio() {
        valid_cache(); // Percolate validCache to the cache members.
        double gain = cache.gainRatio;
        if (cache.gainRatio == Globals.UNDEFINED_REAL && has_distribution(true)) {
            double numerator = get_mutual_info(false);
            double divisor = get_split_entropy();
            // If the divisor is zero, we abort.
            if (MLJ.approx_equal(divisor, 0.0))
                Error.err("SplitScore::get_gain_ratio: split entropy (" + divisor +
                ") is too close to zero for division. Split and Label Dist is: " +

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av在线不卡免费看| 欧美日韩第一区日日骚| 一区二区三区日韩欧美| 成人网页在线观看| 日本午夜精品一区二区三区电影 | 欧洲另类一二三四区| 国产一区二区三区不卡在线观看| 一区二区三区蜜桃网| 中文字幕av资源一区| 日韩亚洲欧美高清| 91成人看片片| eeuss鲁片一区二区三区在线观看| 午夜精品福利一区二区蜜股av| 国产精品麻豆欧美日韩ww| 9191成人精品久久| 在线一区二区视频| 北岛玲一区二区三区四区| 久久国产夜色精品鲁鲁99| 午夜av一区二区| 亚洲男人的天堂在线aⅴ视频| 欧美激情综合五月色丁香小说| 日韩精品一区在线观看| 欧美日韩午夜在线| 91看片淫黄大片一级在线观看| 国产精品自在欧美一区| 久久成人精品无人区| 日韩电影在线观看一区| 午夜精品福利一区二区三区蜜桃| 亚洲综合清纯丝袜自拍| 亚洲激情在线激情| 亚洲情趣在线观看| 最好看的中文字幕久久| 最新成人av在线| 最新久久zyz资源站| 国产精品麻豆99久久久久久| 日本一区二区三区电影| 久久午夜老司机| 久久久久99精品一区| 久久综合色综合88| 欧美大片一区二区| 欧美mv日韩mv国产网站app| 日韩视频123| 日韩视频在线你懂得| 欧美一区二区三区精品| 欧美一区二区成人| 日韩视频一区二区| 久久午夜电影网| 国产精品色在线观看| 国产精品国产三级国产aⅴ原创 | 久久久亚洲高清| 欧美激情中文不卡| 亚洲三级免费电影| 亚洲精品久久7777| 日韩电影在线观看一区| 久久电影网电视剧免费观看| 国产成人免费网站| 99久久久久免费精品国产 | 欧美性猛交xxxx黑人交| 欧美一区二区三区四区五区| 精品欧美一区二区久久| 国产视频一区二区三区在线观看 | 国产在线精品一区在线观看麻豆| 国产精品资源在线观看| 波多野结衣精品在线| 欧美伊人久久久久久久久影院 | 一区二区理论电影在线观看| 亚洲成人一二三| 久久99久久精品欧美| 成人app网站| 欧美日韩一本到| 久久久久久亚洲综合| 亚洲欧美偷拍卡通变态| 日本亚洲天堂网| 成人免费视频视频| 欧美三级电影在线观看| 亚洲精品一区二区三区四区高清| 国产精品三级电影| 五月婷婷综合网| 国产一区91精品张津瑜| 91福利社在线观看| 久久色在线观看| 亚洲一区二区三区中文字幕| 国内精品伊人久久久久av影院 | 欧美夫妻性生活| 国产清纯白嫩初高生在线观看91 | 欧美国产日产图区| 亚洲成av人片一区二区| 国产乱码精品1区2区3区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 久久精品免费看| 91在线免费播放| 亚洲精品一区二区三区蜜桃下载 | 蜜桃av一区二区| 成人精品一区二区三区中文字幕 | 洋洋av久久久久久久一区| 国产主播一区二区| 欧美群妇大交群的观看方式 | 美女一区二区三区| 91色在线porny| 26uuu精品一区二区| 亚洲成人动漫av| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 91一区一区三区| 久久久午夜精品| 亚洲成av人影院| 色天天综合色天天久久| 欧美激情一区二区三区在线| 免费成人av在线播放| 欧美日韩精品一区二区三区四区 | 久久成人18免费观看| 欧美丝袜自拍制服另类| 中文字幕日本乱码精品影院| 国产乱码精品一区二区三| 日韩欧美电影在线| 亚洲二区在线视频| 一本色道久久加勒比精品| 国产精品久久久久久久久免费樱桃 | 91麻豆成人久久精品二区三区| 久久久激情视频| 韩国精品一区二区| 日韩精品一区二区三区在线播放| 亚洲va韩国va欧美va精品| 色婷婷av一区二区三区之一色屋| 中文字幕一区二区三区不卡在线| 国产精品18久久久久久久久 | 天天亚洲美女在线视频| 欧美在线免费视屏| 亚洲精品ww久久久久久p站| www.日韩在线| 国产精品免费观看视频| 国产suv一区二区三区88区| 久久久久久久久久美女| 国产伦理精品不卡| 精品成人佐山爱一区二区| 久久电影网站中文字幕| 精品剧情在线观看| 久久精品国产网站| 色999日韩国产欧美一区二区| 国产亚洲一二三区| 国产激情一区二区三区四区| 久久亚洲春色中文字幕久久久| 国产乱淫av一区二区三区 | 亚洲高清免费一级二级三级| 欧美日韩国产中文| 性久久久久久久久久久久| 欧美日韩免费观看一区三区| 日韩精品电影在线| 日韩三级视频在线观看| 久久国产免费看| 久久久久国色av免费看影院| 成人毛片在线观看| 亚洲三级免费电影| 欧美色网一区二区| 老汉av免费一区二区三区| 久久婷婷国产综合国色天香| 成人激情免费电影网址| 亚洲免费电影在线| 3751色影院一区二区三区| 久久成人免费网| 国产精品久久二区二区| 色欧美片视频在线观看在线视频| 亚洲第一在线综合网站| 精品免费视频.| 大白屁股一区二区视频| 一区二区三区中文在线观看| 欧美精品日韩一区| 精品一区二区三区免费播放| 国产精品日产欧美久久久久| 一本到一区二区三区| 五月婷婷激情综合网| 精品国产乱码久久久久久图片 | 中文字幕中文字幕在线一区 | 亚洲人成精品久久久久| 欧美一二三区在线| www.成人网.com| 日产欧产美韩系列久久99| 久久精品一区二区三区不卡牛牛| 91成人在线免费观看| 精品一区二区三区免费| 亚洲精品少妇30p| 精品国产sm最大网站| 色综合色狠狠天天综合色| 久久国产乱子精品免费女| 亚洲免费成人av| 亚洲精品一区二区三区福利| 色播五月激情综合网| 国产一区二区三区在线观看精品 | 亚洲日本韩国一区| 欧美成人猛片aaaaaaa| 色综合天天综合在线视频| 另类小说色综合网站| 亚洲精品国产精品乱码不99| 精品少妇一区二区三区在线播放| 91免费版pro下载短视频| 久久国产精品色| 亚洲午夜羞羞片| 国产日韩精品一区二区浪潮av| 777色狠狠一区二区三区| 91香蕉视频mp4| 国产成人精品亚洲日本在线桃色|