摘要: The K-means algorithm is based on the use of squared Euclidean distance as the measure of dissimilarity between a data point and a prototype vector. O 阅读全文
posted @ 2018-10-15 10:15 东宫得臣 阅读(166) 评论(0) 推荐(0) 编辑
摘要: To summarize, principal component analysis involves evaluating the mean x and the covariance matrix S of the data set and then finding the M eigenvect 阅读全文
posted @ 2018-10-04 17:55 东宫得臣 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <string> class Assoc { struct Pair { std::string name; double val; Pair(std::string n="", double v=0) :na 阅读全文
posted @ 2018-09-28 20:44 东宫得臣 阅读(227) 评论(0) 推荐(0) 编辑
摘要: # awk.awk { if(data[$0]++ == 0) lines[++count] = $0} END { for (i=1;i<=count;i++) print lines[i]} 脚本用法如下: awk -f awk.awk text_to_process cat text_to_p 阅读全文
posted @ 2018-09-27 07:29 东宫得臣 阅读(255) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> class Singleton { static Singleton s; int i; Singleton(int x):i(x) {} Singleton& operator=(Singleton&); Singleton(const Singleton& 阅读全文
posted @ 2018-09-23 11:58 东宫得臣 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 复制构造函数与复制赋值的区别如下: class Name { const char* s; //... }; class Table { Name* p; size_t sz; public: //... Table(const Table&); //复制构造函数 Table& operator=( 阅读全文
posted @ 2018-09-22 20:58 东宫得臣 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 关联数组是用户定义类型中最常见的也是最有用的一类。关联数组也常被成为映射(map),有时被 成为字典(dictionary),其中保存的是值的对偶。给定了一个称为关键码的值,我们就能访问另一个 称为映射值的值。可以将关联数组想象为一个下标不必是整数的数组: template<class K, cla 阅读全文
posted @ 2018-09-22 17:57 东宫得臣 阅读(1836) 评论(0) 推荐(0) 编辑
摘要: #include <sys/stat.h> int stat(const char *restrict pathname, struct stat *restrict buf); struct stat { mode_t st_mode; /*file type & mode(permissions 阅读全文
posted @ 2018-09-22 10:15 东宫得臣 阅读(3769) 评论(1) 推荐(1) 编辑
摘要: Thus we see that there are very close similarities between this Bayesian viewpoint and the conventional one based on error function minimization and r 阅读全文
posted @ 2018-09-13 12:42 东宫得臣 阅读(211) 评论(0) 推荐(0) 编辑
摘要: template <class T1, class T2> struct std::pair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair() :first(T1()), second(T2()) 阅读全文
posted @ 2018-09-07 22:13 东宫得臣 阅读(239) 评论(0) 推荐(0) 编辑