原创 [Google]find a,b,c such that a+b+c

Question: Suppose you have a million integer numbers.  Return all possible values of a,b and c such that a+b+c<=d. d w

原创 (PAT)1004.Counting Leaves (30)

核心是個廣度優先算法,利用C++的知識可以寫的更簡潔一點,爲了聯繫C,故用數組代替,自己模擬一下隊列以及記錄當前層次以及下一層。 #include<stdio.h> #include<string.h> int n,m; int leve

原创 DataMing Papers:

因爲這篇文章引用的資料暫時還沒閱讀,因此沒有看出這篇文章的高明之處,目前只能把文章的算法簡單介紹一下,文章的精髓和意義等看了其他文章之後再來修改。 需要繼續看的文章:<Improved  boosting algorithms using

原创 (PAT)1009. Product of Polynomials (25)

#include<iostream> #include<string> #include<vector> #include<map> #include<utility> #include<algorithm> #include<ioman

原创 (PAT)1003. Emergency (25)

#include<stdio.h> #include<string.h> #define INF 1<<10 int n,m,so,ta; int cities[500+10][500+10]; int teams[500+10]; in

原创 (PAT)1008.Elevator

#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int n;

原创 (PAT)1005. Spell It Right (20)

#include<iostream> #include<string> #include <sstream> using namespace std; int main() { string eng[10]={"zero","on

原创 Weka學習 :ADTree

ADTree中主要有兩種節點,一種是PreditionNode,一種是SplitNode。weka實現中就對應定義了這兩個數據結構。 public class PredictionNode { double value; Fas

原创 Weka 學習 Apriori 附一 AprioriTID算法

       如果看了《Fast Algorithms for Mining Association Rules in Large Databases》,會發現對於 findLargeItemSets 來說,有兩種算法。第一種就是Weka

原创 Weka學習 Apriori算法附二 if(m_car)

    看完源碼,發現weka作者並沒有完全實現參考論文二(<< Intergrating Classification and Association Rule Mining>>)中所闡述的算法。只是實現了一部分,即CBA-RG (C

原创 Weka 學習 ID3

ID3算法相對簡單,weka的實現也容易理解。首先介紹一下大致算法。算法概述如下。 1.選擇一種度量(ID3選擇的是信息增益),計算每個屬性對於該度量的值。 2.根據結果選擇一個屬性進行分支。 3.如果每個分支全部屬於一個類或者已經沒有

原创 Weka學習:LMT--ResidualModelSelection & ResidualSplit

學習LMT源代碼之前,要先看幾個類,包括ResidualModelSelection ,ResidualSplit,LMTNode,,LogisticBase,SimpleLinearRegression,這裏先介紹ResidualMo

原创 Weka學習:LMT--LMT && LMTNode

LMT,沒有什麼需要講的,入口函數是public void buildClassifier(Instances data)。裏面都是一些初始化,最重要的就是 m_tree = new LMTNode(...); m_tree.buildC

原创 Weka 學習:J48(C4.5)

Before writing:To improve my english,I will write my blog in English.  Section 1: J48 J48 is a class to implement C4.5

原创 (PAT)1007. Maximum Subsequence Sum

#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int n;