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

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

?? vfem.c

?? 數(shù)據(jù)挖掘方面的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
#include "vfml.h"#include "vfem-engine.h"#include <stdio.h>#include <string.h>#include <sys/times.h>#include <time.h>#include <math.h>char *gFileStem        = "DF";char *gSourceDirectory = ".";int   gDoTests         = 0;int   gMessageLevel    = 0;int   gNumClusters     = -1;float gDelta           = 0.05;float gErrorTarget     = 0.01;float gThisErrorTarget = 0.01;int   gEstimatedNumIterations = 5;int   gBatch                  = 0;long  gMaxExamplesPerIteration = 1000000000;int   gInitNumber      = 1;int   gFancyStop              = 1;float gConvergeDelta          = 0.001;int   gSeed             = -1;float gR = 0;float gAssignErrorScale = 1.0;int   gAllowBadConverge = 0;float gSigmaSquare      = .05;int   gStdin            = 0;int   gIterativeResults = 0;int   gTestOnTrain      = 0; /* default test total center-matching distance */int   gNormalApprox     = 0;long         gDBSize                 = 0;/* HERE add parameters for these */int          gDoEarlyStop            = 0;int          gLoadCenters            = 0;int          gReassignCentersEachRound = 0;int          gUseGeoffBound          = 1;/* HERE some hackish globals & stuff*/VoidAListPtr gStatsList;int          gD;int          gIteration = 0;int          gRound     = 0;int          gTotalExamplesSeen = 0;float        gNeededDelta;float        gTargetEkd;long         gN;float        *gIterationNs = 0;int          gNumIterationNs;static void _printUsage(char  *name) {   printf("%s : Very Fast Expectation Maximization\n", name);   printf("-f <filestem>\t Set the name of the dataset (default DF)\n");   printf("-source <dir>\t Set the source data directory (default '.')\n");   printf("-clusters <numClusters>\t Set the num clusters to find (REQUIRED)\n");   printf("-variance <value>\t The variance of the Gaussians, the current\n\t\t version of EM needs this as a parameter (default 0.05)\n");   printf("-assignErrorScale <scale>\t Loosen bound by scaling the assignment\n\t\t part of it by the scale factor (default 1.0)\n");   printf("-delta <delta>\t Find final solution with confidence (1 - <delta>)\n\t\t (default 5%%)\n");   printf("-epsilon <epsilon>\t The maximum distance between a learned\n\t\t centroid and the coresponding infinite\n\t\t data centroid (default .01)\n");   printf("-converge <distance>\t Stop when distance centroids move between\n\t\t iterations squared is less than <distance>  (default .001)\n");   printf("-batch\t Do a traditional kmeans run on the whole input file.  Doesn't\n\t\t make sense to combine with -stdin (default off)\n");   printf("-init <num>\t use the <num>th valid assignment of initial centroids\n\t\t (default 1)\n");   printf("-maxPerIteration <num> \t use no more than num examples per\n\t\t iteration (default 1,000,000,000)\n");   printf("-l <number>\t The estimated # of iterations to converge if you\n\t\t guess wrong and aren't using batch VFEM will fix it for you\n\t\t and do an extra round (default 10)\n");   printf("-seed <s>\t Seed to use picking initial centers (default random)\n");   printf("-progressive\t Don't use the Lagrange based optimization\n\t\t to pick the # of samples at each iteration of the\n\t\t next round (default use the optimization)\n");   printf("-tightBound\t Use a tighter assignment error bound (requires\n\t\t a second pass over the dataset) (default use a\n\t\t looser one-pass bound)\n");   printf("-allowBadConverge\t Allows VFEM to converge at a time when\n\t\t em wouldn't (default off).\n");   printf("-r <range>\t The maximum range between pairs of examples\n\t\t (default assume the range of each dimension is 0 - 1.0\n\t\t and calculate it from that)\n");   printf("-stdin \t\t Reads training examples as a stream from stdin\n\t\t instead of from <stem>.data (default off)\n");   printf("-testOnTrain \t loss is the sum of the square of the distances\n\t\t from allu training examples to their assigned\n\t\t centroid (default compare learned centroids to\n\t\t centroids in <stem>.test)\n");   printf("-normalApprox \t use a normal approximation of the Hoeffding\n\t\t bound (default use hoeffding bound)\n");   printf("-loadCenters \t load initial centroids from <stem>.centers\n\t\t (default use random based on -init and -seed)\n");   printf("-u\t\t Output results after each iteration\n");   printf("-v\t\t Can be used multiple times to increase the debugging output\n");}static void _processArgs(int argc, char *argv[]) {   int i;   /* HERE on the ones that use the next arg make sure it is there */   for(i = 1 ; i < argc ; i++) {      if(!strcmp(argv[i], "-f")) {         gFileStem = argv[i+1];         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-source")) {         gSourceDirectory = argv[i+1];         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-u")) {         gDoTests = 1;      } else if(!strcmp(argv[i], "-testOnTrain")) {         gTestOnTrain = 1;      } else if(!strcmp(argv[i], "-clusters")) {         sscanf(argv[i+1], "%d", &gNumClusters);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-dbSize")) {         sscanf(argv[i+1], "%ld", &gDBSize);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-delta")) {         sscanf(argv[i+1], "%f", &gDelta);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-converge")) {         sscanf(argv[i+1], "%f", &gConvergeDelta);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-r")) {         sscanf(argv[i+1], "%f", &gR);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-assignErrorScale")) {         sscanf(argv[i+1], "%f", &gAssignErrorScale);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-variance")) {         sscanf(argv[i+1], "%f", &gSigmaSquare);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-epsilon")) {         sscanf(argv[i+1], "%f", &gErrorTarget);         gThisErrorTarget = gErrorTarget;         /* ignore the next argument */         i++;//      } else if(!strcmp(argv[i], "-n")) {//         sscanf(argv[i+1], "%ld", &gN);//         /* ignore the next argument *///         i++;      } else if(!strcmp(argv[i], "-maxPerIteration")) {         sscanf(argv[i+1], "%ld", &gMaxExamplesPerIteration);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-batch")) {         gBatch = 1;      } else if(!strcmp(argv[i], "-allowBadConverge")) {         gAllowBadConverge = 1;      } else if(!strcmp(argv[i], "-progressive")) {         gFancyStop = 0;      } else if(!strcmp(argv[i], "-tightBound")) {         gUseGeoffBound = 0;      } else if(!strcmp(argv[i], "-init")) {         sscanf(argv[i+1], "%d", &gInitNumber);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-l")) {         sscanf(argv[i+1], "%d", &gEstimatedNumIterations);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-seed")) {         sscanf(argv[i+1], "%d", &gSeed);         /* ignore the next argument */         i++;      } else if(!strcmp(argv[i], "-normalApprox")) {         gNormalApprox = 1;      } else if(!strcmp(argv[i], "-loadCenters")) {         gLoadCenters = 1;      } else if(!strcmp(argv[i], "-v")) {         gMessageLevel++;      } else if(!strcmp(argv[i], "-h")) {         _printUsage(argv[0]);         exit(0);      } else if(!strcmp(argv[i], "-stdin")) {         gStdin = 1;      } else {         printf("Unknown argument: %s.  use -h for help\n", argv[i]);         exit(0);      }   }   if(gNumClusters < 0) {      printf("Didn't supply the required '-clusters' argument\n");      exit(0);   }   if(gDBSize <= 0) {      printf("Didn't supply the required '-dbSize' argument\n");      exit(0);   }   if(gMessageLevel >= 1) {      printf("Stem: %s\n", gFileStem);      printf("Source: %s\n", gSourceDirectory);      if(gStdin) {         printf("Reading examples from standard in.\n");      }      if(gDoTests) {         printf("Running tests\n");      }      printf("DB Size %ld\n", gDBSize);   }}static float _MatchCentersGetDistanceSquare(VoidAListPtr learnedCenters, VoidAListPtr testCenters) {   /* perfom a 1 to 1 matching between the learned and test centers.        change the class lables of the learnedCenters to correspond to        the closest testCenters.  Do a greedy assignment that tries to        minimize the total distance between assigned pairs */   int i, j, init;   double bestDistance, thisDistance;   int lBestIndex, tBestIndex;   VoidAListPtr unLearned = VALNew();   VoidAListPtr unTest = VALNew();   float totalDistance = 0.0;   for(i = 0 ; i < VALLength(learnedCenters) ; i++) {      VALAppend(unLearned, VALIndex(learnedCenters, i));   }   for(i = 0 ; i < VALLength(testCenters) ; i++) {      VALAppend(unTest, VALIndex(testCenters, i));   }   bestDistance = lBestIndex = tBestIndex = 0;   while(VALLength(unLearned) > 0) {      init = 0;      for(i = 0 ; i < VALLength(unLearned) ; i++) {         for(j = 0 ; j < VALLength(unTest) ; j++) {            thisDistance = ExampleDistance(VALIndex(unLearned, i),                                           VALIndex(unTest, j));            if(thisDistance < bestDistance || !init) {               init = 1;               bestDistance = thisDistance;               lBestIndex = i;               tBestIndex = j;            }         }      }      if(gMessageLevel > 0) {         printf("\tMatched cluster %d distance %lf\n", ExampleGetClass(VALIndex(unTest, tBestIndex)), ExampleDistance(VALIndex(unLearned, lBestIndex), VALIndex(unTest, tBestIndex)));      }      totalDistance += bestDistance * bestDistance;      ExampleSetClass(VALRemove(unLearned, lBestIndex),               ExampleGetClass(VALRemove(unTest, tBestIndex)));   }   VALFree(unLearned);   VALFree(unTest);   return totalDistance;}static int _FindClosestCenterIndex(ExamplePtr e, VoidAListPtr centers) {   int i;   double bestDistance, thisDistance;   int bestIndex;   bestIndex = 0;   bestDistance = ExampleDistance(e, VLIndex(centers, 0));   for(i = 1 ; i < VLLength(centers) ; i++) {      thisDistance = ExampleDistance(e, VLIndex(centers, i));      if(thisDistance < bestDistance) {         bestDistance = thisDistance;         bestIndex = i;      }   }   return bestIndex;}static ExamplePtr _FindClosestCenter(ExamplePtr e, VoidAListPtr centers) {   return VALIndex(centers, _FindClosestCenterIndex(e, centers));}static float _CalculateIDKMEarlyBound(void) {   int i, j, k;   float maxError, thisError, bound, cError;   IterationStatsPtr isL, isI;   ExamplePtr eL, eI;   isL = VALIndex(gStatsList, VALLength(gStatsList) - 1);   maxError = 0;   for(i = 0 ; i < VALLength(gStatsList) ; i++) {      isI = VALIndex(gStatsList, i);      if(isI->possibleIDConverge) {         thisError = 0;         for(j = 0 ; j < VALLength(isI->centroids) ; j++) {            eL = VALIndex(isL->centroids, j);            eI = VALIndex(isI->centroids, j);            cError = 0;            for(k = 0 ; k < ExampleGetNumAttributes(eL) ; k++) {               /* HERE fix for discrete */               bound = ExampleGetContinuousAttributeValue(eL, k) -                          ExampleGetContinuousAttributeValue(eI, k) +                          IterationStatsErrorBoundDimension(isI, j, k);               cError += pow(bound, 2);            }            thisError += cError;            //printf("i%d c%d cError %f totalError %f\n",            //         i, j, cError, thisError);         }         if(thisError > maxError) {            maxError = thisError;         }      }   }   return maxError;}static float _CalculateErrorBound(void) {   int i;   float maxError = 0;   float earlyError;   IterationStatsPtr isL;   isL = VALIndex(gStatsList, VALLength(gStatsList) - 1);   /* find the error from the final iteration */   for(i = 0 ; i < VALLength(isL->centroids) ; i++) {      maxError += pow(isL->lastBound[i], 2);      if(gMessageLevel > 2) {         printf("max ekd %.4f sum bnd^2 %.4f bnd%d %.4f bnd^2%d %.4f\n",            isL->maxEkd, maxError, i, isL->lastBound[i], i,               pow(isL->lastBound[i], 2));      }   }   if(!gAllowBadConverge) {      earlyError = _CalculateIDKMEarlyBound();      if(earlyError > maxError) {         if(gMessageLevel > 1) {            printf("early stop error (%.5f) greater than El (%.5f)\n",                  earlyError, maxError);         }         maxError = earlyError;      }   }   return maxError;}static int _WhenEMConverged(void) {   int i;   IterationStatsPtr is;   for(i = 0 ; i < VLLength(gStatsList) ; i++) {      is = VLIndex(gStatsList, i);      if(is->wouldEMConverge) {         return i;      }   }   return VLLength(gStatsList) - 1;}static void _doTests(ExampleSpecPtr es, VoidAListPtr learnedCenters, long learnCount, long learnTime, int finalOutput) {   char fileNames[255];   FILE *exampleIn, *testCentersIn, *centersOut;   ExamplePtr e, tc, lc;   VoidAListPtr testCenters;   long i;   float loss;   float bound;   int foundBound, guarenteeIDConverge, lastFoundBound;   long tested = 0;   foundBound = 0;   if(VALLength(gStatsList) > 0) {      lastFoundBound = ((IterationStatsPtr)VALIndex(gStatsList,                VALLength(gStatsList) - 1))->foundBound;      guarenteeIDConverge = ((IterationStatsPtr)VALIndex(gStatsList,                     VALLength(gStatsList) - 1))->guarenteeIDConverge;      if(lastFoundBound) {         if(guarenteeIDConverge) {            foundBound = 1;            if(gMessageLevel >= 1) {               printf("Have a bound and ID would converge\n");            }         } else if(((IterationStatsPtr)VALIndex(gStatsList,                        VALLength(gStatsList) - 1))->wouldEMConverge &&                    gAllowBadConverge) {            if(gMessageLevel >= 1) {               printf("Have a bound and ID may or may not converge, we converge.\n");

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区在线播放| 欧美国产精品专区| 日日夜夜免费精品| 7777精品伊人久久久大香线蕉经典版下载| 一区二区视频在线| 在线观看视频欧美| 日韩av中文字幕一区二区三区 | 亚洲国产美女搞黄色| 欧美伊人久久久久久久久影院| 亚洲国产另类精品专区| 欧美老人xxxx18| 久久国产日韩欧美精品| 国产蜜臀97一区二区三区| 91亚洲精华国产精华精华液| 夜夜揉揉日日人人青青一国产精品| 3d成人h动漫网站入口| 久久爱www久久做| 国产精品蜜臀在线观看| 欧美体内she精高潮| 96av麻豆蜜桃一区二区| 亚洲美女免费在线| 欧美一区二区三区在| 成人性生交大片免费看中文| 亚洲精品水蜜桃| 精品乱码亚洲一区二区不卡| 国产999精品久久| 亚洲综合视频在线观看| 精品欧美一区二区三区精品久久| 成人h动漫精品一区二区| 天天操天天色综合| 国产亚洲制服色| 欧美日韩国产在线观看| 国产麻豆成人精品| 亚洲精品成a人| 精品国产乱码久久久久久夜甘婷婷| 成人午夜看片网址| 亚洲mv大片欧洲mv大片精品| 亚洲国产高清aⅴ视频| 欧美日韩在线三区| 福利91精品一区二区三区| 手机精品视频在线观看| 欧美国产精品一区| 日韩一区二区麻豆国产| 色视频欧美一区二区三区| 精品写真视频在线观看| 亚洲国产成人av网| 国产精品拍天天在线| 日韩三级免费观看| 精品视频在线免费| 99久久精品一区二区| 国内外成人在线| 亚洲成av人片一区二区三区| 综合久久久久久| 久久综合九色综合97_久久久| 欧美日韩情趣电影| 欧日韩精品视频| 91在线观看成人| 高潮精品一区videoshd| 免费成人你懂的| 性做久久久久久久久| 一区二区三区视频在线观看| 国产精品的网站| 欧美国产精品一区| 欧美激情一区二区在线| 日韩欧美久久一区| 制服丝袜av成人在线看| 欧美性极品少妇| 色94色欧美sute亚洲线路一久| 成人性生交大片| 国产精品99久久久久| 国产九色sp调教91| 激情五月激情综合网| 国内欧美视频一区二区| 精品夜夜嗨av一区二区三区| 日韩国产高清影视| 视频一区免费在线观看| 日韩电影一区二区三区| 天堂va蜜桃一区二区三区 | 精品成人在线观看| 日韩久久精品一区| 精品少妇一区二区三区| 欧美成人a∨高清免费观看| 欧美电影免费观看完整版| 日韩免费观看高清完整版| 精品国产凹凸成av人网站| 欧美va在线播放| 久久精品在线观看| 欧美激情一区二区在线| 国产精品色噜噜| 亚洲激情图片小说视频| 亚洲国产精品欧美一二99 | 蜜臀久久99精品久久久画质超高清| 日韩高清不卡一区二区| 激情欧美日韩一区二区| 成人免费视频视频在线观看免费| 国产1区2区3区精品美女| 日韩欧美区一区二| 欧美成人猛片aaaaaaa| 久久精品男人的天堂| 国产精品美女久久福利网站| 一区二区国产盗摄色噜噜| 婷婷开心久久网| 国产精品538一区二区在线| 色综合天天综合网国产成人综合天 | 亚洲色图欧洲色图| 午夜激情综合网| 激情五月婷婷综合| 一本大道久久精品懂色aⅴ | 精品精品欲导航| 中文字幕不卡的av| 亚洲一区免费视频| 精品一区二区三区视频| 99久久精品国产麻豆演员表| 欧美丰满美乳xxx高潮www| 久久人人超碰精品| 亚洲伊人色欲综合网| 精品一区二区三区在线视频| 91在线视频网址| 制服丝袜亚洲播放| 国产精品久久久久久久久免费桃花| 亚洲国产一二三| 激情五月婷婷综合| 欧美伊人精品成人久久综合97| 精品国产乱码久久久久久久| 亚洲色图欧洲色图| 国产一区欧美二区| 欧美日韩情趣电影| 中文字幕亚洲电影| 精品一区二区三区免费视频| 91免费视频网| 精品欧美久久久| 午夜久久福利影院| 91视频.com| 国产日韩欧美不卡| 理论片日本一区| 欧美性猛片xxxx免费看久爱| 中文字幕国产一区| 久久精品二区亚洲w码| 欧美丝袜丝nylons| 国产精品区一区二区三| 黑人精品欧美一区二区蜜桃| 色噜噜狠狠成人中文综合| 国产亚洲欧美色| 久久99最新地址| 5566中文字幕一区二区电影| 亚洲欧洲成人精品av97| 国产一区二区三区免费观看| 欧美一级片在线看| 亚洲国产你懂的| 在线观看www91| 亚洲男女一区二区三区| www.欧美日韩| 欧美国产成人在线| 国产成人午夜高潮毛片| 久久影院电视剧免费观看| 美女一区二区视频| 91麻豆精品国产综合久久久久久| 亚洲乱码精品一二三四区日韩在线| 懂色av一区二区三区蜜臀| 久久久久久一二三区| 成人99免费视频| 中文在线资源观看网站视频免费不卡| 精品一区二区三区免费毛片爱 | 国产中文字幕精品| 精品少妇一区二区三区免费观看| 日韩av一级电影| 91精品国产91综合久久蜜臀| 午夜影院在线观看欧美| 欧美色网站导航| 午夜精品久久久久久| 欧美一区二区三区在线电影| 免费黄网站欧美| 日韩欧美激情在线| 精彩视频一区二区三区| 久久久久久毛片| 国产精品99久久久久久有的能看| 国产丝袜欧美中文另类| 成人精品一区二区三区中文字幕| 国产精品免费免费| 91香蕉视频黄| 亚洲国产视频在线| 这里只有精品免费| 美女免费视频一区二区| 精品国产一区二区三区四区四| 久久99九九99精品| 国产网红主播福利一区二区| 99精品视频一区二区| 亚洲精品视频在线观看网站| 欧美福利视频导航| 老色鬼精品视频在线观看播放| 久久精品这里都是精品| 色哟哟欧美精品| 日韩av一级电影| 欧美激情在线观看视频免费| 日本高清视频一区二区| 日产国产高清一区二区三区| 久久精品一区蜜桃臀影院| 色久综合一二码| 麻豆成人久久精品二区三区红| 久久精品欧美日韩|