版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1 1 3IntroductiontoMatlab3IntroductiontoMatlabWhatisaMatlabToolboxesarespecializedcollectionsofMatlabWhydoweneedthe4WhattypeoftoolboxesdoesMatlab4WhattypeoftoolboxesdoesMatlab▪▪ParallelComputing数学、统计与优SymbolicMathPartialDifferentialEquationStatisticsandMachineLearningCurveFittingOptimizationNeuralNetworkModel-BasedCalibrationControlSystemToolboxFuzzyLogicToolboxRobustControlModelPredictiveControlToolboxAerospaceToolboxRoboticsSystem▪▪▪▪▪▪▪5WhattypeoftoolboxesdoesMatlab5WhattypeoftoolboxesdoesMatlab信号处无线DSPSystemToolboxAudioSystemToolboxWaveletToolboxRFToolboxLTESystemToolboxWLANSystem▪▪▪▪▪▪▪▪▪▪图像处理与计算机视ImageProcessingToolboxVisionHDLToolboxMappingToolbox▪▪▪▪▪测试&DataAcquisitionToolboxImageAcquisitionToolboxOPCToolboxVehicleNetwork▪▪▪▪▪6Whattypeoftoolboxesdoes6WhattypeoftoolboxesdoesMatlab计算FinancialDatafeedToolboxDatabaseToolboxSpreadsheetLink(forMicrosoftExcel)FinancialInstrumentsToolbox▪▪▪▪▪▪▪计算生Bioinformatics代码MATLABHDLVisionHDLHDLFilterDesignHDLFixed-Point7Whattypeoftoolboxes7WhattypeoftoolboxesdoesMatlabMATLABMATLABCompilerSpreadsheetLink(forMicrosoftMATLABProductionDatabaseMATLABReportFromDeepLearning8WherecanI8WherecanIfindinformationregarding9ClusteringusingtheStatistics9ClusteringusingtheStatisticsandMachineLearningToolboxTheMatlabStatisticsandMachineLearningToolboxhasmanyStatisticsandDataimportandexport,descriptivestatistics,visualizationProbabilityDistributionsDatafrequencymodels,randomsamplegeneration,parameterestimationHypothesisTestst-test,F-test,chi-squaregoodness-of-fittest,andClusterUnsupervisedlearningtechniquestofindnaturalgroupingsandpatternsinAnalysisofvarianceandcovariance,multivariateANOVA,repeatedmeasuresANOVALinear,generalizedlinear,nonlinear,andnonparametrictechniquesforsupervisedSupervisedlearningalgorithmsforbinaryandmulticlassproblemsDimensionalityReductionPCA,factoranalysis,nonnegativematrixfactorization,sequentialfeatureselection,andmoreIndustrialStatisticsDesignofexperiments(DOE);survivalandreliabilityanalysis;statisticalprocesscontrolSpeedUpStatisticalComputationsParallelordistributedcomputationofstatistical▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪WhatisAWhatisAwaytoform'naturalgroupings'inyourItisaformofunsupervisedlearning–yougenerallydoNOThaveexamplesdemonstratinghowthedatashouldbegroupedWhydoweneedMarketsegmentation:Assistmarketerstoidentifydistinctsub-groupsofcustomersinorderWhydoweneedMarketsegmentation:Assistmarketerstoidentifydistinctsub-groupsofcustomersinordertodeveloptargetedmarketingprogramsGuiltbyassoito”:IdentifyinggroupsofgenesthatbehavesimilarlyunderasetofdifferentexperimentalClusterClusterClusterClustering Clustering K-means K-means K-meansThek-meansalgorithmK-meansThek-meansalgorithmpartitionsthedataintokexclusiveFeatureFeatureK-meansThek-meansalgorithmpartitionsK-meansThek-meansalgorithmpartitionsthedataintokexclusiveK=FeatureFeatureK-meansThek-meansalgorithmpartitionsK-meansThek-meansalgorithmpartitionsthedataintokmutuallyexclusiveK=FeatureFeatureHowdoesitK-meansFormalminimizetotalintra-clusterKd(xjK-meansFormalminimizetotalintra-clusterKd(xj,iSiistheithcluster(i=1,2,...,i1xjµiistheithcentroidofallthepointsinclusterdisadistanceOptimalSuboptimalK-meansIfweknewK-meansIfweknewtheclusterassignmentofeachwecouldeasilycomputethecentroidsIfweknewthecentroidpositionswecouldassigneachpointtoaButwedon’tknowneitherofK-meansAlgorithmChooseK-meansAlgorithmChoosethenumberofclusters,RandomlychooseinitialpositionsofKAssigneachofthepointstothe“nat(dependsondistanceK=K-meansAlgorithmK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKAssigneachofthepointstothe“astn”(dependsondistanceK=K-meansAlgorithmChooseK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKAssigneachofthepointstothe“artend”ondistancemeasure)CalculatetheintraclusterRe-computecentroidIfsolutionconverges→K=K-meansAlgorithmChooseK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKAssigneachofthepointstothe“restetrod”ondistancemeasure)CalculatetheintraclusterRe-computecentroidIfsolutionconverges→K=K-meansAlgorithmChoosethenumberK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKcentroidsAssigneachofthepointstothe“restetrod”ondistancemeasure)CalculatetheintraclusterRe-computecentroidpositionsIfsolutionconverges→Stop!K=▪▪▪▪▪▪K-meansAlgorithmChooseK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKAssigneachofthepointstothe“restetrod”ondistancemeasure)CalculatetheintraclusterRe-computecentroidIfsolutionconverges→K=K-meansAlgorithmChooseK-meansAlgorithmChoosethenumberofclusters-RandomlychooseinitialpositionsofKAssigneachofthepointstothe“artend”ondistancemeasure)CalculatetheintraclusterRe-computecentroidIfsolution(theintraclustervarianceddnchange)→K=K-means:otherthingsweneedtoHowshouldK-means:otherthingsweneedtoHowshouldwechooseWhattypeofdistancemeasurescanweuse,andhowtochoosebetweenthem?((x2–x1)2+–y1)2)Sumofabsolute|x2–x1|+|y2–1–tAndK-means:otherthingsweneedK-means:otherthingsweneedtoDoesthealgorithmconvergencetoanoptimalCanyouthinkofstrategiesforsolvingBeforewelearnhowtoBeforewelearnhowtodoK-meansinMatlablet’slookatsomerealdata…Inthe1920's,botanistscollectedmeasurementsonsepalsepalpetalpetalof150iris,50fromeachofthreespecies(setosa,versicolor,ThemeasurementsbecameknownasFisher'sirisFisher’sIrisload4Fisher’sIrisload4SampleSampleSampleSample>>1>>'versicolor''virginica','virginica','setosa','setosa','setosa','setosa',FeatureFeatureFeatureFeatureExploringcorrelationsintheExploringcorrelationsintheFisher’sIrisparam_names={'sepallength','sepalwidth','petallength','petaltext([.05.30.55.80],[-0.1,-0.1,-0.1,-0.1],param_names,text([-0.12,-0.12,-0.12,-0.12],[0.800.550.300.05],'FontSize',12,ThepetallengthandwidtharehighlyVisualizingFisher’sIris%76543218276545SepalSepalVisualizingFisher’sIris%76543218276545SepalSepalPetal4K-meansusingDoingK-meansinMatlabis=K-meansusingDoingK-meansinMatlabis=BydefaultkmeansusessquaredEuclidiandistanceTheKTheclusterbelongstoK-meansusingDisplayingthealgorithm=K-meansusingDisplayingthealgorithm=210sumof123441112=K-meansusingClusteringptsymbK-meansusingClusteringptsymb=%Plotclusterpointsfori=1:2clust=(cidx2==i);holdNoticethatclusteringisdonebutvisualization%Plotclustercentroidholdxlabel('SepalLength');ylabel('SepalWidth');zlabel('Petalgridtitle('IrisdataclusteredwithK-meanswhereK=K-meansusingClusteringCluster765Cluster43218276544SepalSepalPetal K-meansusingClusteringCluster765Cluster43218276544SepalSepalPetal K-meansusingClustering765becausetheupperclusterisspreadout,thesethreepointsareclosertothecentroidofthelowerclusteruppercluster43218276544SepalSepalPetal K-meansusingClustering765becausetheupperclusterisspreadout,thesethreepointsareclosertothecentroidofthelowerclusteruppercluster43218276544SepalSepalPetal K-meansusingIncreasingthenumberofK-meansusingIncreasingthenumberof=11112430sumdistances=123455K-meansusingClusteringK-meansusingClusteringfori=clust=(cidx3==i);holdonholdxlabel('SepalLength');ylabel('SepalWidth');zlabel('PetalgridK-meansusingK-meansusingK-meansusingAvoidinglocalminimausingareplicates=4K-meansusingAvoidinglocalminimausingareplicates=458=====K-meansusing76543218276544SepalSepalPetal K-meansusing76543218276544SepalSepalPetal K-meansusing=7Wecanusethecosfunctionasadistancemeasurebetween6543218276544SepalSepalPetal K-meansusing=7Wecanusethecosfunctionasadistancemeasurebetween6543218276544SepalSepalPetal K-meansusingWhichdistancemeasureisK-meansusingWhichdistancemeasureismoreeWeknowthelabelofeachsample.Wecancompareclustersdiscoveredbykmeanstotheactualflowertypes.Note:usuallyinunsupervisedlearningwedoNOTknowthelabelsoftheK-meansusing%TestingtheclusteringaccuracyK-meansusing%Testingtheclusteringaccuracyfori=clust=find(cidx_cos==i);holdonxlabel('Sepalylabel('SepalWidth');gridonmiss=find(cidx_cos===holdK-meansusingCosinebaseddistance:576543218276544SepalPetal K-meansusingCosinebaseddistance:576543218276544SepalPetal K-meansusingEuclideanbaseddistance:1476543218276544SepalSepalPetal K-meansusingEuclideanbaseddistance:1476543218276544SepalSepalPetal HowtochooseWeneedaquantitativemethodtoHowtochooseWeneedaquantitativemethodtoassessthequalityofaThesilhouettevalueofapointisameasureofhowsimilarapointispointsinitsownclustercomparedtopointsinother-Formaldefinition:s(i)max(a(i),istheaveragedistanceofthepointitotheotherpointsinitsownclusterd(i,C)istheaveragedistanceofthepointitotheotherpointsintheclusteristheminimald(i,C)overallclustersotherthanHowtochooseSilhouettevaluesrangesfromHowtochooseSilhouettevaluesrangesfrom-1to→~=objectiswell→~objectisontheborderbetween2→~=-ObjectisclassifiedThesilhouettecoefficientistheaveragesilhouettevalueoverItisaquantitativemeasurethatcanassessthequalityofHowtochooseToHowtochooseTodemonstratetheutilityofthesilhouettecoefficientwecantestitonsyntheticdataforwhichweknowthenumberofx1=randn(1,100);y1=randn(1,scatter(x1,y1,25,[100],holdx2=randn(1,100)+3;y2=randn(1,scatter(x2,y2,25,[010],+x3=randn(1,100)+8;y3=randn(1,100);scatter(x3,y3,25,[001],'filled');holdHowtochooseTodemonstratetheutilityofthesilhouettecoefficientwecantestitonsyntheticdataforwhichweknowthenumberofWeknowthatKis65432100HowtochooseTodemonstratetheutilityofthesilhouettecoefficientwecantestitonsyntheticdataforwhichweknowthenumberofWeknowthatKis654321002468HowtochooseWerunthek-meansalgorithmfordifferentx=[x1,x2,y=[y1,data=[x',K====K=K=6665554443332221110000505 05HowtochooseWerunthek-meansalgorithmfordifferentx=[x1,x2,y=[y1,data=[x',K====K=K=6665554443332221110000505 05Howtochoose>>[silh2,h]=>>1arepoorly201Howtochoose>>[silh2,h]=>>1arepoorly201Howtochoose>>[silh3,h]>>12301SilhouetteHowtochoose>>[silh3,h]>>12301SilhouetteHowtochoose>>[silh4,h]>>12340SilhouetteHowtochoose>>[silh4,h]>>12340Silhouette1HowtochooseOptimalSilhouettevalueisachievedwhenK=32345K6HowtochooseOptimalSilhouettevalueisachievedwhenK=32345K678MeansilhouetteK-means investigateK-means investigategroupinginyourdata,simultaneouslyoveravarietyofscalesAlgorithm1)DeterminethedistancebetweenAlgorithm1)DeterminethedistancebetweeneachpairofdifferentTypesofdistances(Euclidean,correlation,1234512345Algorithm1)DeterminethedistancebetweeneachpairAlgorithm1)Determinethedistancebetweeneachpairof2)IterativelygrouppointsintoabinaryhierarchicaltreeConnecttheclosestpairofpointsandre-computedistance9876Thedistanceatwhichthepairofpointswere34521Algorithm1)DeterminethedistancebetweeneachpairofAlgorithm1)Determinethedistancebetweeneachpairof2)Iterativelygrouppointsintoabinaryhierarchicaltree3)Cutthehierarchicaltreeinto34521Hierarchicalclustering,otherthingsweHierarchicalclustering,otherthingswetoTypesofSinglelinkageiorDistancebetweengroupsisdefinedasthebetweentheclosestpairofpointsfromeachHierarchicalclustering,otherthingsweHierarchicalclustering,otherthingswetoTypesofCompletelinkageibDistancebetweengroupsisdefinedasthedistancebetweenthemostdistantpairofpointsfromtwoHierarchicalclustering,otherHierarchicalclustering,otherthingsweneedtoconsiderTypesofAveragelinkageclustering:Thedistancebetweentwoclustersisdefinedastheaverageofdistancesbetweenallpairsofpoints(ofoppositeHierarchicalclustering,otherthingswetoHierarchicalclustering,otherthingswetoWheretocuttheCuttingatanarbitraryHierarchicalclustering,otherthingsweneedtoconsiderWheretocuttheHierarchicalclustering,otherthingsweneedtoconsiderWheretocutthe▪▪CuttingatanarbitraryCuttingatinconsistencyComparetheheightofeachlinkinthetreewiththeheightsoflinksbelowit:IfapproximatelyequalThislinkexhibitsahighlevelofconsistency.Therearenodistinctdivisionsbetweentheobjectsjoinedatthislevelofthehierarchy.▪IfheightsdifferThislinkissaidtobeinconsistentinrespecttothelinksbelowit.Thisindicatestheborderofanaturaldivisioninadataset.Forformaldefinitionsseetoolbox▪▪HierarchicalclusteringusingLoadtheIris>>HierarchicalclusteringusingLoadtheIris>>load1)Computethedistancesbetweeneach>>euc
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 建设项目可行性报告
- 畜牧业对农村社会教育发展的支持考核试卷
- 危险品仓储的运输安全管理与监控考核试卷
- DB11T 451-2017 液化石油气、压缩天然气和液化天然气供应站安全运行技术规程
- DB11∕T 1817-2021 灌注式半柔性路面铺装层设计与施工技术规范
- 幼儿园安全卫生宣传材料
- 广东省湛江市十校联考2024届高三第一次模拟考试语文试题(解析版)
- 员工职业发展培训总结报告
- 团队冲突课件教学课件
- 淮阴工学院《空间设计基础》2022-2023学年第一学期期末试卷
- 2023-2024学年高中主题班会燃激情之烈火拓青春之华章 课件
- 中医药文化进校园-中医药健康伴我行课件
- 市政管道开槽施工-市政排水管道的施工
- 居住建筑户型分析
- 机电一体化职业生涯
- 中国电信新疆公司竞聘考试试题
- 妇科护理进修汇报
- 新团员团课培训课件
- 学校篮球教练外聘协议书
- 工作流程改进汇报
- 浙教版六年级劳动项目三-任务二《创意班规巧设计》课件
评论
0/150
提交评论