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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vfem.c

?? 數據挖掘方面的源碼
?? 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");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频看| 麻豆中文一区二区| 亚洲高清免费视频| 粉嫩13p一区二区三区| 欧美日韩精品免费| 国产精品免费视频观看| 日本不卡不码高清免费观看| av不卡免费在线观看| 欧美mv日韩mv亚洲| 亚洲成人综合视频| 色综合色综合色综合色综合色综合 | 久久成人免费网站| 欧美伊人久久久久久久久影院| 久久久精品2019中文字幕之3| 视频一区视频二区中文| 在线欧美一区二区| 日韩一区中文字幕| 成人免费av在线| 久久综合九色综合97婷婷女人| 日韩高清电影一区| 色悠悠久久综合| 亚洲天堂福利av| av在线不卡观看免费观看| 久久久精品国产免费观看同学| 日韩av成人高清| 91精品国产色综合久久久蜜香臀| 亚洲日韩欧美一区二区在线| 成人国产精品免费观看| 国产日韩欧美在线一区| 激情文学综合插| 精品福利av导航| 狠狠狠色丁香婷婷综合久久五月| 日韩三级免费观看| 美女视频黄久久| 日韩免费电影一区| 精品一区二区三区免费播放| 欧美一级片在线观看| 免费在线看成人av| 亚洲精品在线观看视频| 国产一区二区三区四| 久久久青草青青国产亚洲免观| 久久99国产精品久久99| 国产亚洲精久久久久久| 成人三级伦理片| 亚洲天堂精品视频| 欧美日韩国产电影| 久草中文综合在线| 欧美极品xxx| 91在线播放网址| 亚洲一区二区三区在线| 日韩三级中文字幕| 国产一区二区视频在线| 国产精品色噜噜| 欧美综合久久久| 美女网站一区二区| 久久蜜臀精品av| 91一区一区三区| 首页国产欧美日韩丝袜| 精品精品国产高清一毛片一天堂| 国产成人在线看| 亚洲最新在线观看| 欧美岛国在线观看| 99视频一区二区三区| 亚洲国产精品一区二区尤物区| 欧美一区二区三区公司| 高清beeg欧美| 亚洲国产毛片aaaaa无费看| 精品乱人伦小说| 在线影视一区二区三区| 久久精品国产一区二区| 亚洲欧洲国产日韩| 欧美一区二区三区在线电影| 国产成人免费在线视频| 五月婷婷另类国产| 国产精品久久久久久亚洲毛片| 欧美日韩精品一区二区三区四区| 国产一区二区三区日韩| 亚洲国产精品久久久久秋霞影院| 欧美精品一区二区三区蜜桃视频| 97久久精品人人爽人人爽蜜臀| 日韩经典中文字幕一区| 欧美国产精品一区二区| 欧亚洲嫩模精品一区三区| 国产乱码精品一区二区三| 亚洲一区中文日韩| 国产欧美一区二区精品性| 欧美区一区二区三区| 99视频一区二区| 国模一区二区三区白浆| 亚洲一区二区三区四区在线观看| 国产亚洲欧美一级| 欧美一级黄色录像| 欧美午夜理伦三级在线观看| 国产传媒日韩欧美成人| 久久不见久久见免费视频7| 亚洲一区二区三区四区五区黄| 国产欧美在线观看一区| 4hu四虎永久在线影院成人| 色哟哟一区二区在线观看| 国产裸体歌舞团一区二区| 奇米影视一区二区三区| 亚洲人xxxx| 中文字幕一区二区三| 久久久综合视频| 日韩久久久精品| 日韩一区二区三区视频在线 | 亚洲精品伦理在线| 国产日韩欧美高清| 久久综合色天天久久综合图片| 欧美日韩一区不卡| 91福利资源站| 色综合天天综合网天天狠天天 | 日韩精品免费专区| 亚洲一本大道在线| 亚洲自拍偷拍图区| 一区二区三区蜜桃网| 亚洲一区二区三区四区中文字幕| 亚洲蜜臀av乱码久久精品| 亚洲人成网站色在线观看| 国产精品国产馆在线真实露脸 | 成av人片一区二区| 不卡av在线网| 91片黄在线观看| 91激情五月电影| 欧美精品久久天天躁| 日韩一区二区三区免费看 | 精品一区二区影视| 极品美女销魂一区二区三区| 经典三级在线一区| 国产91高潮流白浆在线麻豆| 国产精品1024| 91麻豆精品视频| 欧美日韩一级片在线观看| 欧美日韩国产欧美日美国产精品| 欧美日韩国产影片| 久久夜色精品一区| 亚洲欧洲性图库| 午夜精品影院在线观看| 老司机精品视频线观看86| 国产v综合v亚洲欧| 91麻豆产精品久久久久久| 欧美日韩不卡一区二区| 精品国产91乱码一区二区三区| 欧美成人aa大片| 亚洲乱码中文字幕| 午夜精品在线看| 国产精一品亚洲二区在线视频| 不卡av在线免费观看| 在线播放视频一区| 国产精品丝袜91| 午夜欧美在线一二页| 国产成人免费在线观看不卡| 欧美午夜理伦三级在线观看| 精品国产污污免费网站入口| 国产精品久久影院| 日韩电影在线观看电影| www.66久久| 日韩一区二区三区视频在线 | 欧美va亚洲va在线观看蝴蝶网| 国产日韩精品一区二区三区在线| 亚洲激情图片一区| 国产精品一区专区| 欧美高清精品3d| 国产精品福利电影一区二区三区四区 | 337p粉嫩大胆噜噜噜噜噜91av| 自拍偷拍亚洲综合| 国产老肥熟一区二区三区| 欧美三级韩国三级日本三斤| 国产日韩欧美高清在线| 免费在线一区观看| 色狠狠色狠狠综合| 国产欧美精品国产国产专区| 性做久久久久久久免费看| k8久久久一区二区三区| 日韩欧美一级二级| 亚洲综合无码一区二区| 国产不卡免费视频| 欧美成人免费网站| 日韩国产成人精品| 91成人免费网站| 成人免费小视频| 国产精品123区| 久久久亚洲精华液精华液精华液| 五月婷婷久久丁香| 欧美影院一区二区| 亚洲男人天堂一区| 成人av网站免费| 久久久精品tv| 国产一区二区三区综合| 日韩欧美一区在线| 国产精品沙发午睡系列990531| 国产一区二区三区香蕉 | 国产一区亚洲一区| 日韩丝袜美女视频| 日韩不卡一区二区| 日韩欧美一二三| 老司机午夜精品| 欧美大片在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国产精品国产三级国产aⅴ中文|