06 2015 档案
MATLAB 随机生成互不重叠的多个矩形
摘要:建立m文件draw_rectangle.m.其中p生成矩形的个数function draw_rectangle(p)t = 1;x = rand(1)*10;y = rand(1)*10;w = rand(1)*10;h = rand(1)*10;b =[x y w h];rectangle('P...
阅读全文
sequential minimal optimization,SMO for SVM, (MATLAB code)
摘要:function model = SMOforSVM(X, y, C )%sequential minimal optimization,SMOtol = 0.001; maxIters = 3000;global i1 i2 K Alpha M1 m1 w b[m, n] = size(X);K...
阅读全文
How to decide on the correct number of clusters?
摘要:Determining the number of clusters/segments in hierarchical clustering/segmentation algorithms由于unique函数在这里找矩阵不同元素的时不能有效得到,所以自己编了小程序实现。Matlab codeL:cl...
阅读全文
python 将数据随机分为训练集和测试集
摘要:# -*- coding: utf-8 -*-"""Created on Tue Jun 23 15:24:19 2015@author: hd"""from sklearn import cross_validationc = []j=0filename = r'C:\Users\hd\Deskt...
阅读全文