登录
首页 » Others » 遗传算法优化支持向量机算法

遗传算法优化支持向量机算法

于 2020-11-28 发布
0 231
下载积分: 1 下载次数: 4

代码说明:

遗传算法优化支持向量机算法,从而更好的提高识别率和预测率

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 用matlab实现自适应图像阈值分割(最大类间方差法
    用matlab实现自适应图像阈值分割(最大类间方差法)%本程序是利用最大类间方差算法求解自适应阈值,对图像进行分割
    2020-12-01下载
    积分:1
  • 源码:C#操作CSV,C#读取CSV
    运行环境:vs2010Csv文件的读写,操作Csv文件,将dataGridView导出到CSV,加载CSV数据到DataGridView,包含对逗号的处理,内容中包含逗号也可以
    2020-12-06下载
    积分:1
  • matlab garch模型波动率估计
    本文档介绍了如何对收益率进行时间序列分析,并用garch模型对波动率进行预测
    2020-12-06下载
    积分:1
  • 平面变压器3D仿真资料
    采用COMSOL软件,对平面变压器的仿真过程进行叙述,让大家了解平面变压器的仿真流程,是个很好的指导教材Solved with COMSOL Multiphysics 5.0Results and discussionThe magnetostatic analysis yields an inductance of 0. 1l mH and a dc resistance of0. 29 mQ2. Figure 2 shows the magnetic flux density norm and the electric potentialdistributionvolume: Coil potentiaL()Volume: Magnetic flux density norm (t▲0.07▲2.88×10-42.51.50.03050.01V656×107v0igure 2: Magnetic flux density norm and electric potential distribution for themagnetostatic analysisIn the static (DC) limit, the potential drop along the winding is purely resistive andcould in principle be computed separately and before the magnetic flux density iscomputed. When increasing the frequency, inductive effects start to limit the currentand skin effect makes it increasingly difficult to resolve the current distribution in thewinding. At sufficiently high frequency, the current is mainly flowing in a thin layernear the conductor surface. When increasing the frequency further. capacitive effectscome into play and current is flowing across the winding as displacement currentdensity. When going through the resonance frequency, the device goes from behavingas an inductor to become predominantly capacitive. At the self resonance, the resistivelosses peak due to the large internal currents Figure 4 shows the surface current3 MODELING OF A 3D INDUCTORSolved with COMSOL Multiphysics 5.0distribution atl MHz. Typical for high frequency the currents are displaced towardsthe edges of the conductor.freq(1)=1.0000E6_Surfaee: Surface-current density norm (A/)▲18618Q16010¥1.02Figure 3: Surface current density at I MHz (below the resonance frequency)Figure 4 shows how the resistive part of the coil impedance peaks at the resonancefrequency near 6MHz whereas Figure 5 shows how the reactive part of the coiimpedance changes sign and goes from inductive to capacitive when passing throughthe resonance4 MODELING OFA3DINDUCTORSolved with COMSOL Multiphysics 5.0Global: Lumped port impedance(Q2)d port impedance7.5G6.583275655545352510.10.20.30.40.509igure 4: Real part of the electric potential distribution5 MODELING OF A INDUCTORSolved with COMSOL Multiphysics 5.0Global: Lumped port impedance(Q2)35000Lumped port impedance200001000050000500010000-1500020000250000.10.20.30.40.50.60.70.809Figure 5: The reactive part of the coil impedance changes sign hen passing through theresonance frequency, going from inductive to capacitiveModel library path: ACDC_Module/Inductive_ Devices_and_coils/inductor 3dFrom the file menu. choose newNEWI In the new window click model wizardMODEL WIZARDI In the model wizard window click 3D2 In the Select physics tree, select AC/DC> Magnetic Fields(mf)3 Click Add4 Click StudyMODELING OF A3D NDUCTORSolved with COMSOL Multiphysics 5.05 In the Select study tree, select Preset Studies>StationaryGEOMETRYThe main geometry is imported from file. Air domains are typically not part of a CaDgeometry so they usually have to be added later. For convenience three additionaldomains have been defined in the CAd file. These are used to define a narrow feed gapwhere an excitation can be appliedport l(impl)I On the model toolbar, click Import2 In the Settings window for Import, locate the Import section3 Click Browse4 Browse to the models model library folder and double-click the filenductor 3d. mphbinSphere /(sphl)I On the Geometry toolbar, click Sphere2 In the Settings window for Sphere, locate the Size section3 In the Radius text field, type 0.2ick to expand the Layers section. In the table, enter the following settingsLayer nameThickness(m)ayer0.055 Click the Build All Objects buttonForm Union(fin)i On the Geometry toolbar, click Build AllClick the Zoom Extents button on the Graphics toolbar7 MODELING OF A 3D INDUCTORSolved with COMSOL Multiphysics 5.03 Click the Wireframe Rendering button on the Graphics toolbarThe geometry should now look as in the figure below0.1-0.10.20.0.0.1y0.0.2Next, define selections to be used when setting up materials and physics Start bdefining the domain group for the inductor winding and continue by adding otheruseful selectionsDEFINITIONSExplicitI On the Definitions toolbar, click Explicit2 In the Settings window for Explicit, in the Label text field, type Winding3 Select Domains 7,8 and 14 onlyI On the Definitions toolbar, click Explicit2 In the Settings window for Explicit, in the Label text field, type Gap3 Select domain 9 onlI On the Definitions toolbar, click Explicit8 MODELING OF A3DINDUCTORSolved with COMSOL Multiphysics 5.02 In the Settings window for Explicit, in the Label text field, type core3 Select Domain 6 onlyExplicit 4I On the Definitions toolbar, click Explicit2 In the Settings window for Explicit, in the Label text field, type InfiniteElements3 Select Domains 1-4 and 10-13 onlyExplicit 5I On the Definitions toolbar, click Explicit2 In the Settings window for Explicit, in the Label text field, type Non-conducting3 Select Domains 1-6 and 9-13 onlyI On the Definitions toolbar, click Explicit2 In the Settings window for Explicit, in the Label text field, type Non-conductingwithout Ie3 Select Domains 5, 6, and 9 only.Infinite Element Domain /(iel)Use infinite elements to emulate an infinite open space surrounding the inductorI On the definitions toolbar click Infinite element domain2 In the Settings window for Infinite Element Domain, locate the Domain Selectionsection3 From the Selection list. choose Infinite Elements4 Locate the Geometry section From the Type list, choose SphericalNext define the material settingsADD MATERIALI On the Model toolbar, click Add Material to open the add Material window2 Go to the Add material window3 In the tree, select AC/DC>Copper.4 Click Add to Component in the window toolbar9 MODELING OF A 3D INDUCTORSolved with COMSOL Multiphysics 5.0MATERIALSCopper(mat/)I In the Model Builder window, under Component I(comp l)>Materials click Copper(matD)2 In the Settings window for Material, locate the Geometric Entity Selection section3 From the Selection list, choose windingADD MATERIALI Go to the Add Material window2 In the tree. select built-In>Air3 Click Add to Component in the window toolbarMATERIALSAir(mat2I In the Model Builder window, under Component I(comp l)>Materials click Air(mat2)2 In the Settings window for Material, locate the Geometric Entity Selection section3 From the Selection list, choose Non-conductingThe core material is not part of the material library so it is entered as a user-definedmateriaMaterial 3(mat3)I In the Model Builder window, right-click Materials and choose Blank Material2 In the Settings window for Material, in the Label text field, type Core3 Locate the geometric Entity Selection section4 From the selection list choose Core5 Locate the Material Contents section. In the table, enter the following settingsPropertName Value Unit Property groupElectrical conductivity sigma0S/IBasicRelative permittivity epsilonrBasicRelative permeability mur1e3Basic6 On the model toolbar. click Add Material to close the Add Material windowMAGNETIC FIELDS (MF)Select Domains 1-8 and 10-14 only0MODELING OF A 3D INDUCTOR
    2020-12-10下载
    积分:1
  • ICP点云配准算法
    ICP点云配准算法,基于Python实现ICP点云配准算法,基于Python实现
    2020-11-28下载
    积分:1
  • Proteus单片机仿真 万年历支持温度农历24节气显示+源
    万年历支持温度农历24节气显示,内含源程序及Proteus仿真文件。
    2020-12-11下载
    积分:1
  • 基于celp算法的语音
    该算法是基于matlab软件平台上实现的,实现语音编码
    2020-12-04下载
    积分:1
  • 风控建模等奖
    使用拍拍贷数据,建模全过程,从数据预处理开始到最后的模型比较。仅用于交流学习。队伍介绍队名“不得仰视本王”,队伍由五个小伙伴组成,我们是在一个类以的比赛(微额借款用户人品预测大赛)认识的,对数据挖掘竹热爱让我们走到了一起,以下是成员简介:姓名学校、学历比赛经历匚陈靖」中国科学技术大学研二天泡科学家总分第三,微额借贷用户人品预测大赛季军朱治亮浙江大学研二淘宝穿衣搭配比赛李军,微额借贷用户人品预测大赛李军质耀重庆邮电大学研二微额借贷用户人品预测大赛冠军匚赵蕊」重庆邮电大学研微额借贷用户人品预测大赛亚军黄伟鹏北京大学研一微额借贷用户人品预测大赛冠军解决方案概述2.1项目介绍与问题分析拍拍贷“魔镜风控系统”从平均400个数据维度评估厍户当前的信用状态,给每个告款人打出当前状态的信用分,在此基础上再结合新发标的信息,打出对于每个标约6个月内逾期率的预沨,为没资人提供关键的决策依据。本次竞赛目标是根据用户历史行为数据来颈测用户在六来6个月内是否会逾期还款的概率。问题转换成2分类问题,评估指标为AUC,从 Master, LogInfo, Update Info表中构建恃征,考虑评估指标为AUC,其本质是排序优化问题,所以我们在模型顶层融合也使用基于排序优化的 RANK AVG融合方法。2.2项目总体思路本文首先从数据清洗开始,介绍我们对缺失值的多维度处、对离群点的剔除方法以及对字符、空格等的处理;其次进行特征工程,包括对地理位置信息的特征构建、成交玉间特征、类别特征编码、组合特征构建、 Lpdatelnfo和 Log Info表的特征提取等;再次进行特征选择,我们采用了 boost, boost的训练过栏即对特征重要性的排序过程;然后处理类别的不平衡度,由于赛题数据出现了类不平衡的情况,我们采用了代价敏感学习和过采样两和方法,重点介绍我们所使用的过采样方法;最后一部分是模型设计与分析,我们采用了二业界广泛应用的逻辑回归模型、数据挖掘比赛大杀器 ghost.,创新性地揆索了large- scale sⅧm的方法在本赛题二的应用,玟得了不错的效果,此外还介绍了模型融合方、数据清洗3.1缺失值的多维度处理在征信领域,用户信总的完善程度可能会影响该层户的信用评级。一个信息完苦程度为100%的户比起完善程度为50%的用户,会更加容易官核通过并得到借款。从这一点亡发,我们对缺失值进行了多维度的分析和处理按列(属性)统计缺失值个数,进一步得到各列的缺失比率,下图(图1)显示了含有缺失值的属性和相应的缺失比率sing rate of Attributes图1.属性缺失比枣WeblogInfo_1和 WeblogInfo3的缺失值比率为97%,这两列属性基本不携带有用的信息,直接剔除。 Uscr Info_11、 Userinfo_12和 Uscr info_13的缺失值比率为63%,这三列属性是类别型的,可以将缺失值用-1垣充,相当于“是否缺失”当成另一种类别。其他缺失值比卒较小的数值型属性用中值填充按行统计每个样本的属性缺矢值个数,将缺失值个数从小到大排序,以序号为横坐标,缺失值个数为纵坐标,画出如下散点图(图2)test set16016014014C12012Cw9mczE100400060008000Order Numbe(sort ircreasinglyOrde Nt mber(sort increasing ly)图2.样本属性缺失个数对比 trainset和 testset上的样本的属性缺失值个数,可以发现其分有基本一致,但是trainset上出了几个缺失值个数特别多的样本(红框区域内),这几个样本可以认为是离群点,将其剔除另外,缺矢值个数可以作为一个特征,衡量用户信息的完善程度。3.2剔除常变量原始数据宁有190维数值型特征,通过计算每个数值型特征的标准差,剔除部分变亿很小的特征,下表(表1)列出的15个特征是标准差接近于0的,我们剔了这15维特征表1.剔除数值特征标准差属性标准差属性标准差属忾标准差Webloglnfo_10 0.0707 WeblogInfo_41 0.0212 Webloglnfo_490.0071Webloglnfo_23.0939 WeblogInfo_43 0.0372 Webloglnfo_5200512Webloglnfo_31.0828 Webloglnfo_44.0166 Webloglnfo_5400946Webloglnfo_32 0.0834 Webloglnfo_46.0290 WeblogInfo_5500331Webloglnfo_40.0666 Webloglnfo_47 0.0401 WeblogInfo_58006093.3高群点剔除在样本空间中与其他样本点的一般行为或特征不一致的点称为离群点,考虑到离群点的异常特征可能是多维度的组合,我们通过分析样本属性的缺矢值个数,剔除了极少量的离群点(见3.1节)此外,我们还采用了另外一种简单有效的方法:在原始数捶上训练ⅹ gboost,用得到的xgb模型输出特征的重要性,取最重要的前20个特征(如图3所示),统计每个栏本在这20个特征上的缺失值个数,将缺矢值个数大于10的样本作为离群点。ThrciParty Ifn PeriodIntrAparty nto HerodThrcPorty hfo Penod3ardiParty hfo Period?ThirdParty Info Penod图3.Xgb特征重要性通过这个方法,易除了400多个样水。这些样在重要特征上的取值是缺失的,会使得模型学习变得因难,从这个角度妖说,它们可以看成是离群点,应剔除掉。3.4其他处理(1)字符大小写转换Userupdate Info表宁的 Userupdate Info1字段,属性取值为英文字符,包含了大小写,如Q"和”qQ",很玥显是同一和取值,我们将所有字符统一转换为小写(2)空格符处理Mastor表中 UserInfo9字段的取值包含了空格字符,如“中国移动”和“中国移动”它们是同一种取值,需要将空格符去除。(3)城市名处理Userinfo_8包含有“重庆”、“重庆市”等取僬,它们实际上是同一个城市,需要把字符中的“市”全部去掉。去掉“市”之后,城市数由600多下降到400多。四、特征工程4.1地理位置的处理对地理位置信(类别型变量)最简单的处理方式是独热编码(one- hot encoding),但是这样会得到很高维的稀疏特征,影响糢型的学习,我们在独热编码旳基础上,做了特征选择。下面介绍具体的方法。赛题数据提供了用户的地挛位置信息,包括7个字段: Userinfo2、 Userinfo4、UserInfo7、 UserInfo8、 UserInfo I9、 UserInfo20,其中 UserInfo_7和 UserInfo19是省份信息,其余为城市信息。我们统计了每个省份和城市的违约率,下图以 Userinfo_7为例图1.省分违约率可视化图5可视化了每个省份的违约率,颜色越深代表违约率越大,其中违约率最大的几个省份或直辖市为四川、湖南、湖北、吉林、天津、山东,如下图所示:图5.违约深突出省份可视化因此我们可以构建6个二值特征:“是否为四川省”、“是否为湖南省”...“是否为山东省”,其取值为或1。其实这相当于对地理位置信息做了独热编码,然后保留其中有判别性的菜些列。这里 UserInfo_7何含32和取值,编码后可以得到32维的稀疏特征,而我们只保留其宇的6维以上我们是通过人工的分析方法去构延二值特征,在处理省份信息时还是匕较直观的,但是处理城市信息,比如 Userinfo2,包含了33个减市,就没有那么直观了。为了得到有判别性的二值特征,我们首先对 Userinfo2进行独热编码,得到333维的二值特征,然后在这333维稀疏特征上训练ⅹgb模型,再根据xgb输出的特征重要性刷选二值痔征,以下是选取到的部分二值特征(对应的城市):“淮纺市”、“九江市”、“三门峡市”、“汕头市”、“长春市”、“铁岭市”、“济菊市”、“成都市”、“淄博市”、“牡丹江市”。按城市等级合并类别型特征取值个数太多时,独热编码后得到太高维的稀疏特征,除了采用上面提到的特征选择方法外,我们还使用了合并变量的方法。按照城市等级,将类别变量合并,例如线城市北京、上海、广州、深圳合并,赋值为1,同样地,二线城市合并为2,三线城市合并为3>经纬度特征的引入以上对地理位置信息的处理,都是基于类别型的,我们另外收集了各个城市的经纬度,将城市名用经纬度替换,这样就可以将类别型的变量转化为数值型的变量,比如北京市,用经纬度(39.92,116.46)替换,得到北纬和东经两个数值型特征。加入经纬度后,线下的cross validation有千分位的提升。城市特征向量化我们将城可特征里的城市计数,并取Log,然后等值离散化到610个区间内。以下图为例,将 serino2这个特征里面的325个城市离散为一个6维向量。向量“100000”表示该城位于第一个区间。线下的 cross validation有千分位的提升。Loglui2 num)6.城市特征离散化地理位置差异特征如图8所示,1,2,1,6列郗是城市。那么我们构建一个城市差异的特征,比妇diff_12表示1,2列的城市是否相同。如此构建 diff l2,diff_14,diff_l6,diff_24,diff26,diff46这6个城市差异的特征。线下的 cross validation有千分位的提升。⊥aJse⊥nfa2 userinfo4 Userinfo7 Userinfo8 Userinfo19uer⊥nf。201C013郴州1C020惠州1C033零1c035深圳东东东东建东福建省10038济104连云港远言港带1C042德州1c043青岛聊拔东自聊城市46深圳汕广东广东省汕尾市105所多工新乡图7.地理位置差异样例4.2成交时间特征按日统计训练集中每天借贷的成交量,正负样本分别统计,得到如下的曲线图8,横坐标是日期(20131101至20141109),纵坐标是每天的借贷量。蓝色由线是违约的样本每天的数量(为了对比明显,将数量乘上了2),绿色曲线对应不违约的样本train set1200count o10008004002广外从20030350Date20131101~20141109图8.每日借贷量统计可以发现拍拍贷的业务量总体是在埤长的,而违约数量一开始也是缓慢增长,后面基本保持不变,总体上违约率是平稳甚至下降的。在横坐标300~350对应的日期区间,出现了些借贷量非鸴大的时间苄点,这些可能隐减着苿些信息,我们尚未挖掘出来。考虑到违约率跟时间线有关,我们将戒交时间的字段 Listinginfc傲了几种处理,一和是直接将其当做连续值特征,也就是上图对应的横坐标,另一和是离散化夂理,每10天作为一个区间,乜就是将日期0`10离散化为1,日期1120离散化为2.4.3类别特征的处理除了上面提到的对菜些类别特征进行特殊处理外,其他类别特征都做独热编码。44组合特征Xgboost的训练完成后可以输出特征的重要性,我们发现第三方数据特征ThirdParty Info Period XX”的 feature score比较大(见图3),即判别性比较高,于是用这部分特征构建了ξ合特征:将特征两两相除得到7000个特征,然后使用 boost对这7000多个特征单独训练模型,训练完成后得到特征重要性的排序,取其中top500个特征线下cv能达到0.73+的AUC值。将这500个特征添加到原始特征体系中,线下cv的AC值从0.777捉高到0.7833。另外,也组合了乘法特征(取对数):10g(x*y),刷选出其中的270多维,加入到原始特征休系中,单模型cv又提高到、0.785左右。4.5 Upadte Info表特征根据提供的修改信息表,我们从中抽取了用户的修改信息特征,比如:修改信息次数,修改信息时间到成交时间的跨度,每和信息的修改次数等等特征。46 LogInfo表特征类似地,我们从登录信息表里提取了用户的登录信息特征,比如登录天数,平均登录间隔以及每种操作代码的次数等47排序特征对原始特征中190维数值型特征接数值从小到大进行排序,得到190维排序特征。排序特征对异常数据有更强的鲁棒性,使得模型更加稳定,降低过拟合的风险。五、特征选择在特征工程部分,我们构建了一系列位置信息相关的特征、组合特征、成交时间特征、排序特征、类别稀疏侍征、 updateinfo和1 oginfo相关的特征等,所有特征加起来将近1500维,这么多维特征一方面可能会导致维数灾难,另一方面很容易导致过拟合,需要做降维处理,降维方法赏用的有如PCA,tSNE等,这类方法的计算复杂度比较高。并且根据以往经验,在数据挖掘类的匕赛中,PCA或t-SNE效果仨往不好。除了釆用降维算法之外,也可以通过特征选择来降低特征维度。特征选择的方法很多:最大信息系数(MIC)、皮尔森相关系数(衡量变量间的线性相关性)、正则化方法(L1,L2)、基于模型的特征排序方法。比较高效的是最后一种,即基于学习模型的特征排序方法,这种方法有一个好处:模型学习的过程和特征选择的过程是同时进行的,医此我们采用这和方法,基于 boost来做特征选择, xgboost模型洲练完成后可以输岀特征的重要性(见3.3图),据此我们可以保留TopN个特征,从而达到特在选择的目的。
    2020-06-23下载
    积分:1
  • 雷达信号检测matlab
    雷达信号检测matlab程序,函数齐全,并且带有实际效果图。可以进行充分比对。
    2020-12-06下载
    积分:1
  • 基于matlab的遗传算法源代码
    遗传算法源代码,包含(二进制,浮点染色体,轮盘赌波,锦标赛选择,单点,多点变异)
    2020-12-08下载
    积分:1
  • 696516资源总数
  • 106562会员总数
  • 4今日下载