From b8b3769a2fbca58032ecebd5e33daf7f419ada3c Mon Sep 17 00:00:00 2001 From: ilysko Date: Thu, 7 Sep 2017 15:57:30 +0300 Subject: [PATCH 01/29] Same lecture02 example for Netbeans --- build.xml | 73 + build/classes/.netbeans_automatic_build | 0 build/classes/.netbeans_update_resources | 0 .../lectures/lecture02/BoxingExample.class | Bin 0 -> 1298 bytes .../lecture02/BreakAndContinueExample.class | Bin 0 -> 1211 bytes .../lecture02/CalculatorExample.class | Bin 0 -> 1100 bytes .../lectures/lecture02/CommentsExample.class | Bin 0 -> 623 bytes .../ConstructorExample$Rectangular.class | Bin 0 -> 603 bytes .../lecture02/ConstructorExample.class | Bin 0 -> 562 bytes .../lecture02/ForAndForEachExample.class | Bin 0 -> 1055 bytes .../IfElseAndSwitchCaseExample.class | Bin 0 -> 883 bytes .../caf82/lectures/lecture02/LinkTypes.class | Bin 0 -> 1578 bytes .../lectures/lecture02/OperatorsExample.class | Bin 0 -> 3404 bytes .../lectures/lecture02/PrimitiveTypes.class | Bin 0 -> 1166 bytes .../lectures/lecture02/StringProcessing.class | Bin 0 -> 1627 bytes .../lecture02/WhileAndDoWhileExample.class | Bin 0 -> 941 bytes manifest.mf | 3 + nbproject/build-impl.xml | 1420 +++++++++++++++++ nbproject/genfiles.properties | 8 + nbproject/private/private.properties | 2 + nbproject/private/private.xml | 4 + nbproject/project.properties | 74 + nbproject/project.xml | 15 + .../lectures/lecture02/BoxingExample.java | 26 + .../lecture02/BreakAndContinueExample.java | 44 + .../lectures/lecture02/CalculatorExample.java | 35 + .../lectures/lecture02/CommentsExample.java | 18 + .../lecture02/ConstructorExample.java | 15 + .../lecture02/ForAndForEachExample.java | 17 + .../lecture02/IfElseAndSwitchCaseExample.java | 32 + .../caf82/lectures/lecture02/LinkTypes.java | 32 + .../lectures/lecture02/OperatorsExample.java | 58 + .../lectures/lecture02/PrimitiveTypes.java | 43 + .../lectures/lecture02/StringProcessing.java | 39 + .../lecture02/WhileAndDoWhileExample.java | 20 + 35 files changed, 1978 insertions(+) create mode 100644 build.xml create mode 100644 build/classes/.netbeans_automatic_build create mode 100644 build/classes/.netbeans_update_resources create mode 100644 build/classes/ru/caf82/lectures/lecture02/BoxingExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/BreakAndContinueExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/CommentsExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/ConstructorExample$Rectangular.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/ForAndForEachExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/LinkTypes.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/OperatorsExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/PrimitiveTypes.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/StringProcessing.class create mode 100644 build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class create mode 100644 manifest.mf create mode 100644 nbproject/build-impl.xml create mode 100644 nbproject/genfiles.properties create mode 100644 nbproject/private/private.properties create mode 100644 nbproject/private/private.xml create mode 100644 nbproject/project.properties create mode 100644 nbproject/project.xml create mode 100644 src/ru/caf82/lectures/lecture02/BoxingExample.java create mode 100644 src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java create mode 100644 src/ru/caf82/lectures/lecture02/CalculatorExample.java create mode 100644 src/ru/caf82/lectures/lecture02/CommentsExample.java create mode 100644 src/ru/caf82/lectures/lecture02/ConstructorExample.java create mode 100644 src/ru/caf82/lectures/lecture02/ForAndForEachExample.java create mode 100644 src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java create mode 100644 src/ru/caf82/lectures/lecture02/LinkTypes.java create mode 100644 src/ru/caf82/lectures/lecture02/OperatorsExample.java create mode 100644 src/ru/caf82/lectures/lecture02/PrimitiveTypes.java create mode 100644 src/ru/caf82/lectures/lecture02/StringProcessing.java create mode 100644 src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..7fb9177 --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project TextClassifierProject. + + + diff --git a/build/classes/.netbeans_automatic_build b/build/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/build/classes/.netbeans_update_resources b/build/classes/.netbeans_update_resources new file mode 100644 index 0000000..e69de29 diff --git a/build/classes/ru/caf82/lectures/lecture02/BoxingExample.class b/build/classes/ru/caf82/lectures/lecture02/BoxingExample.class new file mode 100644 index 0000000000000000000000000000000000000000..dd79ebc6b44eb593d18efcf99216083575969db5 GIT binary patch literal 1298 zcma)6O-~b16g{sqo!6EkP@sw*Ao$e+Ww4?W@gu>Akd#7FLI`dg>QDx!Ee=yae}h{W z#+4gbxzGg~7ybZ$i9f=KXQmZeJ`7Fs-o5AEd)_yu|z6iQ;C5)@M z7C{fLd+Ci35?+#&=$9A}(C%9$%Y7)IB$D$2>f`bYQ=lbdmCS6VxMVtW#*$4WmMP~A zd){y?FRy{ByJD>i3}l>&o;Q|9)4FZu-HKzb{|koG`gnQEDixk=8O1f*9ODs1!zu~H z6VEcM#)hHWMya6ZT!&3#{uK8tT$k(8!RlQqpj_=AB^kDb>WH_i&o|s$$rDy3R!1 z3DwJvB^M9j`!9}Og!pUqJ^}Cr(8M*$Oy@4R2m8N5eD=%DTs0q5aE5WT+JF|cG7F;( zF(Momzo9@9+i6XILm=a?)Bc+M0%ahz4XN%xRd%6z`QV{EwTs}t(ta4zb|Kr8UnIPz z*7jg+*T~YPc4>_~M1n^UvedY}ay9YfDe&Zt`%*N@loS%8pa}ZtNt)RMc1%+2EQKzx z@*M40K_}iIj<-0A_c(`bbotgyR^_v!gRB}pvM=tN^MRdldL6?%_Q!ed0%kZBhf2n$ zIL|0Z-bc8=NW(?We?n-Fe;=yEC5i6p7eb=Sc!X(4Ue{jJN+i!e*d5uUsU|M{%;pi2*Bg-X6Tb(V# z(ryq{4iTpF3eg$j)v9imXyWuj<`AQeNhmItKIF_F7aw-4`lT?mrVj^F#e|3cARvZd zRlp;>NA;uYl{|mhq^BFDH!MCM=^9hY&mE^dCs9E+T%_=r z2!4VdJVP&@qYp39k5}{$ct^gE6tjZ?kIPX6=>l@-L>F;5j=_fX05epri+mOe4IA+a q6-mN$idHY8d+@R7F1q(1vF6TQ1oseOLP>;oks_T+c2lSir+)*Ygc1Az literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class b/build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class new file mode 100644 index 0000000000000000000000000000000000000000..cba620985334d41b688a5d85e530e11a5f1b5ef1 GIT binary patch literal 1100 zcmb7D*>2N76g`v0PF#0ONJ{Bmwj`x>DWOy<>PtnXN)aFhRa88nNos;CC#f78wLj3W zK}eu35=eXiAB8w$8xo*AAZupsGCud5d+l%EKYs;K#fE_)+{z+_+iJU`3DoSr(Ak(t_deG?k0?AUD47D)O4&5EzZcC>lP%OQw9m;poa%HDw)qT(D zv^GQT(rb}T{)#kTCi|v{GZc z+w5gNMEX4}pdYDAF8h@#?UeVhz>i>vUrmA!m4z0?@zl7;7y{$8_L)zrNaYfuGIfqb zW%?Y+j|?S{aC6)j2PDriGEX>zqgmimk{3ftH-7-&{jEm; literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/CommentsExample.class b/build/classes/ru/caf82/lectures/lecture02/CommentsExample.class new file mode 100644 index 0000000000000000000000000000000000000000..6b318099591f63f3ffbcf58b4d148f3fcc8ff462 GIT binary patch literal 623 zcmb7BT`vPc6g|^cw_QcG>ic7PQG^wdkPt7zgKUsgym*?fQB%7+&F-x5vv?r!;0O3o z;_kNMBVNqIy>rjK_sl(a-riqc0c>KyL>?nW)G%7Wn2B*r7??CL#gN~Xfz*2p+4|Bs zLvCMP3Wgy^2I4sOn<6~pO^=X@qg?Kt^H3&n56tOn88NInVQjnnYJ0=>gsbCFM4y-S z4SQetz6f-5aL4_QCwAx&pUZ$@w0_~V`7O6S9<=O+4rS2VNr&KJi)gEVq#4YHibGc% z%4DjMU*u~EUkL^Z2Bu4x!7Rh9BlKcqc}m?_T3K#y97_h)5mg(QE5X7%!^%HYFqFSW zKWVl}_7A9WA8Fy!R#i-iT34r3_9=h!Cn@r1L$&%}3&K45=s%N_ z0hOabwn&jpo{{fceg=C;(;km6t{={K*=!6 zwM>75UOyNmahmBo%o2U_B<2rF9&_&?ilb~u*l!nY-klKaQF0>*wQ&^7^L##)`dUmC zXX@i56lx-LWbjYYHbM#2OBN^MyIcuP@Xq2`>X8y@D*16xP)6$y8PDThCAkjeX=Fq+ z|Bu|AiAUjK31trsnhv%IN5!`G_eX+n2m{6A1Q*j84@M}p&1$;ESh2%*wfV&4`$nFL z*c>dguP_?IVguaH-V3Pn3hSAX1($u9YrtJq_Koi%<0D FKwlXko%a9$ literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class b/build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class new file mode 100644 index 0000000000000000000000000000000000000000..29425b95b7792019b4de53c72b1e5a80abe3d3ee GIT binary patch literal 562 zcmb7BO-lnY5Pj3HwcBd7)z+)vp(=Ds@gP>b6a`^Xu+odCbd5D-o0aUY__sU>9{d6R zC~>kX7V4#e%w*o=y}TqJpKtE~4zcYbk4*<#4w?>HgvzxH5}_w)C=8)`p|v!FP{gr} z38fRIRdPzmxA#Vb!XUbngqp9kyi8|fX>PBQk4`C*( z-1w(WaEDQ90(q{ivDTt~$4XY=V1>|G&KhC;&(GC(%GV(rFQ>6P_ukk+j=#f>9LQSY zSmw&(Oq`4Rub`K#?Q$$-U>+4-SHCxKUgfHcHPjff7$dGzAO>hmoXqTf&fe?nv-aBa_4lV^01xmeiWo*aFotmx6H$aQ z8o?dqCzZLYOe%^rrj(gBkufnNU@SYXvMoJF?azXmzwa~zvNt=GIKZkcvXmiE`)$ZEY} zFY%_TbX5XVzj^eP;4 zyd9x!jN%&qTJ?m$@u7>hn>&kM(Cbr25Fc9U9$KRnG;p2k*eL+L=;N*f{fINd!-5kc z5(u>AMC1@-9})VDaPbIQuik`_Xu@nF(nQBQA>N;SXS#`~`6XHmYx$z4=Zm_LFB)b( zH@%rTUI{N~ac$%f=}cUkUC=KTi?iZ+HI3E2DY9WGvXdkQL}1b<=_lE1hO}4N=N3D4 z>3t$qGgG7-!UP5|$R@UMv$fKh32*~L^sAU>G{NjJcekMZLP-3?_z5-CO^leh#h1O~ M2d0U-O;iZUKRWg7w*UYD literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class b/build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class new file mode 100644 index 0000000000000000000000000000000000000000..ff3a1929b6a0d91cd56fc57899129ec559360c53 GIT binary patch literal 883 zcmbVKTT2^36#gc+*{q4$tcljOCiZ4j=oTp=RfJa3BE$=%NWrJcW)fHT5;nVD{!L3C z3VmxITIfT6Kz~l3OX-0$_9bfLnUR#E5MB62#)C_Fl9*WRW@d(UB z$IgIZy&1-qExPNgmMiTj4&~s=dAe%tbQ|tKzVJJ(b0@Nox5Yp3~Yy?*ouUGx-0r4Zh9+-LtDOb z6#MGGNjy>S7NBE{<52;RvB;2bT-efer5|zB3s}N31K$gxT3d8Tsh8@`ybb~~YyY=8 z!{qh8`|T5w?FQ7k97NKiw}O}w<)JuEU>%S$5$Pj^N9q~LjGHhq?W-b}WG&ZkQxyx) z=*LiB3QTQIcYz{{EF+s;{s#6rNf+tPC14KY#9Iod%>H%?Gbkv`Dx6lBlQ@&YAm$a$8t*xU1*4x=ct_!a z#6^jB1)S4<)o+{;NMaXcuRk&bAhg|=1Pso zuddFv)9YxJgd;uN0z#WIy5i_4b5*!jxK??Un_);<)=^vD6&NTrbmjJPrNaJOU3)q*uARw9jaTo5AO@?ezA;&rXQ?$Q5r=o zvWiR^OSqE8ReV70xIiMG7f?D=Z(mkm_(cMfkk|p%o|&7=u=vb8S&H~jV9XdFf4%YZ z#{G>48^1ntmax1v;w~e4fn)o@|1_j+m0c;{;ygKzcCmh#yUIy5I4@7HZ3C9>)Egd6 z$*@WISUjZdcuwEZwVGGukfyWUW1Q?Vby~_m)d=H9A~2fm1`;7_rm}!Y~iJtcnikuU|JaI z9 z|2s_b?N|!_0U%s3=*P zW%moErgpW9)mlB2D|FSedT#a9L+?HI*lMjFqko^7fk6&dv(~@&zxVgw_x|^ppZ@;# zdjNOhQw(r!{L|^@F9-FN_Q2xqo2~PWEqYlN_Un8$0Wy5j$<5C98Yi@SMj8V zhw+pcp5{2g@eIdFj%PWZ<2c3fJjV+hFLJ!Z@iNCN9ItY`rs8!5rNc^DP8Wk5Y1qx+ z>rIcC3}yXR%G@?F7B}rdBc7z4P=9*ZNbWXlORRI7K4-r*&d}0tPeg}}(e~D8(j0as zY;!!%tZt2N&zQF1r0wy|M~tyd(%eX1#tbXPP!-wRf513oM3Y7;5gl-BE0x&jMq$_q zvRmN+Gcbdwk0?$wOq3wnLNrP=LPXKBJwzFzO++@4L)1fbkZ6)Yimwqvs~FlCN(LNb z`0=eq#?4E`CKYd}m}bxh(i8Tuxy2GC2w$H`iwHh|4cMsS%>drQX@=^%ZOhp|W;zy? zOHb!>-w?nVoF(}Be0wIWy3nV>ckp) z)D$Ckx!t0gp5_xq7}4cT$>~vP^L#KIxbZx>%`rFM#*)0fmv< zJ)RZv-)iQ}e@N%0?KG2yW2I9IQlt81D2`UWvs1TS9~D}U|KgN3Yipx&p*b z&9jf@Sl^@z%608@_`&%~ZI2(IYZbsnd=$XP_=LgVoE0sa)H^zaXQ~VFU0pd|6MTMA zq4lQ|*Bu8#aeR$FHKoV1%3@VtpI=pIgQmTxl6+@6nWQU9zLWtcoiZs(|DbJ(xo8L7 zXh-jJ2$Xl4bPfGINxD-EtNu@K(4BYFw$jlZ)C~^xglUW|C`PtT7H&l(&5UM$;}x*4T)2})#ogrSB0i86z+LF3 zRT1t+5ABe$@)>;$LV*0^*N{T;417VYL+SK)h5YTlkkam_?eCxtT>%dj%|Khe;<4J1 z85GYTK(Ym334ygM_Ip94La#RI1(gw0?W^{uW)Pe+87e2!YE1FP)B*<~5)CUS73O89 z!UesMN0G~`&BFBU8~2dae@E;|n%4xaNk{d{TGxMJrJ@D>ZT zl5JnCyufgq&?rAgop$FX_(N-Hxv1bVSB9L2)(M&RIT_LSGDP2hfkqlN>g!^ZQRi2q zg#LGyVmqx4Ac#}c@2{Z()2PI0gz+`1@H0vMjvA)mCRT@K>>kvz?O4Hva5FmroxOM1cYw1YDS-!w)7Yz0D|TW40X8kQ zV34>Hc7`(8MO>-89G_q}>6THv7x5r*L5j2w4-r?6A%Go6$t>#xSFwjNCP|F``Kj2e zLY<|!3%BL$Hk+jkwRv$_E>u_u%&D+zC@WMUSA~w`8=~++=S-u{3ogjP!|}ZGDg+nB iRZs!?H{k*2)Kxq@OP?<};5WPxD;za2ESWa=_(Ucfh5s+c)_*pTP0KRSM=oH&3e8Wh|JAcLCGlKd9Sq)*ohB)8tGaTFF% zR%B3~tUD897RQNk+YH)f$Tq`m(}<&c8ZsaOSD`;KqA0hUv?HIM&0v%|g zAFu;(49#45(SqYdm@GcPg)p)GI%lpwTr&`XoXT-qBB z^#&uTO@|tTFJqwxX_YB4wTe1vy|!%(RuTSt(go{`UO4$1De&_RpcWw#r1G3~I7{L> zNnM(x4e``j#@{0sGh}0d5f5N+N~~65tM8( z<0P#UyUdG|O9k(ld4^Zx$6Mx~gM%}?K`SvAMzPFV3EoMT9oy(BoM47E&%nc;?YMvr l-peMsagm;%GqiH%B)e^~eiyM2=V`(vdMf*MvwICL{{qns;(!1E literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/StringProcessing.class b/build/classes/ru/caf82/lectures/lecture02/StringProcessing.class new file mode 100644 index 0000000000000000000000000000000000000000..7585d1c9381e5b61ea0075dcc22d25afd47747aa GIT binary patch literal 1627 zcmb7E-E$LF6#w0P?Ka)okhYW-l=z*}w1J3-Ev=9$5(%MNELQy5q_@pNnq+o2FnyFa zWn_jKp2YFR8DI3Fb%w1&wY>9m_aAaRCmW!Wj-$!UIp?19JKraH^w)zO0LLNYIE0*r zH*_42BZN15Z~|{>I2lI_IUR2^pJK~2OQ)F3#4(F^bev}O876rhbIfOSysP6q7SA$y zpUF8L1?C?xIj^Cp;etTylvTIfS%GkRY*8RG*I1SU{Y9%TORcrCv@e;`Ov?Y-zo|A@IhA79pHk`pm!>x8*^?r}hI;7V;ySx9RRKp8RAqTV9v8Lzh3gN3$ImUc^EAlj2VZf`1D{57R44 zTo8{Q*@D_p9=w8ANkh(}gfJliZyTYdWOxga;%|sTwv>eVjGVn8Xgk6Ao~JHl33uL9Jr7iENLeqoGmf9g`uhF zNHpVN|4_uk@B|5$$$up3ft>or!^s04Mp#8vv^5?^cRinWn@57W&=IHaYv@HDeJG$G z68lg^64x+*ItHyD~?~0#u&}2iV}`s hoJM~Q=aC^PO!3ZP0+WbP)EQdC7@~wcN`4_6`x}mUqt5^U literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class b/build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class new file mode 100644 index 0000000000000000000000000000000000000000..d5a3e548679addaf23a8064fbae4021c199ad1d0 GIT binary patch literal 941 zcmb7CTWb?R6#gbjca!b5jY-q0+f?gyTWzQ zD5h~%>2pe)SK@+7U({jiSZ2^Rr6{ z-8v7X@<+i`xGQ@MGcZa24#QL} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..8e99bbf --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0fd20a72 +build.xml.script.CRC32=687418d1 +build.xml.stylesheet.CRC32=8064a381@1.80.1.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=0fd20a72 +nbproject/build-impl.xml.script.CRC32=fbbe4592 +nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..95dd346 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=/home/ilysko/.netbeans/8.2/build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..8de8683 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,74 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/TextClassifierProject.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..764375f --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + TextClassifierProject + + + + + + + + + diff --git a/src/ru/caf82/lectures/lecture02/BoxingExample.java b/src/ru/caf82/lectures/lecture02/BoxingExample.java new file mode 100644 index 0000000..1f64c70 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/BoxingExample.java @@ -0,0 +1,26 @@ +package ru.caf82.lectures.lecture02; + +public class BoxingExample { + + public static void main(String[] args) { + Integer i = Integer.valueOf(50); + Integer iTwo = Integer.valueOf(50); + Integer iThree = 50; + + System.out.println(i == iThree); + System.out.println(i == iTwo); + System.out.println(i.equals(iThree)); + System.out.println(i.equals(iTwo)); + + System.out.println("----------------------------------------"); + + Integer iNew = Integer.valueOf(1000); + Integer iNewTwo = Integer.valueOf(1000); + Integer iNewThree = 1000; + + System.out.println(iNew == iNewThree); + System.out.println(iNew == iNewTwo); + System.out.println(iNew.equals(iNewThree)); + System.out.println(iNew.equals(iNewTwo)); + } +} diff --git a/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java b/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java new file mode 100644 index 0000000..ad6005e --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java @@ -0,0 +1,44 @@ +package ru.caf82.lectures.lecture02; + +/** + * Created by ilysko on 24.08.17. + */ +public class BreakAndContinueExample { + public static void main(String[] args) { + // Break example + for (int i = 0; i < 100; i++) { + if (i == 4) { + break; + } + System.out.print(i + " "); + } + + System.out.println(); + + // Continue example + for (int i = 0; i < 10; i++) { + if (i % 2 == 0) { + continue; + } + System.out.print(i + " "); + } + + System.out.println("\n"); + + // Continue and Break with "tags" + outer: + for (int i = 0; i < 10; i++) { + inner: + for (int j = 0; j < 10; j++) { + if (j > i) { + System.out.println(); + continue outer; + } + if (i == 8) { + break outer; + } + System.out.print(" " + (i * j)); + } + } + } +} diff --git a/src/ru/caf82/lectures/lecture02/CalculatorExample.java b/src/ru/caf82/lectures/lecture02/CalculatorExample.java new file mode 100644 index 0000000..edfa955 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/CalculatorExample.java @@ -0,0 +1,35 @@ +package ru.caf82.lectures.lecture02; + +public class CalculatorExample { + private int x; + private int y; + + CalculatorExample(int x, int y) { + this.x = x; + this.y = y; + } + + public void setX(int x) { + this.x = x; + } + + public void setY(int y) { + this.y = y; + } + + public int getSubst() { + return x-y; + } + + public float getSum() { + return (float) x + y; + } + + public static void main(String[] args) { + CalculatorExample calc = new CalculatorExample(5, 2); + System.out.println(calc.getSum()); + System.out.println(calc.getSubst()); + + //todo create new calculator, add abs function from Math + } +} diff --git a/src/ru/caf82/lectures/lecture02/CommentsExample.java b/src/ru/caf82/lectures/lecture02/CommentsExample.java new file mode 100644 index 0000000..7923149 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/CommentsExample.java @@ -0,0 +1,18 @@ +package ru.caf82.lectures.lecture02; + +/** + * @author ilysko + * @version 1.0 + * Class for comment representation + */ +public class CommentsExample { + public static void main(String[] args) { + System.out.println("Let's look to comments in Java"); + /* + * Realy big + * comment + */ + + //System.out.println("Cool!"); + } +} diff --git a/src/ru/caf82/lectures/lecture02/ConstructorExample.java b/src/ru/caf82/lectures/lecture02/ConstructorExample.java new file mode 100644 index 0000000..81727c9 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/ConstructorExample.java @@ -0,0 +1,15 @@ +package ru.caf82.lectures.lecture02; + +public class ConstructorExample { + + public class Rectangular { + + //todo create fields weight and length, create constructor, create method Square + + } + + + public static void main(String[] args) { + //todo write some test + } +} diff --git a/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java b/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java new file mode 100644 index 0000000..31e25d5 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java @@ -0,0 +1,17 @@ +package ru.caf82.lectures.lecture02; + +/** + * Created by ilysko on 24.08.17. + */ +public class ForAndForEachExample { + public static void main(String[] args) { + for (int i = 1; i < 5; i++) { + System.out.println("i = " + i); + } + System.out.println(); + int[] intList = {1,2,3,4}; + for (int i : intList) { + System.out.println("i = " + i); + } + } +} diff --git a/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java b/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java new file mode 100644 index 0000000..22f0f4a --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java @@ -0,0 +1,32 @@ +package ru.caf82.lectures.lecture02; + +/** + * Created by ilysko on 24.08.17. + */ +public class IfElseAndSwitchCaseExample { + public static void main(String[] args) { + int myMark = 5; + + if (myMark == 5) { + System.out.println("Excellent"); + } else if (myMark <= 4 && myMark >=3) { + System.out.println("Not bad"); + } else { + System.out.println("Bad"); + } + + switch (myMark) { + case 5: + System.out.println("Excellent"); + break; + case 4: + System.out.println("Good"); + break; + case 2: + System.out.println("Bad"); + default: + System.out.println("Not bad"); + break; + } + } +} diff --git a/src/ru/caf82/lectures/lecture02/LinkTypes.java b/src/ru/caf82/lectures/lecture02/LinkTypes.java new file mode 100644 index 0000000..d3c581c --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/LinkTypes.java @@ -0,0 +1,32 @@ +package ru.caf82.lectures.lecture02; + +public class LinkTypes { + + public static void main(String[] args) { + String a = "Hello", b = "World"; + + System.out.println(a + " " + b); + + String c = 2 + 2 + ""; + String d = "" + 2 + 2; + String g = "" + (2 + 2); + + System.out.println(c); + System.out.println(d); + System.out.println(g); + + String foo = "a string"; + String bar = "a string"; + String baz = new String("a string"); + + System.out.println("foo == bar ? " + (foo == bar)); + System.out.println("foo равен bar ? " + (foo.equals(bar))); + System.out.println("foo == baz ? " + (foo == baz)); + System.out.println("foo равен baz ? " + (foo.equals(baz))); + + + + } + + +} diff --git a/src/ru/caf82/lectures/lecture02/OperatorsExample.java b/src/ru/caf82/lectures/lecture02/OperatorsExample.java new file mode 100644 index 0000000..6bcc959 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/OperatorsExample.java @@ -0,0 +1,58 @@ +package ru.caf82.lectures.lecture02; + +import com.sun.org.apache.xpath.internal.SourceTree; + +/** + * Created by ilysko on 24.08.17. + */ +public class OperatorsExample { + public static void main(String[] args) { + System.out.println("Arithmetical operators:"); + int a = 10, b = 3, c = 2; + float g = 5.14f, f = 2.05f; + System.out.println("a + c - b = " + (a + c - b)); + System.out.println("b * c = " + b * c); + System.out.println("a / b = " + a / b); // pay attention for this (integer division) + System.out.println("g / f = " + g / f); + + System.out.println("\nUnary operators:"); + int d = 4; + boolean e = true; + System.out.println("d++ = " + d++); + System.out.println("d = " + d); + System.out.println("++d = " + ++d); + System.out.println("(byte) d = " + Integer.toBinaryString(d)); + System.out.println("(byte) ~d = " + Integer.toBinaryString(~d)); + System.out.println("!e = " + !e); + + System.out.println("\nRelational operators:"); + double p = 5.5d, r = 2.7500000000000001d; + System.out.println("p / 2 == r = " + (p / 2 == r)); + + System.out.println("\nBitwise operators:"); + // TODO разобраться с битовыми представлениями! + byte t = 0b1110, q = 0b0111; + byte y = -13; + System.out.println("t & q = " + Integer.toBinaryString(t & q)); + System.out.println("t | q = " + Integer.toBinaryString(t | q)); + System.out.println("t ^ q = " + Integer.toBinaryString(t ^ q)); + System.out.println("y = " + String.format("%8s", Integer.toBinaryString(y & 0xFF)).replace(' ', '0')); + System.out.println("-y = " + String.format("%8s", Integer.toBinaryString(-y & 0xFF)).replace(' ', '0')); + System.out.println("y << 2 = " + (y << 2)); + System.out.println("y >> 2 = " + (y >> 2)); + System.out.println("y >>> 2 = " + (y >>> 2)); + System.out.println("y << 2 = " + Integer.toBinaryString(y << 2)); + System.out.println("y >> 2 = " + Integer.toBinaryString(y >> 2)); + System.out.println("y >>> 2 = " + Integer.toBinaryString(y >>> 2)); + + System.out.println("\nLogical operators:"); + boolean b1 = false, b2 = true; + System.out.println("b1 || b2 = " + (b1 || b2)); + System.out.println("b1 && b2 = " + (b1 && b2)); + + System.out.println("\nTernary operators:"); + boolean b3 = true; + System.out.println("Rolling " + (b3 ? "Stones" : "Trees")); + System.out.println("Paint It " + (!b3 ? "Red" : "Black")); + } +} diff --git a/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java b/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java new file mode 100644 index 0000000..a5dcc37 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java @@ -0,0 +1,43 @@ +package ru.caf82.lectures.lecture02; + +public class PrimitiveTypes { + + + public static void main(String[] args) { + + //byte b = 216; + short s = 1123; + int i = 64536; + long l = 2147483648L; + int j = 10; + + System.out.println(i); + //System.out.println(b); + System.out.println(s); + System.out.println(l); + + System.out.println(i + 2147483647); + System.out.println(l + j); + System.out.println(j + l); + + char a = 'a', c = 'c'; + int b; + b = ((a + c) / 2); + System.out.println(b); + System.out.println((char) b); + + System.out.println((char) b + i); + System.out.println(b+i); + + double doubleOne, doubleTwo = 4.12; + doubleOne = 22.1 + doubleTwo; + float pi = 3.14f; + //float anotherPi = 3.14; + double doubleThree = 27; + double d = pi * doubleThree; + + System.out.println(d); + System.out.println(doubleOne); + System.out.println(pi); + } +} diff --git a/src/ru/caf82/lectures/lecture02/StringProcessing.java b/src/ru/caf82/lectures/lecture02/StringProcessing.java new file mode 100644 index 0000000..b51d9b5 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/StringProcessing.java @@ -0,0 +1,39 @@ +package ru.caf82.lectures.lecture02; + +public class StringProcessing { + + public static void main(String[] args) { + + //String Buffer examples + StringBuffer sb = new StringBuffer("Котэ"); + + System.out.println("Длина: " + sb.length()); + System.out.println("Объем: " + sb.capacity()); + + sb.setCharAt(1, 'o'); + + System.out.println("Было Котэ, стало: " + sb.toString()); + + String str1 = "У кота "; + String str2 = " лапы"; + int paws = 4; + StringBuffer sbNew = new StringBuffer(20); + sbNew.append(str1).append(paws).append(str2); + + System.out.println(sbNew.toString()); + + sb.insert(0, "Люблю "); + System.out.println(sb.toString()); + + sb.reverse(); + System.out.println(sb.toString()); + + //TODO delete, deleteCharAt, replace, substring write your own code + + + + //TODO StringBuilder the same methods implementation + + } + +} diff --git a/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java b/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java new file mode 100644 index 0000000..d3fbb84 --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java @@ -0,0 +1,20 @@ +package ru.caf82.lectures.lecture02; + +/** + * Created by ilysko on 24.08.17. + */ +public class WhileAndDoWhileExample { + public static void main(String[] args) { + int i = 3; + + while (i > 0) { + System.out.println(i--); + } + + System.out.println("\n" + i + "\n"); + + do { + System.out.println(i--); + } while (i > 0); + } +} From 18fb4b94d0388c5714cf86f61a9dff0c14d2462b Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 12 Sep 2017 11:16:39 +0300 Subject: [PATCH 02/29] Try --- .../caf82/lectures/lecture02/MathService.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/ru/caf82/lectures/lecture02/MathService.java diff --git a/src/ru/caf82/lectures/lecture02/MathService.java b/src/ru/caf82/lectures/lecture02/MathService.java new file mode 100644 index 0000000..aa3855a --- /dev/null +++ b/src/ru/caf82/lectures/lecture02/MathService.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ru.caf82.lectures.lecture02; + +import java.util.Arrays; +import java.util.Random; + + +/** + * + * @author User + */ +public class MathService { + public static double doProduct(double[] a, double[] b){ + double result=0; + for (int x=0;x Date: Sun, 17 Sep 2017 15:34:44 +0300 Subject: [PATCH 03/29] Added lecture03 example from Ilya --- .../lectures/lecture03/AbstractAnimal.java | 20 +++++ .../lecture03/CompositionExample.java | 83 +++++++++++++++++++ .../lecture03/InheritanceExample.java | 39 +++++++++ .../lectures/lecture03/InterfaceExample.java | 17 ++++ .../caf82/lectures/lecture03/PassByValue.java | 51 ++++++++++++ .../lecture03/PolymorphysmExample.java | 34 ++++++++ src/ru/caf82/lectures/lecture03/Season.java | 52 ++++++++++++ 7 files changed, 296 insertions(+) create mode 100644 src/ru/caf82/lectures/lecture03/AbstractAnimal.java create mode 100644 src/ru/caf82/lectures/lecture03/CompositionExample.java create mode 100644 src/ru/caf82/lectures/lecture03/InheritanceExample.java create mode 100644 src/ru/caf82/lectures/lecture03/InterfaceExample.java create mode 100644 src/ru/caf82/lectures/lecture03/PassByValue.java create mode 100644 src/ru/caf82/lectures/lecture03/PolymorphysmExample.java create mode 100644 src/ru/caf82/lectures/lecture03/Season.java diff --git a/src/ru/caf82/lectures/lecture03/AbstractAnimal.java b/src/ru/caf82/lectures/lecture03/AbstractAnimal.java new file mode 100644 index 0000000..3034cf2 --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/AbstractAnimal.java @@ -0,0 +1,20 @@ +package ru.caf82.lectures.lecture03; + +/** + * Created by ilysko on 16.09.17. + */ +public abstract class AbstractAnimal { + final int legsAmount; + final String animalName; + + public abstract void move(); + + public void sayYourName() { + System.out.println("My name is " + animalName); + } + + protected AbstractAnimal(int legsAmount, String animalName) { + this.legsAmount = legsAmount; + this.animalName = animalName; + } +} diff --git a/src/ru/caf82/lectures/lecture03/CompositionExample.java b/src/ru/caf82/lectures/lecture03/CompositionExample.java new file mode 100644 index 0000000..8ee40d5 --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/CompositionExample.java @@ -0,0 +1,83 @@ +package ru.caf82.lectures.lecture03; + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.function.DoublePredicate; + +/** + * Created by ilysko on 17.09.17. + */ +public class CompositionExample { + Cat cat = new Cat(); // в точке определения + Dog dog; + Crocodile crocodile; + Zoo zoo = new Zoo(new Animal[] {cat, dog, crocodile}); // с использованием инициализации экземпляров + + CompositionExample(Dog dog) { + this.dog = dog; // в конструкторе + } + + @Override + public String toString() { + if (crocodile == null) { + this.crocodile = new Crocodile(); // перед использованием объекта + } + return "CompositionExample{" + + "cat=" + cat + + ", dog=" + dog + + ", crocodile=" + crocodile + + ", zoo=" + zoo + + '}'; + } + + public static void main(String[] args) { + Dog dog = new Dog(true); + CompositionExample compositionExample = new CompositionExample(dog); + + System.out.println(compositionExample.toString()); + + compositionExample.crocodile.eatMeat(); + compositionExample.cat.sayMeow(); + System.out.println(compositionExample.dog.isFriendly); + System.out.println(Arrays.toString(compositionExample.zoo.animals)); + } +} + +abstract class Animal {} + +class Cat extends Animal { + int legCount = 4; + void sayMeow() { + System.out.println("Meow"); + } +} + +class Dog extends Animal { + boolean isFriendly; + + Dog(boolean isFriendly) { + this.isFriendly = isFriendly; + } +} + +class Crocodile extends Animal { + void eatMeat() { + System.out.println("Delicious!"); + } +} + +class Zoo { + Animal[] animals; + + Zoo(Animal[] animals) { + this.animals = animals; + } + + void open() { + System.out.println("open"); + } + + void close() { + System.out.println("close"); + } +} diff --git a/src/ru/caf82/lectures/lecture03/InheritanceExample.java b/src/ru/caf82/lectures/lecture03/InheritanceExample.java new file mode 100644 index 0000000..c6b207a --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/InheritanceExample.java @@ -0,0 +1,39 @@ +package ru.caf82.lectures.lecture03; + +/** + * Created by ilysko on 17.09.17. + */ +public class InheritanceExample { + void tryToGetAnimalName(AbstractAnimal abstractAnimal) { + // нисходящее преобразование + abstractAnimal.sayYourName(); + + // нельзя, т.к. мы работаем с AbstractAnimal + //abstractAnimal.jump() + } + + public static void main(String[] args) { + AbstractAnimal tiger = new Tiger(); + tiger.move(); + tiger.sayYourName(); + System.out.println(tiger.legsAmount); + } +} + +class Tiger extends AbstractAnimal { + + protected Tiger() { + super(4, "Tiger"); + } + + @Override + public void move() { + System.out.println("run"); + } + + public void jump() { + System.out.println("jump"); + } +} + + diff --git a/src/ru/caf82/lectures/lecture03/InterfaceExample.java b/src/ru/caf82/lectures/lecture03/InterfaceExample.java new file mode 100644 index 0000000..4517fbe --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/InterfaceExample.java @@ -0,0 +1,17 @@ +package ru.caf82.lectures.lecture03; + +/** + * Created by ilysko on 17.09.17. + */ +public interface InterfaceExample { + default void printSomething() { + System.out.println("Something"); + } + + String returnName(); + + // можно не писать static final, это "по умолчанию" + static final int amount1 = 3; + int amount2 = 4; + +} diff --git a/src/ru/caf82/lectures/lecture03/PassByValue.java b/src/ru/caf82/lectures/lecture03/PassByValue.java new file mode 100644 index 0000000..1e07dae --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/PassByValue.java @@ -0,0 +1,51 @@ +package ru.caf82.lectures.lecture03; + +import java.util.Arrays; + +/** + * Created by ilysko on 17.09.17. + */ +public class PassByValue { + static void changePrimitiveInt(int a) { + a++; + } + + static void changeReferenceInteger(Integer a) { + a++; + } + + static void replaceReferenceInteger(Integer a) { + a = new Integer(42); + } + + static void changeStringArray(String[] listOfBands) { + listOfBands[2] = "Guns N' Roses"; + } + + static void doSomethingBad(String[] listOfBands) { + listOfBands = new String[]{"Justin Bieber", "Тимати"}; + } + + public static void main(String[] args) { + int a1 = 2; + + changePrimitiveInt(a1); + System.out.println("int primitive after changePrimitiveInt() : " + a1); + + Integer a2 = new Integer(2); + + changeReferenceInteger(a2); + System.out.println("Integer object after changeReferenceInteger() : " + a2); + + replaceReferenceInteger(a2); + System.out.println("Integer object after replaceReferenceInteger() : " + a2); + + String[] listOfBands = {"Led Zeppelin", "Pink Floyd", ""}; + + changeStringArray(listOfBands); + System.out.println("String[] after changeStringArray() : " + Arrays.toString(listOfBands)); + + doSomethingBad(listOfBands); + System.out.println("String[] after something bad : " + Arrays.toString(listOfBands)); + } +} diff --git a/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java b/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java new file mode 100644 index 0000000..0661fb8 --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java @@ -0,0 +1,34 @@ +package ru.caf82.lectures.lecture03; + +/** + * Created by ilysko on 17.09.17. + */ +public class PolymorphysmExample { + static void wash(Washable washable) { + System.out.println("cleaning " + washable.toString()); + } + + public static void main(String[] args) { + Kitty kitty = new Kitty(); + Dishware dishware = new Dishware(); + + wash(kitty); + wash(dishware); + } +} + +interface Washable{} + +class Kitty implements Washable { + @Override + public String toString() { + return "Kitty"; + } +} + +class Dishware implements Washable { + @Override + public String toString() { + return "Dishware"; + } +} \ No newline at end of file diff --git a/src/ru/caf82/lectures/lecture03/Season.java b/src/ru/caf82/lectures/lecture03/Season.java new file mode 100644 index 0000000..bd6c131 --- /dev/null +++ b/src/ru/caf82/lectures/lecture03/Season.java @@ -0,0 +1,52 @@ +package ru.caf82.lectures.lecture03; + +import java.io.Serializable; +import java.util.Arrays; + +/** + * Created by ilysko on 16.09.17. + */ +public enum Season { + WINTER ("Зима"), + SPRING ("Весна"), + SUMMER ("Лето"), + AUTUMN ("Осень"); + + private String russianName; + Season(String russianName) { + this.russianName = russianName; + } + + public String getRussianName() { + return russianName; + } + + public static void printMonthsOfSeason(Season season) { + switch (season) { + case WINTER: + System.out.println("December, January and February"); + break; + case AUTUMN: + System.out.println("September, October and November"); + break; + case SUMMER: + System.out.println("June, July and August"); + break; + case SPRING: + System.out.println("April, March and May"); + break; + } + } + + public static void main(String[] args) { + Season season = Season.AUTUMN; + System.out.println(season); + + // get all enum values + System.out.println(Arrays.toString(Season.values())); + + printMonthsOfSeason(season); + + System.out.println(season.getRussianName()); + } +} From 48089095ea2d71f7d48f833556b6274c228e6512 Mon Sep 17 00:00:00 2001 From: ilysko Date: Mon, 18 Sep 2017 15:22:13 +0300 Subject: [PATCH 04/29] Added bomberman example from lesson. Added packages structure for homework#3. --- .../lectures/diagramBomberman/GameObject.class | Bin 0 -> 175 bytes .../lectures/diagramBomberman/GameSession.class | Bin 0 -> 670 bytes .../lectures/diagramBomberman/Movable.class | Bin 0 -> 258 bytes .../diagramBomberman/Positioanable.class | Bin 0 -> 247 bytes .../lectures/diagramBomberman/Temporary.class | Bin 0 -> 239 bytes .../lectures/diagramBomberman/Tickable.class | Bin 0 -> 153 bytes .../lectures/lecture03/AbstractAnimal.class | Bin 0 -> 888 bytes .../ru/caf82/lectures/lecture03/Animal.class | Bin 0 -> 311 bytes .../ru/caf82/lectures/lecture03/Cat.class | Bin 0 -> 585 bytes .../lectures/lecture03/CompositionExample.class | Bin 0 -> 2152 bytes .../ru/caf82/lectures/lecture03/Crocodile.class | Bin 0 -> 561 bytes .../ru/caf82/lectures/lecture03/Dishware.class | Bin 0 -> 540 bytes .../ru/caf82/lectures/lecture03/Dog.class | Bin 0 -> 388 bytes .../lectures/lecture03/InheritanceExample.class | Bin 0 -> 997 bytes .../lectures/lecture03/InterfaceExample.class | Bin 0 -> 607 bytes .../ru/caf82/lectures/lecture03/Kitty.class | Bin 0 -> 531 bytes .../caf82/lectures/lecture03/PassByValue.class | Bin 0 -> 2205 bytes .../lectures/lecture03/PolymorphysmExample.class | Bin 0 -> 1203 bytes .../ru/caf82/lectures/lecture03/Season$1.class | Bin 0 -> 782 bytes .../ru/caf82/lectures/lecture03/Season.class | Bin 0 -> 2423 bytes .../ru/caf82/lectures/lecture03/Tiger.class | Bin 0 -> 746 bytes .../ru/caf82/lectures/lecture03/Washable.class | Bin 0 -> 136 bytes .../ru/caf82/lectures/lecture03/Zoo.class | Bin 0 -> 729 bytes .../lectures/diagramBomberman/GameObject.java | 9 +++++++++ .../lectures/diagramBomberman/GameSession.java | 11 +++++++++++ .../caf82/lectures/diagramBomberman/Movable.java | 8 ++++++++ .../lectures/diagramBomberman/Positioanable.java | 9 +++++++++ .../lectures/diagramBomberman/Temporary.java | 9 +++++++++ .../lectures/diagramBomberman/Tickable.java | 8 ++++++++ 29 files changed, 54 insertions(+) create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Movable.class create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Temporary.class create mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Animal.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Cat.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/CompositionExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Crocodile.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Dishware.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Dog.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/InterfaceExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Kitty.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/PassByValue.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Season$1.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Season.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Tiger.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Washable.class create mode 100644 build/classes/ru/caf82/lectures/lecture03/Zoo.class create mode 100644 src/ru/caf82/lectures/diagramBomberman/GameObject.java create mode 100644 src/ru/caf82/lectures/diagramBomberman/GameSession.java create mode 100644 src/ru/caf82/lectures/diagramBomberman/Movable.java create mode 100644 src/ru/caf82/lectures/diagramBomberman/Positioanable.java create mode 100644 src/ru/caf82/lectures/diagramBomberman/Temporary.java create mode 100644 src/ru/caf82/lectures/diagramBomberman/Tickable.java diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class b/build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class new file mode 100644 index 0000000000000000000000000000000000000000..b15820a79fe8fa65b0985fc92843bb2b0834deaf GIT binary patch literal 175 zcmYL@F%H5o6hr+>+dvmM1`H4hF)%a0$biKD8`6?0X{9vfa10!PLm^TzFj=zoY`;Ix z7l0iKfvLcZkoAFmAWW94D{s%unp}xoorwn}#1uSo=XLuJ&7L yqd9op%bVfavpaOI)ZTF`{}5p@V$yP3%U@4UASCe$kfd=PDG)UqH75D!Lwo^u$tm{$ literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class b/build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class new file mode 100644 index 0000000000000000000000000000000000000000..1bf0a8c217f6d0a17c69898067f775a257e140ec GIT binary patch literal 670 zcmb7?O;6iE5Qg6k2~LblA$+!!LdYedQe0I?AO#^oCAe4xDN*hlXB!smU9?_D>d%5h zD{)@WYQp zXj3B+eC`jK`uUl0<6Nr8-uI*9=W<#vLW>P;ixWdO9_s2*gB0$4Y6- zEs2T099;1U_am;x{`o{0BS(T5?o@v&v;Gze{7xqKP({tbriZWCVyI*V8xFQTG_b?a zd0)#^pwPqcipFI4_8*Ksm7Q*|0O+8s*unZGE%0$d7FfGW8KNbLo(ki!`kb6}lp2}{rG%AGX; literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Movable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Movable.class new file mode 100644 index 0000000000000000000000000000000000000000..bf8113d6e6afb160f287f4f73309612bd7c72c49 GIT binary patch literal 258 zcma)%O$x#=5QX2=YP44H82*3}apBs9J5f;FPivIaq=9IAI2RtkLy0MP0C_MB!}l?~ z_viTnu*5*1Cy)sA1yVw6U9AYM(fCA24zBXK+GrC_>DJYp88s`oX2Qf*GUv-`A&tr( zl~;Fp)_nDB*Uo0jTQ23#APgHv8ZNJLmlc60%>VHB?yeu&aoPMOO#e`hI=?k^hd_uz ST8KkWiV1CWnhhe%2;DCMsYllU literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class new file mode 100644 index 0000000000000000000000000000000000000000..dca9d1bae49417d31903f6eb64f1eb486e043968 GIT binary patch literal 247 zcma)%F$%&!5Jmqa(P&H|o=ND~@tG%lO8G zxv53W*VRJgGOlVPOL0j#Fas zz21)}fCYL29f7VuM2J#V#<{b5Z4{v~8gB@F&sN&%;{2uEU0%6Ft#sxqgS|4>+_AgQ zE_`Fc#8ook({e5|m6VlJg*<9b9h*2e2jvV~`Ev-v+L9UDRBjI!ZxE(`EUek6Z$Bgu W0)GwvOwc4W(E@yib$Tvpj`j!9DL>x; literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class new file mode 100644 index 0000000000000000000000000000000000000000..839dc93e31cdc28094766613eb4f2c6da028a150 GIT binary patch literal 153 zcmXwyu?oU46h-f=u~9+rGZevqI5<1FIw(Y zfE}h1Qer|7y)$>hXt}x)X6G(NV~@^T!u*mS*4}O!ellSllQLZGx5``7r)VGQ=D3a= m4qebT25!|~AuI+-d2VZU(oGgh0-?xpfJ6>L41{ss0_6{oCM9nG literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class b/build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class new file mode 100644 index 0000000000000000000000000000000000000000..ea9922f8e3212beae3ffa684ea3900756e4c9f35 GIT binary patch literal 888 zcma)4TWb?R6#iy+%_iHmiK%VXwz~D2tZBEleGn8O3PLfhLL`vKNixPMdkK3f4TO{U?A!9G0+!yC&{g(BKrYt>XO>mheDj4=p^x zV+%GMReNHhW}?nu`C^zfgD4AA26jXR9?F3GCp-`g)z&FL_#w zPtW%~U-Z)~7Rlda@4##Jk~HT1v^kYU^o5r)l<6ymwc635Jf+EMlc2tMD;4v~Jix9p zWWu%a6b**;fBn7Aq(2a`joYY_yW_DF(j*+2I5u{$Yom;c4G()Jp4r&PfsN}}W^n)C z14HGK^?mP@JkOQd<0KUU4LHi^U^VwBBku#vKc!a?JWylcqmc*)3_G37OprJ2i%&_1^iQC{8 z+Z(Pg8ajzY{OPQ1x)rW>7|fX89Se2CU{_TVHN>GzW%Cskv{Wp$RN=ub4_dxhz2ev0 zfsK9#Sy(3K9L%FYe@p946df#}#8CLBDMRTm#(pRR?la`lcCOFErdz#>wFqbxDxvL+ zd+m%=?r9`LUDc7`0ZlUc3rzF1Qj#B1-BPEpBdG~)?kv|(q>GqzAx1`H(VHQoDG71N z+om|p*(=XrE9N6I_ifHVo0W3cU|=1CZ(`|=ovAd(EC$llbV;m OiCA3`x-bc4F!})`@Oo|l literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/CompositionExample.class b/build/classes/ru/caf82/lectures/lecture03/CompositionExample.class new file mode 100644 index 0000000000000000000000000000000000000000..5b60a853d688b522d6a35f8a33a43bcab844753e GIT binary patch literal 2152 zcma)7dsiD(5dU2W*<@KB4KGo&JS7B5u+^4IAJDY4YABUdG}PB6+0vz(-MHCc(bJFM zm+%u*4+M`K{nvB+P#%AGHwYLE?m2sB?#$eo-^`ua{qwJ1e+Td`Ug#LdqJ||MEm(|W z5O*|WG~89}J+&I)_NGR|OM>G&E_!=^xMLHYtCS+ANd$fxs{ z)3#agtDadoV&<--Gtyt6WzpR_&+@LjMay`>a|>?KvQ2@>=AMrXmH+Qt_dNd_u1m}4 z4a>3oTLRT#q&8 zdRw!O>2I3Ssm$iws#h?x=8kDEIgaZ~<(^P_Pqbu{22|J&lzf_UTDZbKo1ct2RAp+nB%NU$-pHP1TLP_F$N~^_Bm#}PJz*8j+Pv&By9te zNE(#Ls)aWhof&51-xM%r zhX3hnZYgKO2Byyp&iQ-iX|z7^;`PJ4B8n^VmZORBy|vSFG*2x}fpPE?l5rc)HSlsu!y8btNNvNuoJ zhv63*C*s(CD4A)djwCk}@)IfLb}PPFVoGk6iS>n0EI0j#^XGF2Oj#m~o}dP&#R6Jc z8QGkjzO&L|AkCEi3SV*+xw~Sztfy{OmOYEruy+N-230a>PL9~b|0?Ja{;F@;=_SvT zyF5C1YI^^(QVSU2SACp+ln7r=7FVdL2q*_5pd1U*R=#W*2&BoqgvK8La6NSZkvc?6 z{s67}h>&f|M}I>!-JU!0J;gG9bM?e z6`>6!}h2RaF%ooI}G#17Fxt~1e9L$`uc z!-Yg5#rSIuBY9zZUyIIlC(gy_}`~W{n zoZWhR5HT>BnUgtZGRf=P^9z7Y%s9wn&_)rZZVWjnW7xuog;9q5t_-BvW9V91ZZKr4 zx+NI;Ycde0vELNoId3XLiZ$(V)!?B_@((a;u4KfpSPNs<;}_fOt`eS!LlJ!jYa4Dg z)ShlhC3YAr!OaO7gHzXW=!s*(8AhtwZ|g`Jse_|i?zfd#z2-N(01Mp~#tIn61aS_9 zlAhFYG-qM5fGJEfEc~lC!~9=$l|cGjF$^SKUB!b-w|*BH;nTb5n66u{r6*FmXQ2#C z-GqYsG*Iamn8s`;MJgcPQis@)Gz4GnEH^NV9Q{bLGGsI)7;K7M@{D|Lwf&|$pd;!CD*Mi)ii#bj`z^_g$Eb{29TjVzxopJ5m6Xa*!C*_;3na)yx~F8JMGu1=O0NWz^&msibYzQlk0`j$wNT literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/Dog.class b/build/classes/ru/caf82/lectures/lecture03/Dog.class new file mode 100644 index 0000000000000000000000000000000000000000..cc1a267328970cddb7a1633c82b5e383d9b4c441 GIT binary patch literal 388 zcmah_yH3ME5S(>POpGBAUIhh@DoKG6P#_W^p@1uk2IL~$#W~=jvoG=k!Dmq*Bnm!& zk3y^=w4l@7?u=&Ur1|)Kdk1igbr&|48>nH$LCe7^!Bu&XDVdJ-6M=?=dS9igI3w8Y zVJG4-Fk?w*hANd;Wipc4jTmWWTA_)Bjzp#^JR|MmUgd<{Ff097+@2izTE<10$^3UY zIPx#dU5|ghHf0veKviLz1CvZmt_o$+%SVw+wcMYG2jRiNnuj^m3ETf<688R5oTn-g znow(ZBJ6MnHg`gNIefM`m}jQJD1gNWaJ#Rd?$!&eXGRuWewWw_oU*^i+CCN-ZTzU= QVUZF0zEinTR#(2}7jV8&>Hq)$ literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class b/build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class new file mode 100644 index 0000000000000000000000000000000000000000..c923df792f46b53a071a06817b3ea5075a77de51 GIT binary patch literal 997 zcmb7?TWb?R6vzLQY_iFAZDVUwHQwSimzs@jAB3t9L?sZakPs+7$YdSUDSIiqv&DQY zMOsks1NfoDGn;A*m4N%OXU>^(e&;qnet!K9U6Aw((81heKAk{O5Y^^?IFrJ6+1;a{D24XMqMVkw=!*Ug&af$RnxsGozsn zWX#a+MTz6`50AGTPq-?HMEv{E-gdgdfrzByfh%5ovI_}lxuH$hy0j39uLM&Uqvz)r+kA)V`^~i zAJ+^yCC4ISu=-&Vx#FeNbJ{rHZcC$WEWtKWx6y#jP+c^!f#%w1>VQof57DyWpl#xj zjV)|5v=&95FMy#m>+bdFkaon-Sj3ngHN#TOC;QapbWesK9#gA-LHm zI!qZlZ)lQ=<|(*OOSe2Rjyrys1mwiJG}pAOc|Qj8NJn|J7o*m#4^c&tp0xh5pi*Gd z{{m?aNk%f)I0gGehYXhKpHGc>tk7Azk^@S(ND^4Z8d-GkQ<52yx#kHnvtTPV7GaQ+ z29&2xe*igL!a9W(>1N{$^^SZrs`3rl{Zkk{LZ;Zy$Tz>hJV9ZWpiI?(a0RN!rg}$h5lBc8AO+>_22)Zc4ssm?p9KdF9QXh} z3b6@LUMDUq&w6G(JAQe6dIqqAH4{^qE}>Dz3}y|?8JK4;C-!;h zaTTQaqgfzrpJBsMiS6^ty|x_+UnffRKM$MR_OaALU2-ty==6#EQiC5R%}G literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/Kitty.class b/build/classes/ru/caf82/lectures/lecture03/Kitty.class new file mode 100644 index 0000000000000000000000000000000000000000..5b37e7ef7098e2c06d8b5861ad5e6766e269b92c GIT binary patch literal 531 zcmaiwO-}+b5Qg9KEutVI;!T4GFp)Lt!9-(Xj9%P`2?oyvDwOQDq+5vmD?OQb@CW## zjI#>{PI_qPqwg~_ov-hYPXMQ=WRbvT2BkE%(kQ2~&5*i~O4>_?c&*-MNL=flV92{t ziTknN5$2J1JjxVZ-Q`}J8yUv)WWo+)z)*F~*y-};vt!2-T{|`+_;rp>oI7dl^qe7M zb;}y5`V6I7-5v4?cRa58&MZrcsy6+G61F3_3K}gvHeKP0iSVwJ(w1AP6?H2uq0Naf zM)m~3*_r-UhSOFav^Vv&84ad^fAhlqktZ5q#~e~fGbE#-820`hoT0FowAmTb{}}fF z!k&0A2zP{C#A)BujFumxL!BwgkmrzPWRnN)U~kd$N+bxAWn}5j%>-B_59F_5or;9; e;T(<^W3Lp(ut0Z~(D)q9lO{z-Au6*G5yc-Cdv}Te literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/PassByValue.class b/build/classes/ru/caf82/lectures/lecture03/PassByValue.class new file mode 100644 index 0000000000000000000000000000000000000000..b77ff9149f7df15a646ed65d2e083332f44576cc GIT binary patch literal 2205 zcma)7TUQ%Z7~K+)%M8EuYBE zmWqsuM=Cy5u`LacReTmj7Ek16N5$t6JdNNB1>t$qHr)jU9f{Fx1;Kmef>6+tHf^z9 zE#-vs$jDi=#M9-xVQm|ZDfdld(A_gD3P#gTHI+Atx2IE<$h%cXR8AizXHuI+rLuIi zZCF(?N1ptiVeg7f$1Ityc_>zFmv2q1$d@YyuN4IYp3jyj3P;#^=_7W9!-GV6-#9c< z7AaCq>zqXPU0_!*=!gT$$cyttz1|x#u4CG}i;iO)N%9>Zi+9u@@3PE_yHQ*+>;jYR zyTD69ccGjqmjvr!?=Beyrc^Ran>WMRB`9D_$z@tWG*hlRd9iHDqQ-o+xhXT#@Fw2U z@FkvUFpyKwdoEw;l2mZ%LDjD4>m&MBxgz+6*qNgjI$a)CE3RqlOQv8S6=)|vp43l% zKY8)@Hz#!sqew=O*H8c>8El6yRZXiPQDdg<>IbLo(v6}k9Q}L~6Qla9uAzusx$J2$ zu^+*64HiloCU8^1WV2&>Ik(R-X`yOw(Mvj8!=waHT?l?fgBxfjoE8QBi8weAmh44z z)3l%K%U1b_{h?B(z<%8Ds-C&bU>y{U{7*%+ zG;X6&7X>Oy-q1@!l@vteP^xF6D2H@q)HkKgqEJ`<{vTCbQ6jcnrMCJ#ce9+L=4_Xd z3!_9p*kE03R${_0Dlf4)|2sTWa~=r1+8RRpvFesRlY+~M^E@QzYs^|}K+KUdX1f;q z)PGSx6nRUaUakH!P_HCa*R)a%iBlybEgF9%#~i=SIxqQ)K#`*4`Zjkd-Z?x7C6A%} z#D@TGa1A$%D&FC<<~d*l3GP&>Gg>5gnwJCzzx89I{mO{f1yR#&klf?KE*l z)#sz>dPzg+G-+-%X~M}+Je+A~7(fVvK87%6_}?e9qK=vj3;f%Yfy6?8Ad>BftC?&t z-kCWU%@w9J#dS2F7pbqx6cR|%l$4c4@`PWEyD literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class b/build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class new file mode 100644 index 0000000000000000000000000000000000000000..7f655f9a4d5c7461eefec9cb835f0557c56a3c77 GIT binary patch literal 1203 zcma)5*-{fh6g^FrNyfp1u&XGD#)NIyR21aF?S-gRVa2k1YLYP-oFz4xi1{pi2$od& z0e+O_=}9O=QYjy1ZujkT&$&zYuirm@0@%c^jx6$N+(SV_QAZ5<6c&_SR3}Sn#osbk zG?+Scy~?H1#jh{Lr<>c zSEN&xfvxsEXFROiO@Xyi&@wCXV~=RJ8jnw8ufP5eep%Q4aeH1 z(6MaR1&W1%vF`{{dfO_ulnUu)lmEXc%DB?@1SSd}N=NduG#%;H%!4qny;{T>mqCpc zjP^MeNPM!xuq`k@P;F0vSW&8KH|xhTV6z6N_q>N=jDFy^f{OLhRxO_D)2S7ewSf`j zG;A8Uj|T#i|5oy}Wjj?X5J*=XOM0wr*1$t-8F+-p8nzAW;EBN8peaRF2;3QjIZNEY z6s85tLD)XE2xQMQe{*=mt8&40&~Ap7%bV!8cre}_nC+YUoL0!0S<+?8lCsgTysE%* zq0dM!xq7`(^9lX#;04AC#Y;dUMx*pDDhg-~rSI?-jrUV5V~+1B%Qp$WIH5+x|0s7R zt)NXToIrf#VhCgWCnIMP<6IkE046ZWT}t(p9u>S7kpVN`Fm#I8`xC@-i4Kwr9cVNi zq&i5Slji&1{sA|pBj5l4 literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/Season$1.class b/build/classes/ru/caf82/lectures/lecture03/Season$1.class new file mode 100644 index 0000000000000000000000000000000000000000..9c0ec618d94feee2127147e70cb1a2e5b89bccf2 GIT binary patch literal 782 zcma)4+iuf95Ivi?wv)QlEu~G%trRyGZZ0h#BoId1lU8&CK!a?C(E6PXRo_y)qWDR6+@r5}{>DS2SFe@z4k@jx)lc7jN_+55goy1XCK$$TgFdAQG$K=Sj$8E?e>ccggE%U+x%zGwxq zV){(!!7)GK)Ug@)VVnlhkt0UKc%Wg;z-?FtrePRZN7Xo$abln$)9y%j7gYut)XoRB$AgZ+#+H31Z#`r%+EFBuosg%gNEytD!fyYVZir#+ z;zkVW2@f;bpjK}jb}p`XMkNPrx7*yKKmEUaElvhO#KU|Yv>$c5*X=nj0k7vcvXSb& z*=xJ6%vE|9WqK#ftjHUb2s&nPiQ+7=Pbd-sT0g)}f0e(X@Kt`r?@*N8&rn|HR3$n! zp&C(jLUp2APQO4Qy#*{`3Kd#gm0}H>cuesLw(*i;5hm%Wx#}|J2p7oa$rhm>Xq4gn Z>!{*#p0$806cx$?R>{iLqeKy={uf@xtbzal literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/Season.class b/build/classes/ru/caf82/lectures/lecture03/Season.class new file mode 100644 index 0000000000000000000000000000000000000000..591f422e61df6f7f38bec02ed94cc2c7a5c831b1 GIT binary patch literal 2423 zcma)7-BS}+6#p&x*iBd!gJ4mLhyeqL@w-;3HC42+Nl+HB6#H=rOITfY>1G#8KOWlY zW1srchtBl1(>~c)k!h>rbD!cr)af~QLkWc$$;|Gad++)9opXNY=I?+0cn;tkzDgj9 zTS>f!f{GCp#U%Pr;@3Ez+)m&a?j%W?NWj3PhN&c`aaY6p8fG+nz)G{cb&r)kOyVPa z%+e?P5*qq7%&}Nz#d!_KHJB_eXvk=&u(+sUP=lr7zKRD5^t|Jk-ZfiPt7cU}{BFK9 zIX0mnUGRczSu9*UleNvVA9!YULpXIdYnYSW?jH z1=Xr0oRU~F6{HIH#fr$_1zsK01YdI`g-ID*TrpkoK?K~mjYG5v|=8Xw3EZg;AneVNMb7hT6+td1{) zt>XgjCP9u9ugY#K*kkyj{Gce7H_}`ZmZP9EGrK)38%Bj!p19Vd9mMs(O%QqcEmM(a2ON5=)YI)*T; zV;P_7@K9CZ>jp#@j>wncBaRzVb=*Iw6r~ZBY$;+?n&v^Sd?`ZWOY3G~za~+vb z<0m?QQh)aHJ0jKQm~s>7B6xMx(x(-~%C_rJ{kL*(eC|G79@L}r%^a4u&E=+cH!g%` z_HuBt>uk1bsO6b0BWdHI<(C(Ujf5~QZ>sdhO|>DMI-B00d&_K|Cf@btEl1c2h;p=U z+f3G2tx~h-zzwJa9U(Z&&EDqOp}?kKIPKD4>o&QS17_1GY#G%?@{BeN6!?~%&3T?! zrK!+-H_V4ev3Wu^%(mC(>S?;a`{<7(ezl963(%KZD!|#f!D)KOkETlI_d>0YIP8vhQ-A@r88hHZsH>txh_tGhWrP%w?iWL1(0-a>Z9xuv# zSmKN#c$0QpaET%j=NtGqFUA)e`W@>3p>;@iA+%V-U4o~kVf+iZW8;Y$w4pU5PX0;@ z`sL~2eTLmj52tj2o?MOU(7FcwXB=g5j}$vu+$+Ua7Wa|J2}Wd*2B@4s7tPyYDn~aJ zwuj&!Aq+=xgW8ct8h5Cbn?;QUc-L+ ztRuCKb_zbcjsxL#M*~XOuR~O2P%WdBP%ClbAOSi|z3wMan{^++HC!h><{JYczG94^ zhWz;!F**b8{fX#Isxy*0_!O@_MweV3ilz?BWw%_u9!vGeT)WiCxSIE+TQ1td7wa GZQ8$aj)mJ zJy59!9)O2J%q9g|6oC)BGo%0iX2$mSALriyJj1q+QVGzLdK{=a*X3L8w&(8+dJhZTiMe`WR#UUp|_u9HcqMM%mNG3)*%{L_s|Zp zfrq@ODYb`Ah)rw>Z2Wg}ft`P8`oqE+nb^KonM?(iyL*>LA6TRGXxF{jn|~G>d?_qt zJW5_#fu)&V<-tMWQ#;XSqxW?IY&IRB8 zj@J}tsGM+ILC9yoH?YdSHC*Q?oat}_i=6S~Q-x!^V5MU;PEl>vzGC5T$U3)fUxG9) gAh+05XKQl`Z2cbU3a~y0*kR!293cN8jH+PiC;f??s{jB1 literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture03/Washable.class b/build/classes/ru/caf82/lectures/lecture03/Washable.class new file mode 100644 index 0000000000000000000000000000000000000000..79fdc8fc8dc1e917bd6c7ea3ed5adde3803c6c6f GIT binary patch literal 136 zcmX^0Z`VEs1_l!bc6J6FN=N*WRNp3h@lL+bPVelVbHlJUG4-7 zh4YdhSvJ31S+E>ohmkLW@5B6}wUOvn8JgFmC&P7yV)0)U(-j77Q(Xv#_LB6(LF872 zf6A*4WpX8DbEm?68OL8qExeLsX#7t z%B`zFhEjQ3x7@8eV(yyXa1$-ao5;e@F=}EA<2oixOk#>*^shlsV}_0xVL9BZS%=kY zn%1vW`7Q{BOSV)*Ke|haSSsttmtI&7eZgJwo^Oz*2dT#*hc4A!{47kmP?hv*tJ4*7 zs?)0ij25}4Jx!|xCS_Xbw2c&ffHCt7HZ%K()ICKhw9(#{Xm_AtmumOWPPv{>H9F8q z5!EHsn4Uxai@8jiq~8P5IqeBeKS(1f-zQ542`;t~8~es}HHI`dfE*L#qydCRLC6$( FJ^<)DlX3t6 literal 0 HcmV?d00001 diff --git a/src/ru/caf82/lectures/diagramBomberman/GameObject.java b/src/ru/caf82/lectures/diagramBomberman/GameObject.java new file mode 100644 index 0000000..7006157 --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/GameObject.java @@ -0,0 +1,9 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public interface GameObject { + void start(); + void finish(); +} diff --git a/src/ru/caf82/lectures/diagramBomberman/GameSession.java b/src/ru/caf82/lectures/diagramBomberman/GameSession.java new file mode 100644 index 0000000..4877b8f --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/GameSession.java @@ -0,0 +1,11 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public class GameSession implements Tickable { + @Override + public void tick() { + System.out.println("tick!"); + } +} diff --git a/src/ru/caf82/lectures/diagramBomberman/Movable.java b/src/ru/caf82/lectures/diagramBomberman/Movable.java new file mode 100644 index 0000000..6629aa9 --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/Movable.java @@ -0,0 +1,8 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public interface Movable extends Positioanable, Tickable{ + void move(); +} diff --git a/src/ru/caf82/lectures/diagramBomberman/Positioanable.java b/src/ru/caf82/lectures/diagramBomberman/Positioanable.java new file mode 100644 index 0000000..5b2a20e --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/Positioanable.java @@ -0,0 +1,9 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public interface Positioanable extends GameObject { + int getXPosition(); + int getYPosition(); +} diff --git a/src/ru/caf82/lectures/diagramBomberman/Temporary.java b/src/ru/caf82/lectures/diagramBomberman/Temporary.java new file mode 100644 index 0000000..e32ee17 --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/Temporary.java @@ -0,0 +1,9 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public interface Temporary extends GameObject { + int getBornTime(); + int getFinishTime(); +} diff --git a/src/ru/caf82/lectures/diagramBomberman/Tickable.java b/src/ru/caf82/lectures/diagramBomberman/Tickable.java new file mode 100644 index 0000000..8d51018 --- /dev/null +++ b/src/ru/caf82/lectures/diagramBomberman/Tickable.java @@ -0,0 +1,8 @@ +package ru.caf82.lectures.diagramBomberman; + +/** + * Created by ilysko on 18.09.17. + */ +public interface Tickable { + void tick(); +} From 54d00c32e284029f6cfff7490e616af35e62c0cc Mon Sep 17 00:00:00 2001 From: SychDan Date: Wed, 20 Sep 2017 13:39:35 +0300 Subject: [PATCH 05/29] Try --- .gitignore | 2 ++ nbproject/private/private.properties | 2 +- nbproject/private/private.xml | 11 +++++++++++ .../workwithfiles/OperatorsExample.class | Bin 0 -> 3060 bytes src/DiagramBomborman/GameObject.java | 16 ++++++++++++++++ src/DiagramBomborman/GameSession.java | 17 +++++++++++++++++ src/DiagramBomborman/Movable.java | 14 ++++++++++++++ src/DiagramBomborman/Positionable.java | 15 +++++++++++++++ src/DiagramBomborman/Temporary.java | 15 +++++++++++++++ src/DiagramBomborman/Ticable.java | 14 ++++++++++++++ src/MachineLearning/AbstractModel.java | 14 ++++++++++++++ src/MachineLearning/Boosting.java | 14 ++++++++++++++ src/MachineLearning/KNeighbourhood.java | 14 ++++++++++++++ src/MachineLearning/LinearKernel.java | 14 ++++++++++++++ src/MachineLearning/LogisticRegression.java | 14 ++++++++++++++ src/MachineLearning/NaiveBayes.java | 14 ++++++++++++++ src/MachineLearning/NormalKernel.java | 14 ++++++++++++++ .../caf82/lectures/lecture02/MathService.java | 12 ++++++------ 18 files changed, 209 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class create mode 100644 src/DiagramBomborman/GameObject.java create mode 100644 src/DiagramBomborman/GameSession.java create mode 100644 src/DiagramBomborman/Movable.java create mode 100644 src/DiagramBomborman/Positionable.java create mode 100644 src/DiagramBomborman/Temporary.java create mode 100644 src/DiagramBomborman/Ticable.java create mode 100644 src/MachineLearning/AbstractModel.java create mode 100644 src/MachineLearning/Boosting.java create mode 100644 src/MachineLearning/KNeighbourhood.java create mode 100644 src/MachineLearning/LinearKernel.java create mode 100644 src/MachineLearning/LogisticRegression.java create mode 100644 src/MachineLearning/NaiveBayes.java create mode 100644 src/MachineLearning/NormalKernel.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68fa45d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/nbproject/private/ +/build/ \ No newline at end of file diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties index 95dd346..d06644e 100644 --- a/nbproject/private/private.properties +++ b/nbproject/private/private.properties @@ -1,2 +1,2 @@ compile.on.save=true -user.properties.file=/home/ilysko/.netbeans/8.2/build.properties +user.properties.file=C:\\Users\\User\\AppData\\Roaming\\NetBeans\\8.2\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 4750962..3267259 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -1,4 +1,15 @@ + + + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/NaiveBayes.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/Boosting.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/NormalKernel.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/LogisticRegression.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/LinearKernel.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/KNeighbourhood.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/AbstractModel.java + + diff --git a/result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class b/result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class new file mode 100644 index 0000000000000000000000000000000000000000..d68fd30a389271b32199e0cea0cdb0dad9a0109a GIT binary patch literal 3060 zcma)8TTm276g|DOJJSpc>@F-21v5Ut<>e~q3i1d-)R3SUKoc}kXJNp_WoI1*6(z(N z6BF~cDzP-bsj@16F;!?KWs>hyzVea(eC9Kis(gmro_(;uV6s$o-|lnoxsSfx!_WVG z_XB{v_)J9vM~d(Q1~^_+@e&5Ty!*MaZ%rVR{!Z9jV zCpb=Wyu$G+#~8;c6{qnU$Lkzt1bmj`oZMSU?&v4?${B$}mwPiJIN}`R91|P{$0Wy; zg7Yd8m=?nYjwHtnM~cJbNON4|usCKpY>qjOOB|Ouu5ipNxXK`RB~l5yhe3)ooMiC! zn-c~@*V9}2^ah;*+ zpp~%C&lq-MTu*9d&f)-(`tcTSkjC05`sNbJ3BzLW>spgGuC-`!ty}ZsZQK;YJAS;2 zTMRs|H4@sbk*I4?M~TEK5+}3z?=b|`6Di%AFYrv2nrLcr?7S1sBsVo>gyKki-ZmOE zu~P89AGh%Vg^}G|%qaP`8d>@esfy~bk<{&knOc<{RWVI*v})bmn&tQ?SNjt7<;1M9 zDiUsM_1Z;8fy9Ls@l00q&O4w~*FMV-SgF)deA*bd=}i3i2p{|L2|i`;wPdu5=C!Ua z;haiCa!*fIR)w5fl&gd0)S5$KD30&Z78bO4##pTC>vOAeb=0ud6_XE}$t3j-`I1L$ zGi6YqzER5%bJ1~XHCr3736zG72}1gk)LabB)?9R4pKNc9CMl0O%b3jxyIZ4c`--95 zrB`X!sYk+$9;fEDsf7)FW>u9kUA=m1e%3ZfOETwdYT?WkSWVH%pri$3lCDWO;(kkH zJ)JgElu?VD!aAF5PZM=bWT4?GFt^QI)D@BSiVnfy_4_OQ!IdT%NZH1exJae8*_RL} zm!l551>ta?dK$MpX<9Qn)vd!N>B1w*v}fmfE>T;{NK+Hg15z33?{`tbR&>zoEPfs^ z@tn}uMXOqx8O^@NM_}KOz|c*j>}<*?LJyuJnN;bqYHltD!mis}D2KZa0(X_Vp?0`wIO;tt*W&ryztsK74>;}29a8C9$f z)$9m1u_0_`W2j*_u!Y@*#_nJ%`vTkO{%vQ!VF&vgb)H7ld(L8~=NclOyJ+xyi$>3{ zX!87tW+{MOQZ=H|7VMS|VULtVn`C3JbQ$}kFAkn<6#UQ z1$_$omqi{0+frtmEz`57uIx)vp}}e(Z^E9Stk8s96*`ihioy-eQ=`reF37>f@rrRX k0_)-`r~rMFUEr*_g6Eg%BjBcycmH1m^c^_l^v>ab0lWKy{r~^~ literal 0 HcmV?d00001 diff --git a/src/DiagramBomborman/GameObject.java b/src/DiagramBomborman/GameObject.java new file mode 100644 index 0000000..8f4fc29 --- /dev/null +++ b/src/DiagramBomborman/GameObject.java @@ -0,0 +1,16 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public interface GameObject{ + void start(); + void end(); +} + diff --git a/src/DiagramBomborman/GameSession.java b/src/DiagramBomborman/GameSession.java new file mode 100644 index 0000000..7d72af5 --- /dev/null +++ b/src/DiagramBomborman/GameSession.java @@ -0,0 +1,17 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public class GameSession implements Ticable{ + @Override + public void tick(){ + System.out.println("ff"); + }; +} diff --git a/src/DiagramBomborman/Movable.java b/src/DiagramBomborman/Movable.java new file mode 100644 index 0000000..a0f8357 --- /dev/null +++ b/src/DiagramBomborman/Movable.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public interface Movable extends Positionable, Ticable{ + void move(); +} diff --git a/src/DiagramBomborman/Positionable.java b/src/DiagramBomborman/Positionable.java new file mode 100644 index 0000000..5b266de --- /dev/null +++ b/src/DiagramBomborman/Positionable.java @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public interface Positionable extends GameObject { + int getXPositon(); + int getYPosution(); +} diff --git a/src/DiagramBomborman/Temporary.java b/src/DiagramBomborman/Temporary.java new file mode 100644 index 0000000..ac7c81e --- /dev/null +++ b/src/DiagramBomborman/Temporary.java @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public interface Temporary extends GameObject { + int getBornTime(); + int getFinishTime(); +} diff --git a/src/DiagramBomborman/Ticable.java b/src/DiagramBomborman/Ticable.java new file mode 100644 index 0000000..09564d6 --- /dev/null +++ b/src/DiagramBomborman/Ticable.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package DiagramBomborman; + +/** + * + * @author User + */ +public interface Ticable { + void tick(); +} diff --git a/src/MachineLearning/AbstractModel.java b/src/MachineLearning/AbstractModel.java new file mode 100644 index 0000000..c0eea74 --- /dev/null +++ b/src/MachineLearning/AbstractModel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class AbstractModel { + +} diff --git a/src/MachineLearning/Boosting.java b/src/MachineLearning/Boosting.java new file mode 100644 index 0000000..62c8bc0 --- /dev/null +++ b/src/MachineLearning/Boosting.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class Boosting extends AbstractModel{ + +} diff --git a/src/MachineLearning/KNeighbourhood.java b/src/MachineLearning/KNeighbourhood.java new file mode 100644 index 0000000..cda8a9f --- /dev/null +++ b/src/MachineLearning/KNeighbourhood.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class KNeighbourhood extends AbstractModel{ + +} diff --git a/src/MachineLearning/LinearKernel.java b/src/MachineLearning/LinearKernel.java new file mode 100644 index 0000000..c510ca9 --- /dev/null +++ b/src/MachineLearning/LinearKernel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class LinearKernel extends KNeighbourhood{ + +} diff --git a/src/MachineLearning/LogisticRegression.java b/src/MachineLearning/LogisticRegression.java new file mode 100644 index 0000000..6abe76b --- /dev/null +++ b/src/MachineLearning/LogisticRegression.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class LogisticRegression extends AbstractModel{ + +} diff --git a/src/MachineLearning/NaiveBayes.java b/src/MachineLearning/NaiveBayes.java new file mode 100644 index 0000000..3ffb1c4 --- /dev/null +++ b/src/MachineLearning/NaiveBayes.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class NaiveBayes extends AbstractModel{ + +} diff --git a/src/MachineLearning/NormalKernel.java b/src/MachineLearning/NormalKernel.java new file mode 100644 index 0000000..61f78d1 --- /dev/null +++ b/src/MachineLearning/NormalKernel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning; + +/** + * + * @author User + */ +public class NormalKernel extends KNeighbourhood{ + +} diff --git a/src/ru/caf82/lectures/lecture02/MathService.java b/src/ru/caf82/lectures/lecture02/MathService.java index aa3855a..ff9a6d9 100644 --- a/src/ru/caf82/lectures/lecture02/MathService.java +++ b/src/ru/caf82/lectures/lecture02/MathService.java @@ -30,13 +30,16 @@ public static double sigmoid(double[] x, double[] w){ } public static double[][] MatrixNormalize(double [][] x){ double SS=0; + double DD=0; int j=0; for(int i=0;i Date: Wed, 20 Sep 2017 19:43:29 +0300 Subject: [PATCH 06/29] Try1 --- src/DiagramBomborman/GameObject.java | 16 ---- src/DiagramBomborman/GameSession.java | 17 ---- src/DiagramBomborman/Movable.java | 14 ---- src/DiagramBomborman/Positionable.java | 15 ---- src/DiagramBomborman/Temporary.java | 15 ---- src/DiagramBomborman/Ticable.java | 14 ---- .../{ => Model}/AbstractModel.java | 0 src/MachineLearning/{ => Model}/Boosting.java | 0 .../{ => Model}/KNeighbourhood.java | 0 .../{ => Model}/LinearKernel.java | 0 .../{ => Model}/LogisticRegression.java | 0 .../{ => Model}/NaiveBayes.java | 0 .../{ => Model}/NormalKernel.java | 0 .../lectures/lecture03/AbstractAnimal.java | 20 ----- .../lecture03/CompositionExample.java | 83 ------------------- .../lecture03/InheritanceExample.java | 39 --------- .../lectures/lecture03/InterfaceExample.java | 17 ---- .../caf82/lectures/lecture03/PassByValue.java | 51 ------------ .../lecture03/PolymorphysmExample.java | 34 -------- src/ru/caf82/lectures/lecture03/Season.java | 52 ------------ 20 files changed, 387 deletions(-) delete mode 100644 src/DiagramBomborman/GameObject.java delete mode 100644 src/DiagramBomborman/GameSession.java delete mode 100644 src/DiagramBomborman/Movable.java delete mode 100644 src/DiagramBomborman/Positionable.java delete mode 100644 src/DiagramBomborman/Temporary.java delete mode 100644 src/DiagramBomborman/Ticable.java rename src/MachineLearning/{ => Model}/AbstractModel.java (100%) rename src/MachineLearning/{ => Model}/Boosting.java (100%) rename src/MachineLearning/{ => Model}/KNeighbourhood.java (100%) rename src/MachineLearning/{ => Model}/LinearKernel.java (100%) rename src/MachineLearning/{ => Model}/LogisticRegression.java (100%) rename src/MachineLearning/{ => Model}/NaiveBayes.java (100%) rename src/MachineLearning/{ => Model}/NormalKernel.java (100%) delete mode 100644 src/ru/caf82/lectures/lecture03/AbstractAnimal.java delete mode 100644 src/ru/caf82/lectures/lecture03/CompositionExample.java delete mode 100644 src/ru/caf82/lectures/lecture03/InheritanceExample.java delete mode 100644 src/ru/caf82/lectures/lecture03/InterfaceExample.java delete mode 100644 src/ru/caf82/lectures/lecture03/PassByValue.java delete mode 100644 src/ru/caf82/lectures/lecture03/PolymorphysmExample.java delete mode 100644 src/ru/caf82/lectures/lecture03/Season.java diff --git a/src/DiagramBomborman/GameObject.java b/src/DiagramBomborman/GameObject.java deleted file mode 100644 index 8f4fc29..0000000 --- a/src/DiagramBomborman/GameObject.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public interface GameObject{ - void start(); - void end(); -} - diff --git a/src/DiagramBomborman/GameSession.java b/src/DiagramBomborman/GameSession.java deleted file mode 100644 index 7d72af5..0000000 --- a/src/DiagramBomborman/GameSession.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public class GameSession implements Ticable{ - @Override - public void tick(){ - System.out.println("ff"); - }; -} diff --git a/src/DiagramBomborman/Movable.java b/src/DiagramBomborman/Movable.java deleted file mode 100644 index a0f8357..0000000 --- a/src/DiagramBomborman/Movable.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public interface Movable extends Positionable, Ticable{ - void move(); -} diff --git a/src/DiagramBomborman/Positionable.java b/src/DiagramBomborman/Positionable.java deleted file mode 100644 index 5b266de..0000000 --- a/src/DiagramBomborman/Positionable.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public interface Positionable extends GameObject { - int getXPositon(); - int getYPosution(); -} diff --git a/src/DiagramBomborman/Temporary.java b/src/DiagramBomborman/Temporary.java deleted file mode 100644 index ac7c81e..0000000 --- a/src/DiagramBomborman/Temporary.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public interface Temporary extends GameObject { - int getBornTime(); - int getFinishTime(); -} diff --git a/src/DiagramBomborman/Ticable.java b/src/DiagramBomborman/Ticable.java deleted file mode 100644 index 09564d6..0000000 --- a/src/DiagramBomborman/Ticable.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package DiagramBomborman; - -/** - * - * @author User - */ -public interface Ticable { - void tick(); -} diff --git a/src/MachineLearning/AbstractModel.java b/src/MachineLearning/Model/AbstractModel.java similarity index 100% rename from src/MachineLearning/AbstractModel.java rename to src/MachineLearning/Model/AbstractModel.java diff --git a/src/MachineLearning/Boosting.java b/src/MachineLearning/Model/Boosting.java similarity index 100% rename from src/MachineLearning/Boosting.java rename to src/MachineLearning/Model/Boosting.java diff --git a/src/MachineLearning/KNeighbourhood.java b/src/MachineLearning/Model/KNeighbourhood.java similarity index 100% rename from src/MachineLearning/KNeighbourhood.java rename to src/MachineLearning/Model/KNeighbourhood.java diff --git a/src/MachineLearning/LinearKernel.java b/src/MachineLearning/Model/LinearKernel.java similarity index 100% rename from src/MachineLearning/LinearKernel.java rename to src/MachineLearning/Model/LinearKernel.java diff --git a/src/MachineLearning/LogisticRegression.java b/src/MachineLearning/Model/LogisticRegression.java similarity index 100% rename from src/MachineLearning/LogisticRegression.java rename to src/MachineLearning/Model/LogisticRegression.java diff --git a/src/MachineLearning/NaiveBayes.java b/src/MachineLearning/Model/NaiveBayes.java similarity index 100% rename from src/MachineLearning/NaiveBayes.java rename to src/MachineLearning/Model/NaiveBayes.java diff --git a/src/MachineLearning/NormalKernel.java b/src/MachineLearning/Model/NormalKernel.java similarity index 100% rename from src/MachineLearning/NormalKernel.java rename to src/MachineLearning/Model/NormalKernel.java diff --git a/src/ru/caf82/lectures/lecture03/AbstractAnimal.java b/src/ru/caf82/lectures/lecture03/AbstractAnimal.java deleted file mode 100644 index 3034cf2..0000000 --- a/src/ru/caf82/lectures/lecture03/AbstractAnimal.java +++ /dev/null @@ -1,20 +0,0 @@ -package ru.caf82.lectures.lecture03; - -/** - * Created by ilysko on 16.09.17. - */ -public abstract class AbstractAnimal { - final int legsAmount; - final String animalName; - - public abstract void move(); - - public void sayYourName() { - System.out.println("My name is " + animalName); - } - - protected AbstractAnimal(int legsAmount, String animalName) { - this.legsAmount = legsAmount; - this.animalName = animalName; - } -} diff --git a/src/ru/caf82/lectures/lecture03/CompositionExample.java b/src/ru/caf82/lectures/lecture03/CompositionExample.java deleted file mode 100644 index 8ee40d5..0000000 --- a/src/ru/caf82/lectures/lecture03/CompositionExample.java +++ /dev/null @@ -1,83 +0,0 @@ -package ru.caf82.lectures.lecture03; - -import java.lang.reflect.Array; -import java.util.Arrays; -import java.util.function.DoublePredicate; - -/** - * Created by ilysko on 17.09.17. - */ -public class CompositionExample { - Cat cat = new Cat(); // в точке определения - Dog dog; - Crocodile crocodile; - Zoo zoo = new Zoo(new Animal[] {cat, dog, crocodile}); // с использованием инициализации экземпляров - - CompositionExample(Dog dog) { - this.dog = dog; // в конструкторе - } - - @Override - public String toString() { - if (crocodile == null) { - this.crocodile = new Crocodile(); // перед использованием объекта - } - return "CompositionExample{" + - "cat=" + cat + - ", dog=" + dog + - ", crocodile=" + crocodile + - ", zoo=" + zoo + - '}'; - } - - public static void main(String[] args) { - Dog dog = new Dog(true); - CompositionExample compositionExample = new CompositionExample(dog); - - System.out.println(compositionExample.toString()); - - compositionExample.crocodile.eatMeat(); - compositionExample.cat.sayMeow(); - System.out.println(compositionExample.dog.isFriendly); - System.out.println(Arrays.toString(compositionExample.zoo.animals)); - } -} - -abstract class Animal {} - -class Cat extends Animal { - int legCount = 4; - void sayMeow() { - System.out.println("Meow"); - } -} - -class Dog extends Animal { - boolean isFriendly; - - Dog(boolean isFriendly) { - this.isFriendly = isFriendly; - } -} - -class Crocodile extends Animal { - void eatMeat() { - System.out.println("Delicious!"); - } -} - -class Zoo { - Animal[] animals; - - Zoo(Animal[] animals) { - this.animals = animals; - } - - void open() { - System.out.println("open"); - } - - void close() { - System.out.println("close"); - } -} diff --git a/src/ru/caf82/lectures/lecture03/InheritanceExample.java b/src/ru/caf82/lectures/lecture03/InheritanceExample.java deleted file mode 100644 index c6b207a..0000000 --- a/src/ru/caf82/lectures/lecture03/InheritanceExample.java +++ /dev/null @@ -1,39 +0,0 @@ -package ru.caf82.lectures.lecture03; - -/** - * Created by ilysko on 17.09.17. - */ -public class InheritanceExample { - void tryToGetAnimalName(AbstractAnimal abstractAnimal) { - // нисходящее преобразование - abstractAnimal.sayYourName(); - - // нельзя, т.к. мы работаем с AbstractAnimal - //abstractAnimal.jump() - } - - public static void main(String[] args) { - AbstractAnimal tiger = new Tiger(); - tiger.move(); - tiger.sayYourName(); - System.out.println(tiger.legsAmount); - } -} - -class Tiger extends AbstractAnimal { - - protected Tiger() { - super(4, "Tiger"); - } - - @Override - public void move() { - System.out.println("run"); - } - - public void jump() { - System.out.println("jump"); - } -} - - diff --git a/src/ru/caf82/lectures/lecture03/InterfaceExample.java b/src/ru/caf82/lectures/lecture03/InterfaceExample.java deleted file mode 100644 index 4517fbe..0000000 --- a/src/ru/caf82/lectures/lecture03/InterfaceExample.java +++ /dev/null @@ -1,17 +0,0 @@ -package ru.caf82.lectures.lecture03; - -/** - * Created by ilysko on 17.09.17. - */ -public interface InterfaceExample { - default void printSomething() { - System.out.println("Something"); - } - - String returnName(); - - // можно не писать static final, это "по умолчанию" - static final int amount1 = 3; - int amount2 = 4; - -} diff --git a/src/ru/caf82/lectures/lecture03/PassByValue.java b/src/ru/caf82/lectures/lecture03/PassByValue.java deleted file mode 100644 index 1e07dae..0000000 --- a/src/ru/caf82/lectures/lecture03/PassByValue.java +++ /dev/null @@ -1,51 +0,0 @@ -package ru.caf82.lectures.lecture03; - -import java.util.Arrays; - -/** - * Created by ilysko on 17.09.17. - */ -public class PassByValue { - static void changePrimitiveInt(int a) { - a++; - } - - static void changeReferenceInteger(Integer a) { - a++; - } - - static void replaceReferenceInteger(Integer a) { - a = new Integer(42); - } - - static void changeStringArray(String[] listOfBands) { - listOfBands[2] = "Guns N' Roses"; - } - - static void doSomethingBad(String[] listOfBands) { - listOfBands = new String[]{"Justin Bieber", "Тимати"}; - } - - public static void main(String[] args) { - int a1 = 2; - - changePrimitiveInt(a1); - System.out.println("int primitive after changePrimitiveInt() : " + a1); - - Integer a2 = new Integer(2); - - changeReferenceInteger(a2); - System.out.println("Integer object after changeReferenceInteger() : " + a2); - - replaceReferenceInteger(a2); - System.out.println("Integer object after replaceReferenceInteger() : " + a2); - - String[] listOfBands = {"Led Zeppelin", "Pink Floyd", ""}; - - changeStringArray(listOfBands); - System.out.println("String[] after changeStringArray() : " + Arrays.toString(listOfBands)); - - doSomethingBad(listOfBands); - System.out.println("String[] after something bad : " + Arrays.toString(listOfBands)); - } -} diff --git a/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java b/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java deleted file mode 100644 index 0661fb8..0000000 --- a/src/ru/caf82/lectures/lecture03/PolymorphysmExample.java +++ /dev/null @@ -1,34 +0,0 @@ -package ru.caf82.lectures.lecture03; - -/** - * Created by ilysko on 17.09.17. - */ -public class PolymorphysmExample { - static void wash(Washable washable) { - System.out.println("cleaning " + washable.toString()); - } - - public static void main(String[] args) { - Kitty kitty = new Kitty(); - Dishware dishware = new Dishware(); - - wash(kitty); - wash(dishware); - } -} - -interface Washable{} - -class Kitty implements Washable { - @Override - public String toString() { - return "Kitty"; - } -} - -class Dishware implements Washable { - @Override - public String toString() { - return "Dishware"; - } -} \ No newline at end of file diff --git a/src/ru/caf82/lectures/lecture03/Season.java b/src/ru/caf82/lectures/lecture03/Season.java deleted file mode 100644 index bd6c131..0000000 --- a/src/ru/caf82/lectures/lecture03/Season.java +++ /dev/null @@ -1,52 +0,0 @@ -package ru.caf82.lectures.lecture03; - -import java.io.Serializable; -import java.util.Arrays; - -/** - * Created by ilysko on 16.09.17. - */ -public enum Season { - WINTER ("Зима"), - SPRING ("Весна"), - SUMMER ("Лето"), - AUTUMN ("Осень"); - - private String russianName; - Season(String russianName) { - this.russianName = russianName; - } - - public String getRussianName() { - return russianName; - } - - public static void printMonthsOfSeason(Season season) { - switch (season) { - case WINTER: - System.out.println("December, January and February"); - break; - case AUTUMN: - System.out.println("September, October and November"); - break; - case SUMMER: - System.out.println("June, July and August"); - break; - case SPRING: - System.out.println("April, March and May"); - break; - } - } - - public static void main(String[] args) { - Season season = Season.AUTUMN; - System.out.println(season); - - // get all enum values - System.out.println(Arrays.toString(Season.values())); - - printMonthsOfSeason(season); - - System.out.println(season.getRussianName()); - } -} From 1421ad2a512909691a0e31ba4d0e2b562f1d6a26 Mon Sep 17 00:00:00 2001 From: ilysko Date: Sun, 24 Sep 2017 13:10:22 +0300 Subject: [PATCH 07/29] Examples for lecture04. --- .../lecture04/ExceptionCatchingExample.class | Bin 0 -> 1144 bytes .../ExceptionCatchingIhExample.class | Bin 0 -> 1094 bytes .../lecture04/MyExceptionClassExample.class | Bin 0 -> 1255 bytes .../lecture04/StackTraceExample.class | Bin 0 -> 1247 bytes .../TemplateForMyExceptionClass.class | Bin 0 -> 674 bytes .../lecture04/ThrowExample$NegException.class | Bin 0 -> 583 bytes .../lectures/lecture04/ThrowExample.class | Bin 0 -> 1658 bytes .../lecture04/WorkWithExceptions.class | Bin 0 -> 1296 bytes nbproject/private/private.xml | 5 ++ .../lecture04/ExceptionCatchingExample.java | 21 +++++++ .../lecture04/ExceptionCatchingIhExample.java | 24 ++++++++ .../lecture04/MyExceptionClassExample.java | 52 ++++++++++++++++++ .../lectures/lecture04/StackTraceExample.java | 32 +++++++++++ .../lectures/lecture04/ThrowExample.java | 51 +++++++++++++++++ .../lecture04/WorkWithExceptions.java | 36 ++++++++++++ 15 files changed, 221 insertions(+) create mode 100644 build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/MyExceptionClassExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/ThrowExample.class create mode 100644 build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class create mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java create mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java create mode 100644 src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java create mode 100644 src/ru/caf82/lectures/lecture04/StackTraceExample.java create mode 100644 src/ru/caf82/lectures/lecture04/ThrowExample.java create mode 100644 src/ru/caf82/lectures/lecture04/WorkWithExceptions.java diff --git a/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class b/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class new file mode 100644 index 0000000000000000000000000000000000000000..0a918cfc52f2f55a3fbba0a1dc7486779c1fc1e9 GIT binary patch literal 1144 zcmbVLOHUI~6#i~IblPEBpg?^f()w&cJBSrfPy+-KNl}xUZd_f)u?)_mnNAHZ-MRB0 zn7DEaEGi+9AHZt*hm7a8&=&2=CcXDOzI)F1&AIpV_wfmU0-h@vLMDbAxT)Y4Zp*k6 z#a&@$6-dZMF|A+*_eA8rjC>TDfGWzj`6Z? zZyVklzHLz?S#))7mAPjM|12o^J7$exzUb98oxfk4(=0>x>z+|NH)adk`kro7ebaT; zxUcV+PGx^e zN@X%Vh&JgB*R#3bi;=ijA*!Q&Ix)mcKG#2N@#>i_rR3H<-PkaN^2tt_zXaq3XBER3 zkuj&@Aqp}cshGzC9qQ`o!6BU+_eUMHP?nguc)gx4DcZ70Y-k z5;Uo)ZtcEm>4OH}gI~c(a2V{TsliF}bMtF(oM9;Z&!8BFyB%L`@6w1bgi4=kzG2f1 za_f{BZx6$CwbwL9pQdSWn}#&ns&O&QAXf#*qDvrUUx<;9XM2X(a}}b#+x8g7vbldT z42dquqU%%`VpZlDtK1GW0|6JY^SD8wU9-4kS`D3&HUGla;K7>(pC5Th01D;THg nY=ZnNxJpd5mNn5*v5IS$B*b<4t912bNJ&}-la!sJSP1Dq9JC$} literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class b/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class new file mode 100644 index 0000000000000000000000000000000000000000..a50980c3529274b3eefa86b5cd98f84f2a236595 GIT binary patch literal 1094 zcmbVLO-~b16g{sko#}L-$d}*JB47dOAR?j|Hv|$$L6a&QSC4TlgPoaXIyJb%7!!B= z0~1%QOaucG68ZyNz4=4N`&ytSuyT@_ckj9Po_lWYn?HY#Y5=A%tDznJ38axxF`(ft z1~m*}SiwCNS!s@Fh+|a2n2P%f#uelk;?Hc?4xTeavm>hvu{rOp#gNL|uC-Ei)-3-O zUn>#PmG?|uTIIei{Sz=2tlJfanY>>$O#W_W(kNMGQ1z|KsWCBS%x{`jIj}u-rTYr&Qi_n*;R5T27-b#x%5z|b*)2Qt}R4!BbM-Bsmks zFe<)WM49^)t6}$MTUK|v`lZvM&vP*-WyxHk zI}^(;$s2NMIpJ#HHOLrxvLhE;AOoF#82Lm%5|N^BCwT^)jLx>v-(b7-@D=*T>tGaJ zWb2Itbfbs71bWd&h%EkrDA57AJw&>qhlm}ZZ3hE+=_&_M=^Q&if~+0rbu>x#ZoMW+ zBH~n=#2_@{kzI$09mJfZ4jqJ~sQ*>!n<0OYx(`wBaYCf3G}ScX*GSC}RKl;5$_4{FU@$`86^BAL{0oMm;_?|oa?igI3}Y4B6GxGI zE`n2j?$Al5;#awI#sgdJ+lNWnutSEeN)TC9UVF7}Iif0~K!mr8wN2~rYX7n-n$q^Y zJ%@+k{v~&tj@Y3dY7FT&wr9&-hRI^(1OLb^hkJFald+?kVpKmj&`S*$4^&95H~T~e zwpWi+Gp-0jUKi!aagJ+my}Ah0EZs`&SOU4+_89WT_kVk1Wq44hS+fJ&q~wVo1yxbD zl~l8LOuVY9YItE{9UCT0+|#gWVhhtIMloh0-!cQzwyRJImtKt@$tVSP6K_}z1dW}Tv8~FlO`ijIghCb7A0{6)p^jB6PGPE*V zp~&I^?SNbdvq2tJB2~IZvL7&tBn5T>sWyOK!T`VxQvHAo0kU@hCaA6&WS4qX-KI+` zH%Rvr@?4)J$pS8xmdKD2AxYG<7rs9kV@5qr)^} zsg)x1$OiSNb$Km~=cvCz4=dearK!e4V(55;xi)K?`crD_bZMF4Yv}#B1q@@cM=+h> N^OV5wm}~+IzX2Jt<@Nvo literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class b/build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class new file mode 100644 index 0000000000000000000000000000000000000000..98a7e659fcf383669deacb72ae3eea955422eb31 GIT binary patch literal 1247 zcmb7EO-~b16g{sUI_)sE$VZXV0xD<=!XTm|UoH&B#DXRzMC0mFhBDYrn_+5j?;p{P zYg_=)1o!?De}#D7P-w9x#!2RV+&S;wbMATVk6&L;0L-ft8;cRY0KzmZ%vIP=($FGK3E)5VEx~%KM zfQz=qOSaz>CNPrC{p(0enZkQ|SD}T~I*T>zajMo!_LpfrTUKb#V3Sv~)XEtJnnwn! zw!c%|T9Xy_xi_0@x9YsXmval~HC3rhhx@Yar*a#(&O09Gj|1p{P*!p5;?CkMRCN3Z z;(&_~u5ye7!3es!HqQX)K`(bv(DD-}OX1~A`V$5w zGBfkq7jz70hlm_P{}2|RPk$Z+38PFELO3XwVnHCrh{3UwwwuUuo?dIO*b-BHbh0kEe%g$ Ngsv%;H#mlH^EZuQ0J#7F literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class b/build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class new file mode 100644 index 0000000000000000000000000000000000000000..8e9a99f346aaf61f1cee89926d25ca72eb1d79fc GIT binary patch literal 674 zcmbV}O;5r=5Qg97qg6yv6vU5%M}&kLAW?(iLf}-rK)5e;g__cmeklGdPb41v0sbiC zY(XGZFK)6kv)h?x-r0V9zP$se<0OS7a?<3bIaEQ-LkmnH5hV5{gFR$&Eob@>-w%~4;xa5Iu@SChhgU*2@HkxvL!UE zWK@$|gRZ_Zq`FSv8lq#$kxrv>+EY$aMMd^YLxC#Iwlv2Km;aoRVSlB6sUBy3S67mct0G$~W& uDy8xau_&QJO|_7apJ%NRc903F3U+^E#iOh$v1)&?_K+n8Jqsy`;ou8i-i#pt literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class b/build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class new file mode 100644 index 0000000000000000000000000000000000000000..2afbf2d988a2a84d70f5f1591332add0986ba7ed GIT binary patch literal 583 zcmbV~%}&BV6otZ3Z&<>lu2VE!jLPt@p6>K2$0nt2x*8l(j literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/ThrowExample.class b/build/classes/ru/caf82/lectures/lecture04/ThrowExample.class new file mode 100644 index 0000000000000000000000000000000000000000..22536fcda8541a96102c6aabd4d28bac5c8dd8d7 GIT binary patch literal 1658 zcma)6O-~zF6g_V|X6%U}#t@f4X-)G{n?jtVq)8hZ@*%2PxM?LKT2v|0*co6_f6(zb zrOhTy)DJ0b~k6;})PWj4Iy z+;dcqU^0_QWdwx9zglwwz4M-x|K>AmwcWt%5N8{`XgM4pp8Ps{*Scq=3sz}4J@2_r zY5B6^uGwn>Z+Gooa~*G`XnRh+149BA56$*uw{oo1Eq9qb1`g;iV9uATZr=XHQEK&f z4}C_ljbH$S0;7A(4`3%SE1&s~6aFulSV<3Ev`{%@)o`Cd5evFsaE;I@3KNIZ}=|5sU89VSRgF=!KLu;T;v z{aLOv+G@MwKPG81ulql;gfw5r&cJj8ALB{{!x%9z6Twwn6BuiDmAkSbU&?}l9JSAmrL;~-WeuN$nWUghPD_B zY(n21d8)kNVytHq#_sS);ZNoSnz(U(a1^=@1APb~M!Yw1q}eCl!lFOQ9HQbaT6`I4 z>(Kgo8Bw(we?iub;T`UhhgfU#xc?VIpXqnFu&C-n>d4b4t=*sTS(q5m{ z-r9#X)P)sk+I_^`ATe;n z5TnEc98RGOvU&*T7@ejZGu*jK`9GySN1?KmC;YSf(G@#8H%bKJHdqj literal 0 HcmV?d00001 diff --git a/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class b/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class new file mode 100644 index 0000000000000000000000000000000000000000..6b0beaccc639034d16f139a15b16931b288cfd1b GIT binary patch literal 1296 zcmaJfBgoqjAaW?Fk-;Akikd}qZl(WZs9d1EadUV z#H5KS1Jf2P%ovz8FelKx;)lNaD9|-Ey)BSkjcQV$r{aflvsvGh@i%8LV5C@yTqoFe zVqfpu!L0K9hQLB4ZkAnV|NUY)kgjURvT?ImST65G@zIX2ytPwT9xFcz8y`sPAB0iN zy4G!2Am=*D_12|65PbS8ht7AW95~@YIn5*bNmV)S(S~!})?q0xj!r&#(y0kdxUqDU z+>|FNWXJOZsdf0_ftIorFwd$+&DfQnc_c7+U*){!&f_V11p5A?!@%1-=1~@SQHg>% z+qYe(dEhDASN37Ep=^&nMhz_F@eYf5^y@+^JJPQCwQy3|Dn7GSL=Y|8@}@bqAKFQ8 zrl#lZBwJV1#RQC6WH;){6IgnvG}ca?`f(t&nI(bwhoJZSAkcg3erxZL z6TTCwo;8%L^8!Up9<)d1N9C`vAF8V2FzOsx(!sl7`Z?A~K}g(G$E=Csq(0~iIn)_X zUGa$bJI@QRe~%#anE3AHuFS8{(V0t#b1pI{@ZH@CcB9C3K1o0yo^b~~8fIzmBEK4J zULmu4iLPs|JMm@*-fZIsn3E+c!|z}!W1o8+Dc)47{6x0+=mOp62?I=?ceS(?i3iP? zw2@d)05fuo4&iwVQ*1Mqct$_#MvLJ^%6Z7W<}A!y!1#fDi_%Ofv(SKqa)4da z#$JdGHP5~u4 m0EQ`Gi~>eTXH&o^<&1ZTD5Ty?_eB(_J88Ye_PpXcgW-Q0KmqUo literal 0 HcmV?d00001 diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 4750962..ba3008f 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -1,4 +1,9 @@ + + + file:/home/ilysko/Desktop/WorkLearn/Coding/Java/JavaTeachingInMiphyaga/TextClassifierProject/src/ru/caf82/lectures/lecture02/StringProcessing.java + + diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java new file mode 100644 index 0000000..8456e7c --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java @@ -0,0 +1,21 @@ +package ru.caf82.lectures.lecture04; + + +public class ExceptionCatchingExample { + + public static void main(String[] args) { + try { + System.out.println(6 / 0); + } catch (ArithmeticException ex) { + System.out.println("Ошибка! Ошибка!"); + System.out.println(ex.toString()); + } + + try { + System.out.println(Long.parseLong("Mama")); + } catch (NumberFormatException ex) { + System.out.println("Снова косяк!"); + System.out.println(ex.toString()); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java new file mode 100644 index 0000000..c4dfc32 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java @@ -0,0 +1,24 @@ +package ru.caf82.lectures.lecture04; + +public class ExceptionCatchingIhExample { + + public static void main(String[] args) { +// try { +// System.out.println(6 / 0); +// } catch (Exception ex) { +// System.out.println("Ошибка верхнего увроня"); +// } catch (ArithmeticException ex) { +// System.out.println("Ошибка! Ошибка!"); +// System.out.println(ex.toString()); +// } + + try { + System.out.println(Long.parseLong("Mama")); + } catch (NumberFormatException ex) { + System.out.println("Снова косяк!"); + System.out.println(ex.toString()); + } catch (Exception ex) { + System.out.println("Ошибка верхнего уровня"); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java b/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java new file mode 100644 index 0000000..b741e17 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java @@ -0,0 +1,52 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class MyExceptionClassExample extends TemplateForMyExceptionClass { + int amountOfSmth; + + void someMethod() { + System.out.println(amountOfSmth); + } + + void f() { + someMethod(); + } + + public MyExceptionClassExample() { + super(); + } + + public MyExceptionClassExample(Exception e) { + super(e); + } + + public MyExceptionClassExample(int amountOfSmth) { + super(); + this.amountOfSmth = amountOfSmth; + } + + public MyExceptionClassExample(String messageFullOfAnger) { + super(messageFullOfAnger); + } + + public static void main(String[] args) { + System.out.println("let's throw an exception!"); +// throw new MyExceptionClassExample("lol"); + } +} + +class TemplateForMyExceptionClass extends Exception { + TemplateForMyExceptionClass() { + super(); + } + + TemplateForMyExceptionClass(String message) { + super(message); + } + + TemplateForMyExceptionClass(Exception e) { + super(e); + } +} diff --git a/src/ru/caf82/lectures/lecture04/StackTraceExample.java b/src/ru/caf82/lectures/lecture04/StackTraceExample.java new file mode 100644 index 0000000..96b7f71 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/StackTraceExample.java @@ -0,0 +1,32 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class StackTraceExample { + static void f() { + try { + throw new Exception(); + } catch (Exception e) { + for (StackTraceElement ste : e.getStackTrace()) { + System.out.println(ste.getMethodName()); + } + } + } + + static void g() { + f(); + } + + static void h() { + g(); + } + + public static void main(String[] args) { + f(); + System.out.println("---------------"); + g(); + System.out.println("---------------"); + h(); + } +} diff --git a/src/ru/caf82/lectures/lecture04/ThrowExample.java b/src/ru/caf82/lectures/lecture04/ThrowExample.java new file mode 100644 index 0000000..8c3a31a --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ThrowExample.java @@ -0,0 +1,51 @@ +package ru.caf82.lectures.lecture04; + +public class ThrowExample { + + public static int divide(int a, int b) throws ArithmeticException, NegException { + if (b == 0) { + throw new ArithmeticException("Ты че как лох-то, на нуль делить нельзя"); + } else if( b < 0) { + throw new NegException("Мы решили, что на отрицательные числа делить нельзя"); + } + return a / b; + } + + public static void main(String[] args) { + try { + System.out.println(divide(5, 2)); + System.out.println(divide(5, 0)); + } catch (ArithmeticException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (Exception ex) { + // + } + try { + System.out.println(divide(5, 2)); + System.out.println(divide(5, -1)); + } catch (NegException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (Exception ex) { + // + } + try { + System.out.println(divide(5, -1)); + System.out.println(divide(5, 0)); + } catch (ArithmeticException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (NegException ex) { + System.out.println("Отрицательное деление"); + } + + } + + + public static class NegException extends Exception { + NegException(){ + super(); + } + NegException(String message) { + super(message); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java b/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java new file mode 100644 index 0000000..0791ab8 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java @@ -0,0 +1,36 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class WorkWithExceptions { + void ignore() throws Exception { + throw new Exception(); + } + + void catchHere() { + try { + throw new Exception(); + } catch (Exception e) { + System.out.println("Lol, i caught it just here!"); + } + } + + void throwAhead() { + try { + ignore(); + } catch (Exception e) { + System.out.println("We didn't try to catch exception in ignore(). " + + "We did it here"); + } + } + + void createNewExceptionWhileWorkingWithOld() throws MyExceptionClassExample { + try { + ignore(); + } catch (Exception e) { + System.out.println("do smth"); + throw new MyExceptionClassExample(e); + } + } +} From fde366e4533b4d2c1be12394269c64bc1f0d1fd5 Mon Sep 17 00:00:00 2001 From: SychDan Date: Mon, 25 Sep 2017 09:30:27 +0300 Subject: [PATCH 08/29] Just --- .../diagramBomberman/GameObject.class | Bin 175 -> 0 bytes .../diagramBomberman/GameSession.class | Bin 670 -> 0 bytes .../lectures/diagramBomberman/Movable.class | Bin 258 -> 0 bytes .../diagramBomberman/Positioanable.class | Bin 247 -> 0 bytes .../lectures/diagramBomberman/Temporary.class | Bin 239 -> 0 bytes .../lectures/diagramBomberman/Tickable.class | Bin 153 -> 0 bytes .../lectures/lecture02/BoxingExample.class | Bin 1298 -> 0 bytes .../lecture02/BreakAndContinueExample.class | Bin 1211 -> 0 bytes .../lecture02/CalculatorExample.class | Bin 1100 -> 0 bytes .../lectures/lecture02/CommentsExample.class | Bin 623 -> 0 bytes .../ConstructorExample$Rectangular.class | Bin 603 -> 0 bytes .../lecture02/ConstructorExample.class | Bin 562 -> 0 bytes .../lecture02/ForAndForEachExample.class | Bin 1055 -> 0 bytes .../IfElseAndSwitchCaseExample.class | Bin 883 -> 0 bytes .../caf82/lectures/lecture02/LinkTypes.class | Bin 1578 -> 0 bytes .../lectures/lecture02/OperatorsExample.class | Bin 3404 -> 0 bytes .../lectures/lecture02/PrimitiveTypes.class | Bin 1166 -> 0 bytes .../lectures/lecture02/StringProcessing.class | Bin 1627 -> 0 bytes .../lecture02/WhileAndDoWhileExample.class | Bin 941 -> 0 bytes nbproject/private/private.xml | 10 +-- .../main/java/ru/caf82/result/Other/DAO.java | 14 ++++ .../caf82/result/Other/DAOImplementation.java | 14 ++++ .../Other/ModelSelectionHibernateEntity.java | 14 ++++ .../result/Other/ReviewHibernateEntity.java | 14 ++++ .../ru/caf82/result/Other/SwingModel.java | 14 ++++ .../ru/caf82/result/Other/SwingTraining.java | 14 ++++ .../ru/caf82/result/WorkFiles/FileReader.java | 14 ++++ .../ru/caf82/result/WorkFiles/FileWorker.java | 14 ++++ .../ru/caf82/result/WorkFiles/FileWriter.java | 14 ++++ .../machinelearning}/Model/AbstractModel.java | 2 +- .../machinelearning}/Model/Boosting.java | 2 +- .../Model/KNeighbourhood.java | 2 +- .../machinelearning}/Model/LinearKernel.java | 2 +- .../Model/LogisticRegression.java | 2 +- .../machinelearning}/Model/NaiveBayes.java | 2 +- .../machinelearning}/Model/NormalKernel.java | 2 +- .../preprocessing/CountVectorizer.java | 13 ++- .../preprocessing/PorterStemmer.java | 13 ++- .../preprocessing/SequenceProcessor.java | 11 ++- .../preprocessing/TfldfVectorizer.java | 14 ++++ .../preprocessing/Transformer.java | 11 ++- .../preprocessing/WordProcessor.java | 11 ++- .../result/workwithfiles/FileReader.java | 7 -- .../result/workwithfiles/FileWorker.java | 7 -- .../result/workwithfiles/FileWriter.java | 7 -- .../workwithfiles/OperatorsExample.class | Bin 3060 -> 0 bytes .../lectures/diagramBomberman/GameObject.java | 9 --- .../diagramBomberman/GameSession.java | 11 --- .../lectures/diagramBomberman/Movable.java | 8 -- .../diagramBomberman/Positioanable.java | 9 --- .../lectures/diagramBomberman/Temporary.java | 9 --- .../lectures/diagramBomberman/Tickable.java | 8 -- .../lectures/lecture02/BoxingExample.java | 26 ------ .../lecture02/BreakAndContinueExample.java | 44 ---------- .../lectures/lecture02/CalculatorExample.java | 35 -------- .../lectures/lecture02/CommentsExample.java | 18 ----- .../lecture02/ConstructorExample.java | 15 ---- .../lecture02/ForAndForEachExample.java | 17 ---- .../lecture02/IfElseAndSwitchCaseExample.java | 32 -------- .../caf82/lectures/lecture02/LinkTypes.java | 32 -------- .../caf82/lectures/lecture02/MathService.java | 76 ------------------ .../lectures/lecture02/OperatorsExample.java | 58 ------------- .../lectures/lecture02/PrimitiveTypes.java | 43 ---------- .../lectures/lecture02/StringProcessing.java | 39 --------- .../lecture02/WhileAndDoWhileExample.java | 20 ----- 65 files changed, 195 insertions(+), 558 deletions(-) delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Movable.class delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Temporary.class delete mode 100644 build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/BoxingExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/BreakAndContinueExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/CommentsExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/ConstructorExample$Rectangular.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/ForAndForEachExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/LinkTypes.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/OperatorsExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/PrimitiveTypes.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/StringProcessing.class delete mode 100644 build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class create mode 100644 result/src/main/java/ru/caf82/result/Other/DAO.java create mode 100644 result/src/main/java/ru/caf82/result/Other/DAOImplementation.java create mode 100644 result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java create mode 100644 result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java create mode 100644 result/src/main/java/ru/caf82/result/Other/SwingModel.java create mode 100644 result/src/main/java/ru/caf82/result/Other/SwingTraining.java create mode 100644 result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java create mode 100644 result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java create mode 100644 result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/AbstractModel.java (88%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/Boosting.java (89%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/KNeighbourhood.java (89%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/LinearKernel.java (89%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/LogisticRegression.java (89%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/NaiveBayes.java (89%) rename {src/MachineLearning => result/src/main/java/ru/caf82/result/machinelearning}/Model/NormalKernel.java (89%) create mode 100644 result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java delete mode 100644 result/src/main/java/ru/caf82/result/workwithfiles/FileReader.java delete mode 100644 result/src/main/java/ru/caf82/result/workwithfiles/FileWorker.java delete mode 100644 result/src/main/java/ru/caf82/result/workwithfiles/FileWriter.java delete mode 100644 result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class delete mode 100644 src/ru/caf82/lectures/diagramBomberman/GameObject.java delete mode 100644 src/ru/caf82/lectures/diagramBomberman/GameSession.java delete mode 100644 src/ru/caf82/lectures/diagramBomberman/Movable.java delete mode 100644 src/ru/caf82/lectures/diagramBomberman/Positioanable.java delete mode 100644 src/ru/caf82/lectures/diagramBomberman/Temporary.java delete mode 100644 src/ru/caf82/lectures/diagramBomberman/Tickable.java delete mode 100644 src/ru/caf82/lectures/lecture02/BoxingExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/CalculatorExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/CommentsExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/ConstructorExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/ForAndForEachExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/LinkTypes.java delete mode 100644 src/ru/caf82/lectures/lecture02/MathService.java delete mode 100644 src/ru/caf82/lectures/lecture02/OperatorsExample.java delete mode 100644 src/ru/caf82/lectures/lecture02/PrimitiveTypes.java delete mode 100644 src/ru/caf82/lectures/lecture02/StringProcessing.java delete mode 100644 src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class b/build/classes/ru/caf82/lectures/diagramBomberman/GameObject.class deleted file mode 100644 index b15820a79fe8fa65b0985fc92843bb2b0834deaf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 175 zcmYL@F%H5o6hr+>+dvmM1`H4hF)%a0$biKD8`6?0X{9vfa10!PLm^TzFj=zoY`;Ix z7l0iKfvLcZkoAFmAWW94D{s%unp}xoorwn}#1uSo=XLuJ&7L yqd9op%bVfavpaOI)ZTF`{}5p@V$yP3%U@4UASCe$kfd=PDG)UqH75D!Lwo^u$tm{$ diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class b/build/classes/ru/caf82/lectures/diagramBomberman/GameSession.class deleted file mode 100644 index 1bf0a8c217f6d0a17c69898067f775a257e140ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 670 zcmb7?O;6iE5Qg6k2~LblA$+!!LdYedQe0I?AO#^oCAe4xDN*hlXB!smU9?_D>d%5h zD{)@WYQp zXj3B+eC`jK`uUl0<6Nr8-uI*9=W<#vLW>P;ixWdO9_s2*gB0$4Y6- zEs2T099;1U_am;x{`o{0BS(T5?o@v&v;Gze{7xqKP({tbriZWCVyI*V8xFQTG_b?a zd0)#^pwPqcipFI4_8*Ksm7Q*|0O+8s*unZGE%0$d7FfGW8KNbLo(ki!`kb6}lp2}{rG%AGX; diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Movable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Movable.class deleted file mode 100644 index bf8113d6e6afb160f287f4f73309612bd7c72c49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 258 zcma)%O$x#=5QX2=YP44H82*3}apBs9J5f;FPivIaq=9IAI2RtkLy0MP0C_MB!}l?~ z_viTnu*5*1Cy)sA1yVw6U9AYM(fCA24zBXK+GrC_>DJYp88s`oX2Qf*GUv-`A&tr( zl~;Fp)_nDB*Uo0jTQ23#APgHv8ZNJLmlc60%>VHB?yeu&aoPMOO#e`hI=?k^hd_uz ST8KkWiV1CWnhhe%2;DCMsYllU diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Positioanable.class deleted file mode 100644 index dca9d1bae49417d31903f6eb64f1eb486e043968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 247 zcma)%F$%&!5Jmqa(P&H|o=ND~@tG%lO8G zxv53W*VRJgGOlVPOL0j#Fas zz21)}fCYL29f7VuM2J#V#<{b5Z4{v~8gB@F&sN&%;{2uEU0%6Ft#sxqgS|4>+_AgQ zE_`Fc#8ook({e5|m6VlJg*<9b9h*2e2jvV~`Ev-v+L9UDRBjI!ZxE(`EUek6Z$Bgu W0)GwvOwc4W(E@yib$Tvpj`j!9DL>x; diff --git a/build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class b/build/classes/ru/caf82/lectures/diagramBomberman/Tickable.class deleted file mode 100644 index 839dc93e31cdc28094766613eb4f2c6da028a150..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 153 zcmXwyu?oU46h-f=u~9+rGZevqI5<1FIw(Y zfE}h1Qer|7y)$>hXt}x)X6G(NV~@^T!u*mS*4}O!ellSllQLZGx5``7r)VGQ=D3a= m4qebT25!|~AuI+-d2VZU(oGgh0-?xpfJ6>L41{ss0_6{oCM9nG diff --git a/build/classes/ru/caf82/lectures/lecture02/BoxingExample.class b/build/classes/ru/caf82/lectures/lecture02/BoxingExample.class deleted file mode 100644 index dd79ebc6b44eb593d18efcf99216083575969db5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1298 zcma)6O-~b16g{sqo!6EkP@sw*Ao$e+Ww4?W@gu>Akd#7FLI`dg>QDx!Ee=yae}h{W z#+4gbxzGg~7ybZ$i9f=KXQmZeJ`7Fs-o5AEd)_yu|z6iQ;C5)@M z7C{fLd+Ci35?+#&=$9A}(C%9$%Y7)IB$D$2>f`bYQ=lbdmCS6VxMVtW#*$4WmMP~A zd){y?FRy{ByJD>i3}l>&o;Q|9)4FZu-HKzb{|koG`gnQEDixk=8O1f*9ODs1!zu~H z6VEcM#)hHWMya6ZT!&3#{uK8tT$k(8!RlQqpj_=AB^kDb>WH_i&o|s$$rDy3R!1 z3DwJvB^M9j`!9}Og!pUqJ^}Cr(8M*$Oy@4R2m8N5eD=%DTs0q5aE5WT+JF|cG7F;( zF(Momzo9@9+i6XILm=a?)Bc+M0%ahz4XN%xRd%6z`QV{EwTs}t(ta4zb|Kr8UnIPz z*7jg+*T~YPc4>_~M1n^UvedY}ay9YfDe&Zt`%*N@loS%8pa}ZtNt)RMc1%+2EQKzx z@*M40K_}iIj<-0A_c(`bbotgyR^_v!gRB}pvM=tN^MRdldL6?%_Q!ed0%kZBhf2n$ zIL|0Z-bc8=NW(?We?n-Fe;=yEC5i6p7eb=Sc!X(4Ue{jJN+i!e*d5uUsU|M{%;pi2*Bg-X6Tb(V# z(ryq{4iTpF3eg$j)v9imXyWuj<`AQeNhmItKIF_F7aw-4`lT?mrVj^F#e|3cARvZd zRlp;>NA;uYl{|mhq^BFDH!MCM=^9hY&mE^dCs9E+T%_=r z2!4VdJVP&@qYp39k5}{$ct^gE6tjZ?kIPX6=>l@-L>F;5j=_fX05epri+mOe4IA+a q6-mN$idHY8d+@R7F1q(1vF6TQ1oseOLP>;oks_T+c2lSir+)*Ygc1Az diff --git a/build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class b/build/classes/ru/caf82/lectures/lecture02/CalculatorExample.class deleted file mode 100644 index cba620985334d41b688a5d85e530e11a5f1b5ef1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1100 zcmb7D*>2N76g`v0PF#0ONJ{Bmwj`x>DWOy<>PtnXN)aFhRa88nNos;CC#f78wLj3W zK}eu35=eXiAB8w$8xo*AAZupsGCud5d+l%EKYs;K#fE_)+{z+_+iJU`3DoSr(Ak(t_deG?k0?AUD47D)O4&5EzZcC>lP%OQw9m;poa%HDw)qT(D zv^GQT(rb}T{)#kTCi|v{GZc z+w5gNMEX4}pdYDAF8h@#?UeVhz>i>vUrmA!m4z0?@zl7;7y{$8_L)zrNaYfuGIfqb zW%?Y+j|?S{aC6)j2PDriGEX>zqgmimk{3ftH-7-&{jEm; diff --git a/build/classes/ru/caf82/lectures/lecture02/CommentsExample.class b/build/classes/ru/caf82/lectures/lecture02/CommentsExample.class deleted file mode 100644 index 6b318099591f63f3ffbcf58b4d148f3fcc8ff462..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 623 zcmb7BT`vPc6g|^cw_QcG>ic7PQG^wdkPt7zgKUsgym*?fQB%7+&F-x5vv?r!;0O3o z;_kNMBVNqIy>rjK_sl(a-riqc0c>KyL>?nW)G%7Wn2B*r7??CL#gN~Xfz*2p+4|Bs zLvCMP3Wgy^2I4sOn<6~pO^=X@qg?Kt^H3&n56tOn88NInVQjnnYJ0=>gsbCFM4y-S z4SQetz6f-5aL4_QCwAx&pUZ$@w0_~V`7O6S9<=O+4rS2VNr&KJi)gEVq#4YHibGc% z%4DjMU*u~EUkL^Z2Bu4x!7Rh9BlKcqc}m?_T3K#y97_h)5mg(QE5X7%!^%HYFqFSW zKWVl}_7A9WA8Fy!R#i-iT34r3_9=h!Cn@r1L$&%}3&K45=s%N_ z0hOabwn&jpo{{fceg=C;(;km6t{={K*=!6 zwM>75UOyNmahmBo%o2U_B<2rF9&_&?ilb~u*l!nY-klKaQF0>*wQ&^7^L##)`dUmC zXX@i56lx-LWbjYYHbM#2OBN^MyIcuP@Xq2`>X8y@D*16xP)6$y8PDThCAkjeX=Fq+ z|Bu|AiAUjK31trsnhv%IN5!`G_eX+n2m{6A1Q*j84@M}p&1$;ESh2%*wfV&4`$nFL z*c>dguP_?IVguaH-V3Pn3hSAX1($u9YrtJq_Koi%<0D FKwlXko%a9$ diff --git a/build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class b/build/classes/ru/caf82/lectures/lecture02/ConstructorExample.class deleted file mode 100644 index 29425b95b7792019b4de53c72b1e5a80abe3d3ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 562 zcmb7BO-lnY5Pj3HwcBd7)z+)vp(=Ds@gP>b6a`^Xu+odCbd5D-o0aUY__sU>9{d6R zC~>kX7V4#e%w*o=y}TqJpKtE~4zcYbk4*<#4w?>HgvzxH5}_w)C=8)`p|v!FP{gr} z38fRIRdPzmxA#Vb!XUbngqp9kyi8|fX>PBQk4`C*( z-1w(WaEDQ90(q{ivDTt~$4XY=V1>|G&KhC;&(GC(%GV(rFQ>6P_ukk+j=#f>9LQSY zSmw&(Oq`4Rub`K#?Q$$-U>+4-SHCxKUgfHcHPjff7$dGzAO>hmoXqTf&fe?nv-aBa_4lV^01xmeiWo*aFotmx6H$aQ z8o?dqCzZLYOe%^rrj(gBkufnNU@SYXvMoJF?azXmzwa~zvNt=GIKZkcvXmiE`)$ZEY} zFY%_TbX5XVzj^eP;4 zyd9x!jN%&qTJ?m$@u7>hn>&kM(Cbr25Fc9U9$KRnG;p2k*eL+L=;N*f{fINd!-5kc z5(u>AMC1@-9})VDaPbIQuik`_Xu@nF(nQBQA>N;SXS#`~`6XHmYx$z4=Zm_LFB)b( zH@%rTUI{N~ac$%f=}cUkUC=KTi?iZ+HI3E2DY9WGvXdkQL}1b<=_lE1hO}4N=N3D4 z>3t$qGgG7-!UP5|$R@UMv$fKh32*~L^sAU>G{NjJcekMZLP-3?_z5-CO^leh#h1O~ M2d0U-O;iZUKRWg7w*UYD diff --git a/build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class b/build/classes/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.class deleted file mode 100644 index ff3a1929b6a0d91cd56fc57899129ec559360c53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 883 zcmbVKTT2^36#gc+*{q4$tcljOCiZ4j=oTp=RfJa3BE$=%NWrJcW)fHT5;nVD{!L3C z3VmxITIfT6Kz~l3OX-0$_9bfLnUR#E5MB62#)C_Fl9*WRW@d(UB z$IgIZy&1-qExPNgmMiTj4&~s=dAe%tbQ|tKzVJJ(b0@Nox5Yp3~Yy?*ouUGx-0r4Zh9+-LtDOb z6#MGGNjy>S7NBE{<52;RvB;2bT-efer5|zB3s}N31K$gxT3d8Tsh8@`ybb~~YyY=8 z!{qh8`|T5w?FQ7k97NKiw}O}w<)JuEU>%S$5$Pj^N9q~LjGHhq?W-b}WG&ZkQxyx) z=*LiB3QTQIcYz{{EF+s;{s#6rNf+tPC14KY#9Iod%>H%?Gbkv`Dx6lBlQ@&YAm$a$8t*xU1*4x=ct_!a z#6^jB1)S4<)o+{;NMaXcuRk&bAhg|=1Pso zuddFv)9YxJgd;uN0z#WIy5i_4b5*!jxK??Un_);<)=^vD6&NTrbmjJPrNaJOU3)q*uARw9jaTo5AO@?ezA;&rXQ?$Q5r=o zvWiR^OSqE8ReV70xIiMG7f?D=Z(mkm_(cMfkk|p%o|&7=u=vb8S&H~jV9XdFf4%YZ z#{G>48^1ntmax1v;w~e4fn)o@|1_j+m0c;{;ygKzcCmh#yUIy5I4@7HZ3C9>)Egd6 z$*@WISUjZdcuwEZwVGGukfyWUW1Q?Vby~_m)d=H9A~2fm1`;7_rm}!Y~iJtcnikuU|JaI z9 z|2s_b?N|!_0U%s3=*P zW%moErgpW9)mlB2D|FSedT#a9L+?HI*lMjFqko^7fk6&dv(~@&zxVgw_x|^ppZ@;# zdjNOhQw(r!{L|^@F9-FN_Q2xqo2~PWEqYlN_Un8$0Wy5j$<5C98Yi@SMj8V zhw+pcp5{2g@eIdFj%PWZ<2c3fJjV+hFLJ!Z@iNCN9ItY`rs8!5rNc^DP8Wk5Y1qx+ z>rIcC3}yXR%G@?F7B}rdBc7z4P=9*ZNbWXlORRI7K4-r*&d}0tPeg}}(e~D8(j0as zY;!!%tZt2N&zQF1r0wy|M~tyd(%eX1#tbXPP!-wRf513oM3Y7;5gl-BE0x&jMq$_q zvRmN+Gcbdwk0?$wOq3wnLNrP=LPXKBJwzFzO++@4L)1fbkZ6)Yimwqvs~FlCN(LNb z`0=eq#?4E`CKYd}m}bxh(i8Tuxy2GC2w$H`iwHh|4cMsS%>drQX@=^%ZOhp|W;zy? zOHb!>-w?nVoF(}Be0wIWy3nV>ckp) z)D$Ckx!t0gp5_xq7}4cT$>~vP^L#KIxbZx>%`rFM#*)0fmv< zJ)RZv-)iQ}e@N%0?KG2yW2I9IQlt81D2`UWvs1TS9~D}U|KgN3Yipx&p*b z&9jf@Sl^@z%608@_`&%~ZI2(IYZbsnd=$XP_=LgVoE0sa)H^zaXQ~VFU0pd|6MTMA zq4lQ|*Bu8#aeR$FHKoV1%3@VtpI=pIgQmTxl6+@6nWQU9zLWtcoiZs(|DbJ(xo8L7 zXh-jJ2$Xl4bPfGINxD-EtNu@K(4BYFw$jlZ)C~^xglUW|C`PtT7H&l(&5UM$;}x*4T)2})#ogrSB0i86z+LF3 zRT1t+5ABe$@)>;$LV*0^*N{T;417VYL+SK)h5YTlkkam_?eCxtT>%dj%|Khe;<4J1 z85GYTK(Ym334ygM_Ip94La#RI1(gw0?W^{uW)Pe+87e2!YE1FP)B*<~5)CUS73O89 z!UesMN0G~`&BFBU8~2dae@E;|n%4xaNk{d{TGxMJrJ@D>ZT zl5JnCyufgq&?rAgop$FX_(N-Hxv1bVSB9L2)(M&RIT_LSGDP2hfkqlN>g!^ZQRi2q zg#LGyVmqx4Ac#}c@2{Z()2PI0gz+`1@H0vMjvA)mCRT@K>>kvz?O4Hva5FmroxOM1cYw1YDS-!w)7Yz0D|TW40X8kQ zV34>Hc7`(8MO>-89G_q}>6THv7x5r*L5j2w4-r?6A%Go6$t>#xSFwjNCP|F``Kj2e zLY<|!3%BL$Hk+jkwRv$_E>u_u%&D+zC@WMUSA~w`8=~++=S-u{3ogjP!|}ZGDg+nB iRZs!?H{k*2)Kxq@OP?<};5WPxD;za2ESWa=_(Ucfh5s+c)_*pTP0KRSM=oH&3e8Wh|JAcLCGlKd9Sq)*ohB)8tGaTFF% zR%B3~tUD897RQNk+YH)f$Tq`m(}<&c8ZsaOSD`;KqA0hUv?HIM&0v%|g zAFu;(49#45(SqYdm@GcPg)p)GI%lpwTr&`XoXT-qBB z^#&uTO@|tTFJqwxX_YB4wTe1vy|!%(RuTSt(go{`UO4$1De&_RpcWw#r1G3~I7{L> zNnM(x4e``j#@{0sGh}0d5f5N+N~~65tM8( z<0P#UyUdG|O9k(ld4^Zx$6Mx~gM%}?K`SvAMzPFV3EoMT9oy(BoM47E&%nc;?YMvr l-peMsagm;%GqiH%B)e^~eiyM2=V`(vdMf*MvwICL{{qns;(!1E diff --git a/build/classes/ru/caf82/lectures/lecture02/StringProcessing.class b/build/classes/ru/caf82/lectures/lecture02/StringProcessing.class deleted file mode 100644 index 7585d1c9381e5b61ea0075dcc22d25afd47747aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1627 zcmb7E-E$LF6#w0P?Ka)okhYW-l=z*}w1J3-Ev=9$5(%MNELQy5q_@pNnq+o2FnyFa zWn_jKp2YFR8DI3Fb%w1&wY>9m_aAaRCmW!Wj-$!UIp?19JKraH^w)zO0LLNYIE0*r zH*_42BZN15Z~|{>I2lI_IUR2^pJK~2OQ)F3#4(F^bev}O876rhbIfOSysP6q7SA$y zpUF8L1?C?xIj^Cp;etTylvTIfS%GkRY*8RG*I1SU{Y9%TORcrCv@e;`Ov?Y-zo|A@IhA79pHk`pm!>x8*^?r}hI;7V;ySx9RRKp8RAqTV9v8Lzh3gN3$ImUc^EAlj2VZf`1D{57R44 zTo8{Q*@D_p9=w8ANkh(}gfJliZyTYdWOxga;%|sTwv>eVjGVn8Xgk6Ao~JHl33uL9Jr7iENLeqoGmf9g`uhF zNHpVN|4_uk@B|5$$$up3ft>or!^s04Mp#8vv^5?^cRinWn@57W&=IHaYv@HDeJG$G z68lg^64x+*ItHyD~?~0#u&}2iV}`s hoJM~Q=aC^PO!3ZP0+WbP)EQdC7@~wcN`4_6`x}mUqt5^U diff --git a/build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class b/build/classes/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.class deleted file mode 100644 index d5a3e548679addaf23a8064fbae4021c199ad1d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 941 zcmb7CTWb?R6#gbjca!b5jY-q0+f?gyTWzQ zD5h~%>2pe)SK@+7U({jiSZ2^Rr6{ z-8v7X@<+i`xGQ@MGcZa24#QL} - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/NaiveBayes.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/Boosting.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/NormalKernel.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/LogisticRegression.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/LinearKernel.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/KNeighbourhood.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/MachineLearning/AbstractModel.java - + diff --git a/result/src/main/java/ru/caf82/result/Other/DAO.java b/result/src/main/java/ru/caf82/result/Other/DAO.java new file mode 100644 index 0000000..d33b691 --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/DAO.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public interface DAO { + +} diff --git a/result/src/main/java/ru/caf82/result/Other/DAOImplementation.java b/result/src/main/java/ru/caf82/result/Other/DAOImplementation.java new file mode 100644 index 0000000..623ce4b --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/DAOImplementation.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class DAOImplementation { + +} diff --git a/result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java b/result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java new file mode 100644 index 0000000..f4f56c0 --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class ModelSelectionHibernateEntity { + +} diff --git a/result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java b/result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java new file mode 100644 index 0000000..3409488 --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class ReviewHibernateEntity { + +} diff --git a/result/src/main/java/ru/caf82/result/Other/SwingModel.java b/result/src/main/java/ru/caf82/result/Other/SwingModel.java new file mode 100644 index 0000000..fea37dc --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/SwingModel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class SwingModel { + +} diff --git a/result/src/main/java/ru/caf82/result/Other/SwingTraining.java b/result/src/main/java/ru/caf82/result/Other/SwingTraining.java new file mode 100644 index 0000000..0809fe8 --- /dev/null +++ b/result/src/main/java/ru/caf82/result/Other/SwingTraining.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class SwingTraining { + +} diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java b/result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java new file mode 100644 index 0000000..2057d9a --- /dev/null +++ b/result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package WorkFiles; + +/** + * + * @author User + */ +public class FileReader implements FileWorker{ + +} diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java b/result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java new file mode 100644 index 0000000..9c053c7 --- /dev/null +++ b/result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package WorkFiles; + +/** + * + * @author User + */ +public interface FileWorker { + +} diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java b/result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java new file mode 100644 index 0000000..0242d4d --- /dev/null +++ b/result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package WorkFiles; + +/** + * + * @author User + */ +public class FileWriter implements FileWorker{ + +} diff --git a/src/MachineLearning/Model/AbstractModel.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/AbstractModel.java similarity index 88% rename from src/MachineLearning/Model/AbstractModel.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/AbstractModel.java index c0eea74..3482291 100644 --- a/src/MachineLearning/Model/AbstractModel.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/AbstractModel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/Boosting.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/Boosting.java similarity index 89% rename from src/MachineLearning/Model/Boosting.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/Boosting.java index 62c8bc0..7e45961 100644 --- a/src/MachineLearning/Model/Boosting.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/Boosting.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/KNeighbourhood.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/KNeighbourhood.java similarity index 89% rename from src/MachineLearning/Model/KNeighbourhood.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/KNeighbourhood.java index cda8a9f..e817831 100644 --- a/src/MachineLearning/Model/KNeighbourhood.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/KNeighbourhood.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/LinearKernel.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/LinearKernel.java similarity index 89% rename from src/MachineLearning/Model/LinearKernel.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/LinearKernel.java index c510ca9..0891ac2 100644 --- a/src/MachineLearning/Model/LinearKernel.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/LinearKernel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/LogisticRegression.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/LogisticRegression.java similarity index 89% rename from src/MachineLearning/Model/LogisticRegression.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/LogisticRegression.java index 6abe76b..69e6bf7 100644 --- a/src/MachineLearning/Model/LogisticRegression.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/LogisticRegression.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/NaiveBayes.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/NaiveBayes.java similarity index 89% rename from src/MachineLearning/Model/NaiveBayes.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/NaiveBayes.java index 3ffb1c4..ca3566d 100644 --- a/src/MachineLearning/Model/NaiveBayes.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/NaiveBayes.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/src/MachineLearning/Model/NormalKernel.java b/result/src/main/java/ru/caf82/result/machinelearning/Model/NormalKernel.java similarity index 89% rename from src/MachineLearning/Model/NormalKernel.java rename to result/src/main/java/ru/caf82/result/machinelearning/Model/NormalKernel.java index 61f78d1..15e5193 100644 --- a/src/MachineLearning/Model/NormalKernel.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/Model/NormalKernel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning; +package MachineLearning.Model; /** * diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java index 7038ad8..3b330e8 100644 --- a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java @@ -1,7 +1,14 @@ -package ru.caf82.result.machinelearning.preprocessing; +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; /** - * Created by ilysko on 03.08.17. + * + * @author User */ -public class CountVectorizer implements SequenceProcessor, Transformer { +public class COuntVectorizer implements SequenceProcessor, Transformer{ + } diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java index 02fcf81..b77851d 100644 --- a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java @@ -1,7 +1,14 @@ -package ru.caf82.result.machinelearning.preprocessing; +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; /** - * Created by ilysko on 03.08.17. + * + * @author User */ -public class PorterStemmer implements Transformer, WordProcessor { +public class PorterStemmer implements Transformer, WordProcessor{ + } diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java index 65e46d9..071b263 100644 --- a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java @@ -1,7 +1,14 @@ -package ru.caf82.result.machinelearning.preprocessing; +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; /** - * Created by ilysko on 03.08.17. + * + * @author User */ public interface SequenceProcessor { + } diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java new file mode 100644 index 0000000..53693ec --- /dev/null +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; + +/** + * + * @author User + */ +public class TfldfVectorizer implements Transformer { + +} diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java index b94b278..17bf461 100644 --- a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java @@ -1,7 +1,14 @@ -package ru.caf82.result.machinelearning.preprocessing; +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; /** - * Created by ilysko on 03.08.17. + * + * @author User */ public interface Transformer { + } diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java index db8ead1..d2b465c 100644 --- a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java +++ b/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java @@ -1,7 +1,14 @@ -package ru.caf82.result.machinelearning.preprocessing; +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package MachineLearning.Preprocessing; /** - * Created by ilysko on 03.08.17. + * + * @author User */ public interface WordProcessor { + } diff --git a/result/src/main/java/ru/caf82/result/workwithfiles/FileReader.java b/result/src/main/java/ru/caf82/result/workwithfiles/FileReader.java deleted file mode 100644 index 993dc1d..0000000 --- a/result/src/main/java/ru/caf82/result/workwithfiles/FileReader.java +++ /dev/null @@ -1,7 +0,0 @@ -package ru.caf82.result.workwithfiles; - -/** - * Created by ilysko on 03.08.17. - */ -public class FileReader implements FileWorker { -} diff --git a/result/src/main/java/ru/caf82/result/workwithfiles/FileWorker.java b/result/src/main/java/ru/caf82/result/workwithfiles/FileWorker.java deleted file mode 100644 index 9fe4f42..0000000 --- a/result/src/main/java/ru/caf82/result/workwithfiles/FileWorker.java +++ /dev/null @@ -1,7 +0,0 @@ -package ru.caf82.result.workwithfiles; - -/** - * Created by ilysko on 03.08.17. - */ -public interface FileWorker { -} diff --git a/result/src/main/java/ru/caf82/result/workwithfiles/FileWriter.java b/result/src/main/java/ru/caf82/result/workwithfiles/FileWriter.java deleted file mode 100644 index 3de089c..0000000 --- a/result/src/main/java/ru/caf82/result/workwithfiles/FileWriter.java +++ /dev/null @@ -1,7 +0,0 @@ -package ru.caf82.result.workwithfiles; - -/** - * Created by ilysko on 03.08.17. - */ -public class FileWriter implements FileWorker { -} diff --git a/result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class b/result/src/main/java/ru/caf82/result/workwithfiles/OperatorsExample.class deleted file mode 100644 index d68fd30a389271b32199e0cea0cdb0dad9a0109a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3060 zcma)8TTm276g|DOJJSpc>@F-21v5Ut<>e~q3i1d-)R3SUKoc}kXJNp_WoI1*6(z(N z6BF~cDzP-bsj@16F;!?KWs>hyzVea(eC9Kis(gmro_(;uV6s$o-|lnoxsSfx!_WVG z_XB{v_)J9vM~d(Q1~^_+@e&5Ty!*MaZ%rVR{!Z9jV zCpb=Wyu$G+#~8;c6{qnU$Lkzt1bmj`oZMSU?&v4?${B$}mwPiJIN}`R91|P{$0Wy; zg7Yd8m=?nYjwHtnM~cJbNON4|usCKpY>qjOOB|Ouu5ipNxXK`RB~l5yhe3)ooMiC! zn-c~@*V9}2^ah;*+ zpp~%C&lq-MTu*9d&f)-(`tcTSkjC05`sNbJ3BzLW>spgGuC-`!ty}ZsZQK;YJAS;2 zTMRs|H4@sbk*I4?M~TEK5+}3z?=b|`6Di%AFYrv2nrLcr?7S1sBsVo>gyKki-ZmOE zu~P89AGh%Vg^}G|%qaP`8d>@esfy~bk<{&knOc<{RWVI*v})bmn&tQ?SNjt7<;1M9 zDiUsM_1Z;8fy9Ls@l00q&O4w~*FMV-SgF)deA*bd=}i3i2p{|L2|i`;wPdu5=C!Ua z;haiCa!*fIR)w5fl&gd0)S5$KD30&Z78bO4##pTC>vOAeb=0ud6_XE}$t3j-`I1L$ zGi6YqzER5%bJ1~XHCr3736zG72}1gk)LabB)?9R4pKNc9CMl0O%b3jxyIZ4c`--95 zrB`X!sYk+$9;fEDsf7)FW>u9kUA=m1e%3ZfOETwdYT?WkSWVH%pri$3lCDWO;(kkH zJ)JgElu?VD!aAF5PZM=bWT4?GFt^QI)D@BSiVnfy_4_OQ!IdT%NZH1exJae8*_RL} zm!l551>ta?dK$MpX<9Qn)vd!N>B1w*v}fmfE>T;{NK+Hg15z33?{`tbR&>zoEPfs^ z@tn}uMXOqx8O^@NM_}KOz|c*j>}<*?LJyuJnN;bqYHltD!mis}D2KZa0(X_Vp?0`wIO;tt*W&ryztsK74>;}29a8C9$f z)$9m1u_0_`W2j*_u!Y@*#_nJ%`vTkO{%vQ!VF&vgb)H7ld(L8~=NclOyJ+xyi$>3{ zX!87tW+{MOQZ=H|7VMS|VULtVn`C3JbQ$}kFAkn<6#UQ z1$_$omqi{0+frtmEz`57uIx)vp}}e(Z^E9Stk8s96*`ihioy-eQ=`reF37>f@rrRX k0_)-`r~rMFUEr*_g6Eg%BjBcycmH1m^c^_l^v>ab0lWKy{r~^~ diff --git a/src/ru/caf82/lectures/diagramBomberman/GameObject.java b/src/ru/caf82/lectures/diagramBomberman/GameObject.java deleted file mode 100644 index 7006157..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/GameObject.java +++ /dev/null @@ -1,9 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public interface GameObject { - void start(); - void finish(); -} diff --git a/src/ru/caf82/lectures/diagramBomberman/GameSession.java b/src/ru/caf82/lectures/diagramBomberman/GameSession.java deleted file mode 100644 index 4877b8f..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/GameSession.java +++ /dev/null @@ -1,11 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public class GameSession implements Tickable { - @Override - public void tick() { - System.out.println("tick!"); - } -} diff --git a/src/ru/caf82/lectures/diagramBomberman/Movable.java b/src/ru/caf82/lectures/diagramBomberman/Movable.java deleted file mode 100644 index 6629aa9..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/Movable.java +++ /dev/null @@ -1,8 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public interface Movable extends Positioanable, Tickable{ - void move(); -} diff --git a/src/ru/caf82/lectures/diagramBomberman/Positioanable.java b/src/ru/caf82/lectures/diagramBomberman/Positioanable.java deleted file mode 100644 index 5b2a20e..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/Positioanable.java +++ /dev/null @@ -1,9 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public interface Positioanable extends GameObject { - int getXPosition(); - int getYPosition(); -} diff --git a/src/ru/caf82/lectures/diagramBomberman/Temporary.java b/src/ru/caf82/lectures/diagramBomberman/Temporary.java deleted file mode 100644 index e32ee17..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/Temporary.java +++ /dev/null @@ -1,9 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public interface Temporary extends GameObject { - int getBornTime(); - int getFinishTime(); -} diff --git a/src/ru/caf82/lectures/diagramBomberman/Tickable.java b/src/ru/caf82/lectures/diagramBomberman/Tickable.java deleted file mode 100644 index 8d51018..0000000 --- a/src/ru/caf82/lectures/diagramBomberman/Tickable.java +++ /dev/null @@ -1,8 +0,0 @@ -package ru.caf82.lectures.diagramBomberman; - -/** - * Created by ilysko on 18.09.17. - */ -public interface Tickable { - void tick(); -} diff --git a/src/ru/caf82/lectures/lecture02/BoxingExample.java b/src/ru/caf82/lectures/lecture02/BoxingExample.java deleted file mode 100644 index 1f64c70..0000000 --- a/src/ru/caf82/lectures/lecture02/BoxingExample.java +++ /dev/null @@ -1,26 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class BoxingExample { - - public static void main(String[] args) { - Integer i = Integer.valueOf(50); - Integer iTwo = Integer.valueOf(50); - Integer iThree = 50; - - System.out.println(i == iThree); - System.out.println(i == iTwo); - System.out.println(i.equals(iThree)); - System.out.println(i.equals(iTwo)); - - System.out.println("----------------------------------------"); - - Integer iNew = Integer.valueOf(1000); - Integer iNewTwo = Integer.valueOf(1000); - Integer iNewThree = 1000; - - System.out.println(iNew == iNewThree); - System.out.println(iNew == iNewTwo); - System.out.println(iNew.equals(iNewThree)); - System.out.println(iNew.equals(iNewTwo)); - } -} diff --git a/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java b/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java deleted file mode 100644 index ad6005e..0000000 --- a/src/ru/caf82/lectures/lecture02/BreakAndContinueExample.java +++ /dev/null @@ -1,44 +0,0 @@ -package ru.caf82.lectures.lecture02; - -/** - * Created by ilysko on 24.08.17. - */ -public class BreakAndContinueExample { - public static void main(String[] args) { - // Break example - for (int i = 0; i < 100; i++) { - if (i == 4) { - break; - } - System.out.print(i + " "); - } - - System.out.println(); - - // Continue example - for (int i = 0; i < 10; i++) { - if (i % 2 == 0) { - continue; - } - System.out.print(i + " "); - } - - System.out.println("\n"); - - // Continue and Break with "tags" - outer: - for (int i = 0; i < 10; i++) { - inner: - for (int j = 0; j < 10; j++) { - if (j > i) { - System.out.println(); - continue outer; - } - if (i == 8) { - break outer; - } - System.out.print(" " + (i * j)); - } - } - } -} diff --git a/src/ru/caf82/lectures/lecture02/CalculatorExample.java b/src/ru/caf82/lectures/lecture02/CalculatorExample.java deleted file mode 100644 index edfa955..0000000 --- a/src/ru/caf82/lectures/lecture02/CalculatorExample.java +++ /dev/null @@ -1,35 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class CalculatorExample { - private int x; - private int y; - - CalculatorExample(int x, int y) { - this.x = x; - this.y = y; - } - - public void setX(int x) { - this.x = x; - } - - public void setY(int y) { - this.y = y; - } - - public int getSubst() { - return x-y; - } - - public float getSum() { - return (float) x + y; - } - - public static void main(String[] args) { - CalculatorExample calc = new CalculatorExample(5, 2); - System.out.println(calc.getSum()); - System.out.println(calc.getSubst()); - - //todo create new calculator, add abs function from Math - } -} diff --git a/src/ru/caf82/lectures/lecture02/CommentsExample.java b/src/ru/caf82/lectures/lecture02/CommentsExample.java deleted file mode 100644 index 7923149..0000000 --- a/src/ru/caf82/lectures/lecture02/CommentsExample.java +++ /dev/null @@ -1,18 +0,0 @@ -package ru.caf82.lectures.lecture02; - -/** - * @author ilysko - * @version 1.0 - * Class for comment representation - */ -public class CommentsExample { - public static void main(String[] args) { - System.out.println("Let's look to comments in Java"); - /* - * Realy big - * comment - */ - - //System.out.println("Cool!"); - } -} diff --git a/src/ru/caf82/lectures/lecture02/ConstructorExample.java b/src/ru/caf82/lectures/lecture02/ConstructorExample.java deleted file mode 100644 index 81727c9..0000000 --- a/src/ru/caf82/lectures/lecture02/ConstructorExample.java +++ /dev/null @@ -1,15 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class ConstructorExample { - - public class Rectangular { - - //todo create fields weight and length, create constructor, create method Square - - } - - - public static void main(String[] args) { - //todo write some test - } -} diff --git a/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java b/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java deleted file mode 100644 index 31e25d5..0000000 --- a/src/ru/caf82/lectures/lecture02/ForAndForEachExample.java +++ /dev/null @@ -1,17 +0,0 @@ -package ru.caf82.lectures.lecture02; - -/** - * Created by ilysko on 24.08.17. - */ -public class ForAndForEachExample { - public static void main(String[] args) { - for (int i = 1; i < 5; i++) { - System.out.println("i = " + i); - } - System.out.println(); - int[] intList = {1,2,3,4}; - for (int i : intList) { - System.out.println("i = " + i); - } - } -} diff --git a/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java b/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java deleted file mode 100644 index 22f0f4a..0000000 --- a/src/ru/caf82/lectures/lecture02/IfElseAndSwitchCaseExample.java +++ /dev/null @@ -1,32 +0,0 @@ -package ru.caf82.lectures.lecture02; - -/** - * Created by ilysko on 24.08.17. - */ -public class IfElseAndSwitchCaseExample { - public static void main(String[] args) { - int myMark = 5; - - if (myMark == 5) { - System.out.println("Excellent"); - } else if (myMark <= 4 && myMark >=3) { - System.out.println("Not bad"); - } else { - System.out.println("Bad"); - } - - switch (myMark) { - case 5: - System.out.println("Excellent"); - break; - case 4: - System.out.println("Good"); - break; - case 2: - System.out.println("Bad"); - default: - System.out.println("Not bad"); - break; - } - } -} diff --git a/src/ru/caf82/lectures/lecture02/LinkTypes.java b/src/ru/caf82/lectures/lecture02/LinkTypes.java deleted file mode 100644 index d3c581c..0000000 --- a/src/ru/caf82/lectures/lecture02/LinkTypes.java +++ /dev/null @@ -1,32 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class LinkTypes { - - public static void main(String[] args) { - String a = "Hello", b = "World"; - - System.out.println(a + " " + b); - - String c = 2 + 2 + ""; - String d = "" + 2 + 2; - String g = "" + (2 + 2); - - System.out.println(c); - System.out.println(d); - System.out.println(g); - - String foo = "a string"; - String bar = "a string"; - String baz = new String("a string"); - - System.out.println("foo == bar ? " + (foo == bar)); - System.out.println("foo равен bar ? " + (foo.equals(bar))); - System.out.println("foo == baz ? " + (foo == baz)); - System.out.println("foo равен baz ? " + (foo.equals(baz))); - - - - } - - -} diff --git a/src/ru/caf82/lectures/lecture02/MathService.java b/src/ru/caf82/lectures/lecture02/MathService.java deleted file mode 100644 index ff9a6d9..0000000 --- a/src/ru/caf82/lectures/lecture02/MathService.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package ru.caf82.lectures.lecture02; - -import java.util.Arrays; -import java.util.Random; - - -/** - * - * @author User - */ -public class MathService { - public static double doProduct(double[] a, double[] b){ - double result=0; - for (int x=0;x> 2 = " + (y >> 2)); - System.out.println("y >>> 2 = " + (y >>> 2)); - System.out.println("y << 2 = " + Integer.toBinaryString(y << 2)); - System.out.println("y >> 2 = " + Integer.toBinaryString(y >> 2)); - System.out.println("y >>> 2 = " + Integer.toBinaryString(y >>> 2)); - - System.out.println("\nLogical operators:"); - boolean b1 = false, b2 = true; - System.out.println("b1 || b2 = " + (b1 || b2)); - System.out.println("b1 && b2 = " + (b1 && b2)); - - System.out.println("\nTernary operators:"); - boolean b3 = true; - System.out.println("Rolling " + (b3 ? "Stones" : "Trees")); - System.out.println("Paint It " + (!b3 ? "Red" : "Black")); - } -} diff --git a/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java b/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java deleted file mode 100644 index a5dcc37..0000000 --- a/src/ru/caf82/lectures/lecture02/PrimitiveTypes.java +++ /dev/null @@ -1,43 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class PrimitiveTypes { - - - public static void main(String[] args) { - - //byte b = 216; - short s = 1123; - int i = 64536; - long l = 2147483648L; - int j = 10; - - System.out.println(i); - //System.out.println(b); - System.out.println(s); - System.out.println(l); - - System.out.println(i + 2147483647); - System.out.println(l + j); - System.out.println(j + l); - - char a = 'a', c = 'c'; - int b; - b = ((a + c) / 2); - System.out.println(b); - System.out.println((char) b); - - System.out.println((char) b + i); - System.out.println(b+i); - - double doubleOne, doubleTwo = 4.12; - doubleOne = 22.1 + doubleTwo; - float pi = 3.14f; - //float anotherPi = 3.14; - double doubleThree = 27; - double d = pi * doubleThree; - - System.out.println(d); - System.out.println(doubleOne); - System.out.println(pi); - } -} diff --git a/src/ru/caf82/lectures/lecture02/StringProcessing.java b/src/ru/caf82/lectures/lecture02/StringProcessing.java deleted file mode 100644 index b51d9b5..0000000 --- a/src/ru/caf82/lectures/lecture02/StringProcessing.java +++ /dev/null @@ -1,39 +0,0 @@ -package ru.caf82.lectures.lecture02; - -public class StringProcessing { - - public static void main(String[] args) { - - //String Buffer examples - StringBuffer sb = new StringBuffer("Котэ"); - - System.out.println("Длина: " + sb.length()); - System.out.println("Объем: " + sb.capacity()); - - sb.setCharAt(1, 'o'); - - System.out.println("Было Котэ, стало: " + sb.toString()); - - String str1 = "У кота "; - String str2 = " лапы"; - int paws = 4; - StringBuffer sbNew = new StringBuffer(20); - sbNew.append(str1).append(paws).append(str2); - - System.out.println(sbNew.toString()); - - sb.insert(0, "Люблю "); - System.out.println(sb.toString()); - - sb.reverse(); - System.out.println(sb.toString()); - - //TODO delete, deleteCharAt, replace, substring write your own code - - - - //TODO StringBuilder the same methods implementation - - } - -} diff --git a/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java b/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java deleted file mode 100644 index d3fbb84..0000000 --- a/src/ru/caf82/lectures/lecture02/WhileAndDoWhileExample.java +++ /dev/null @@ -1,20 +0,0 @@ -package ru.caf82.lectures.lecture02; - -/** - * Created by ilysko on 24.08.17. - */ -public class WhileAndDoWhileExample { - public static void main(String[] args) { - int i = 3; - - while (i > 0) { - System.out.println(i--); - } - - System.out.println("\n" + i + "\n"); - - do { - System.out.println(i--); - } while (i > 0); - } -} From 7f6940846eaf0a922b12461d42e0a82392dc6470 Mon Sep 17 00:00:00 2001 From: SychDan Date: Fri, 29 Sep 2017 17:19:32 +0300 Subject: [PATCH 09/29] 4 --- .../lecture04/WorkWithExceptions.class | Bin 1296 -> 1473 bytes src/Exeptions/EmptyArrayException.java | 25 ++++ .../InconveninentShapeException.java | 25 ++++ src/Other/MathService.java | 112 ++++++++++++++++++ .../lecture04/WorkWithExceptions.java | 4 + 5 files changed, 166 insertions(+) create mode 100644 src/Exeptions/EmptyArrayException.java create mode 100644 src/Exeptions/InconveninentShapeException.java create mode 100644 src/Other/MathService.java diff --git a/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class b/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class index 6b0beaccc639034d16f139a15b16931b288cfd1b..aff5b381d4fa5cdcac7f01a57edff6ad21fb4dd1 100644 GIT binary patch delta 647 zcmZutOD_Xa7(I7pnA1dU*pdj(H1pNSH`k(2xkBA1R3e3uz2murVYt zERiuWV!=Yz#Hi{fR2efdezWkoXdHU^f`Hq@<@w7Xqj+uaJ2vCtV>W6hV84G%9QqQ~12~dRwxICfs7(VK+>CM?PR#sqTfNdh$ zAY0?v9BjDN(<0`->y25Z?Q#}^LwG)89nm delta 452 zcmZXPyH3ME6hvqJh&LN2cmp_zc{n@`2^dULLLDl48vX@|oherToj1`)QJ@geU#C5D;U1CFF6I%*Cwj~mY9S^$- z3Ih*A4|}u8hq)4o-NKx?6W!Xrj}!;yMf4koJ~ABnSmfwkT-I6`38b^@)ZAOQy2(hu zg#e|jfw{25MDwo3F0XA?zc{;?#{xU#UStc*jor)sc4cK(mb)Rh9jYz?GX-L$+RkAH9^^e;~IU#yw;{VGM`6`n1uegUoyC1n5r diff --git a/src/Exeptions/EmptyArrayException.java b/src/Exeptions/EmptyArrayException.java new file mode 100644 index 0000000..f84f9fd --- /dev/null +++ b/src/Exeptions/EmptyArrayException.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Exeptions; + +/** + * + * @author User + */ +public class EmptyArrayException extends Exception{ + public EmptyArrayException(){ + super(); + } + public EmptyArrayException(String message){ + super(message); + } + public EmptyArrayException(String message, Throwable cause){ + super(message,cause); + } + public EmptyArrayException(Throwable cause){ + super(cause); + } +} diff --git a/src/Exeptions/InconveninentShapeException.java b/src/Exeptions/InconveninentShapeException.java new file mode 100644 index 0000000..2a9f866 --- /dev/null +++ b/src/Exeptions/InconveninentShapeException.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Exeptions; + +/** + * + * @author User + */ +public class InconveninentShapeException extends Exception{ + public InconveninentShapeException(){ + super(); + } + public InconveninentShapeException(String message){ + super(message); + } + public InconveninentShapeException(String message, Throwable cause){ + super(message, cause); + } + public InconveninentShapeException(Throwable cause){ + super(cause); + } +} diff --git a/src/Other/MathService.java b/src/Other/MathService.java new file mode 100644 index 0000000..3ef475f --- /dev/null +++ b/src/Other/MathService.java @@ -0,0 +1,112 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; +import Exeptions.EmptyArrayException; +import Exeptions.InconveninentShapeException; +import java.util.Arrays; +import java.util.Random; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author User + */ +public class MathService { + public static double doProduct(double[] a, double[] b) throws InconveninentShapeException,EmptyArrayException{ + double result=0; + boolean TT=true; + if(a.length!=b.length) throw new InconveninentShapeException("DoProduct: разные размеры массивов!"); + if(a.length==0 & b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); + for (int x=0;x Date: Mon, 2 Oct 2017 16:42:45 +0300 Subject: [PATCH 10/29] LogReg --- {result/src/main/java/ru/caf82 => src}/result/Other/DAO.java | 0 .../java/ru/caf82 => src}/result/Other/DAOImplementation.java | 0 .../caf82 => src}/result/Other/ModelSelectionHibernateEntity.java | 0 .../java/ru/caf82 => src}/result/Other/ReviewHibernateEntity.java | 0 .../src/main/java/ru/caf82 => src}/result/Other/SwingModel.java | 0 .../main/java/ru/caf82 => src}/result/Other/SwingTraining.java | 0 .../main/java/ru/caf82 => src}/result/WorkFiles/FileReader.java | 0 .../main/java/ru/caf82 => src}/result/WorkFiles/FileWorker.java | 0 .../main/java/ru/caf82 => src}/result/WorkFiles/FileWriter.java | 0 .../caf82 => src}/result/machinelearning/Model/AbstractModel.java | 0 .../ru/caf82 => src}/result/machinelearning/Model/Boosting.java | 0 .../result/machinelearning/Model/KNeighbourhood.java | 0 .../caf82 => src}/result/machinelearning/Model/LinearKernel.java | 0 .../ru/caf82 => src}/result/machinelearning/Model/NaiveBayes.java | 0 .../caf82 => src}/result/machinelearning/Model/NormalKernel.java | 0 .../result/machinelearning/preprocessing/CountVectorizer.java | 0 .../result/machinelearning/preprocessing}/LogisticRegression.java | 0 .../result/machinelearning/preprocessing/PorterStemmer.java | 0 .../result/machinelearning/preprocessing/SequenceProcessor.java | 0 .../result/machinelearning/preprocessing/TfidfVectorizer.java | 0 .../result/machinelearning/preprocessing/TfldfVectorizer.java | 0 .../result/machinelearning/preprocessing/Transformer.java | 0 .../result/machinelearning/preprocessing/WordProcessor.java | 0 23 files changed, 0 insertions(+), 0 deletions(-) rename {result/src/main/java/ru/caf82 => src}/result/Other/DAO.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/Other/DAOImplementation.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/Other/ModelSelectionHibernateEntity.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/Other/ReviewHibernateEntity.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/Other/SwingModel.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/Other/SwingTraining.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/WorkFiles/FileReader.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/WorkFiles/FileWorker.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/WorkFiles/FileWriter.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/AbstractModel.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/Boosting.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/KNeighbourhood.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/LinearKernel.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/NaiveBayes.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/Model/NormalKernel.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/CountVectorizer.java (100%) rename {result/src/main/java/ru/caf82/result/machinelearning/Model => src/result/machinelearning/preprocessing}/LogisticRegression.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/PorterStemmer.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/SequenceProcessor.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/TfidfVectorizer.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/TfldfVectorizer.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/Transformer.java (100%) rename {result/src/main/java/ru/caf82 => src}/result/machinelearning/preprocessing/WordProcessor.java (100%) diff --git a/result/src/main/java/ru/caf82/result/Other/DAO.java b/src/result/Other/DAO.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/DAO.java rename to src/result/Other/DAO.java diff --git a/result/src/main/java/ru/caf82/result/Other/DAOImplementation.java b/src/result/Other/DAOImplementation.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/DAOImplementation.java rename to src/result/Other/DAOImplementation.java diff --git a/result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java b/src/result/Other/ModelSelectionHibernateEntity.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/ModelSelectionHibernateEntity.java rename to src/result/Other/ModelSelectionHibernateEntity.java diff --git a/result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java b/src/result/Other/ReviewHibernateEntity.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/ReviewHibernateEntity.java rename to src/result/Other/ReviewHibernateEntity.java diff --git a/result/src/main/java/ru/caf82/result/Other/SwingModel.java b/src/result/Other/SwingModel.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/SwingModel.java rename to src/result/Other/SwingModel.java diff --git a/result/src/main/java/ru/caf82/result/Other/SwingTraining.java b/src/result/Other/SwingTraining.java similarity index 100% rename from result/src/main/java/ru/caf82/result/Other/SwingTraining.java rename to src/result/Other/SwingTraining.java diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java b/src/result/WorkFiles/FileReader.java similarity index 100% rename from result/src/main/java/ru/caf82/result/WorkFiles/FileReader.java rename to src/result/WorkFiles/FileReader.java diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java b/src/result/WorkFiles/FileWorker.java similarity index 100% rename from result/src/main/java/ru/caf82/result/WorkFiles/FileWorker.java rename to src/result/WorkFiles/FileWorker.java diff --git a/result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java b/src/result/WorkFiles/FileWriter.java similarity index 100% rename from result/src/main/java/ru/caf82/result/WorkFiles/FileWriter.java rename to src/result/WorkFiles/FileWriter.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/AbstractModel.java b/src/result/machinelearning/Model/AbstractModel.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/AbstractModel.java rename to src/result/machinelearning/Model/AbstractModel.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/Boosting.java b/src/result/machinelearning/Model/Boosting.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/Boosting.java rename to src/result/machinelearning/Model/Boosting.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/KNeighbourhood.java b/src/result/machinelearning/Model/KNeighbourhood.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/KNeighbourhood.java rename to src/result/machinelearning/Model/KNeighbourhood.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/LinearKernel.java b/src/result/machinelearning/Model/LinearKernel.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/LinearKernel.java rename to src/result/machinelearning/Model/LinearKernel.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/NaiveBayes.java b/src/result/machinelearning/Model/NaiveBayes.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/NaiveBayes.java rename to src/result/machinelearning/Model/NaiveBayes.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/NormalKernel.java b/src/result/machinelearning/Model/NormalKernel.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/NormalKernel.java rename to src/result/machinelearning/Model/NormalKernel.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java b/src/result/machinelearning/preprocessing/CountVectorizer.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/CountVectorizer.java rename to src/result/machinelearning/preprocessing/CountVectorizer.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/Model/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/Model/LogisticRegression.java rename to src/result/machinelearning/preprocessing/LogisticRegression.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java b/src/result/machinelearning/preprocessing/PorterStemmer.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/PorterStemmer.java rename to src/result/machinelearning/preprocessing/PorterStemmer.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java b/src/result/machinelearning/preprocessing/SequenceProcessor.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/SequenceProcessor.java rename to src/result/machinelearning/preprocessing/SequenceProcessor.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfidfVectorizer.java b/src/result/machinelearning/preprocessing/TfidfVectorizer.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfidfVectorizer.java rename to src/result/machinelearning/preprocessing/TfidfVectorizer.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java b/src/result/machinelearning/preprocessing/TfldfVectorizer.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/TfldfVectorizer.java rename to src/result/machinelearning/preprocessing/TfldfVectorizer.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java b/src/result/machinelearning/preprocessing/Transformer.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/Transformer.java rename to src/result/machinelearning/preprocessing/Transformer.java diff --git a/result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java b/src/result/machinelearning/preprocessing/WordProcessor.java similarity index 100% rename from result/src/main/java/ru/caf82/result/machinelearning/preprocessing/WordProcessor.java rename to src/result/machinelearning/preprocessing/WordProcessor.java From c07f48adefaa08ea8ebf546f1d51958199a00663 Mon Sep 17 00:00:00 2001 From: SychDan Date: Mon, 2 Oct 2017 16:53:06 +0300 Subject: [PATCH 11/29] LogReg --- nbproject/private/private.xml | 7 +- .../preprocessing/LogisticRegression.java | 141 +++++++++++++++++- .../preprocessing/LogisticRegression2.java | 77 ++++++++++ .../preprocessing/MlModel.java | 26 ++++ .../preprocessing/TfidfVectorizer.java | 2 +- 5 files changed, 247 insertions(+), 6 deletions(-) create mode 100644 src/result/machinelearning/preprocessing/LogisticRegression2.java create mode 100644 src/result/machinelearning/preprocessing/MlModel.java diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 6807a2b..880fedc 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,6 +2,11 @@ - + + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression2.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/MlModel.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MathService.java + diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 69e6bf7..0159c9e 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -3,12 +3,145 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; - +package result.machineLearning.preprocessing; /** * * @author User */ -public class LogisticRegression extends AbstractModel{ - +import Exeptions.InconveninentShapeException; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import result.machinelearning.preprocessing.MlModel; +public class LogisticRegression implements MlModel, Serializable{ +private float alpha; +private float betta; +private int maxIter; +private boolean parralize; +private float learnRate; +private Random initializer = new Random(); +private double[] weights; +private int ITERATIONS=1000; +private boolean fitted = false; +public static class Instance { +public int label; +public int[] x; + +public Instance(int label, int[] x) { +this.label = label; +this.x = x; +} +} +private double classify(int[] x) { +double logit = .0; +for (int i=0; i instances) { + for (int n=0; n Date: Sun, 8 Oct 2017 16:57:05 +0300 Subject: [PATCH 12/29] Update --- nbproject/private/private.xml | 7 +- .../preprocessing/LogisticRegression.java | 198 +++++++----------- .../preprocessing/LogisticRegression2.java | 77 ------- 3 files changed, 74 insertions(+), 208 deletions(-) delete mode 100644 src/result/machinelearning/preprocessing/LogisticRegression2.java diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 880fedc..6807a2b 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,11 +2,6 @@ - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression2.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/MlModel.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MathService.java - + diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 0159c9e..bdfa1de 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -3,145 +3,93 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package result.machineLearning.preprocessing; +package result.machinelearning.preprocessing; + +import Exeptions.EmptyArrayException; +import Exeptions.InconveninentShapeException; +import java.io.Serializable; +import java.util.Random; +import Other.MathService; + /** * * @author User */ -import Exeptions.InconveninentShapeException; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.Random; -import result.machinelearning.preprocessing.MlModel; -public class LogisticRegression implements MlModel, Serializable{ +public class LogisticRegression implements MlModel, Serializable { private float alpha; private float betta; -private int maxIter; private boolean parralize; private float learnRate; private Random initializer = new Random(); +private int ITERATES=1000; +private double rate=0.001; + private double[] weights; -private int ITERATIONS=1000; private boolean fitted = false; -public static class Instance { -public int label; -public int[] x; - -public Instance(int label, int[] x) { -this.label = label; -this.x = x; -} -} -private double classify(int[] x) { -double logit = .0; -for (int i=0; i instances) { - for (int n=0; n0.5)System.out.println("It is a dog");else if(ver<0.4)System.out.println("It is a cat"); + else System.out.println("I don't know"); + return ver; } - public float getAlpha() {} - public void setAlpha(float alpha) {} - public float getBetta() {} - public void setBetta(float betta) {} - public int getMaxIter() {} - public void setMaxIter(int maxIter) {} - public boolean isParralize() {} - public void setParralize(boolean parralize) {} - public float getLearnRate() {} - public void setLearnRate(float learnRate) {} - private double lossFunction(double[][] X, double[] W, int[] y) throws InconveninentShapeException {} - private double[] lossFunctionDerivative(double[][] X, double[] W, - int[] y, float alpha, float betta) throws InconveninentShapeException {} - - + } +// public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} +// public void saveToFile(String filename) throws IOException {} +// public double[] getWeights() {} +// public float getAlpha() {} +// public void setAlpha(float alpha) {} +// public float getBetta() {} +// public void setBetta(float betta) {} +// public int getMaxIter() {} +// public void setMaxIter(int maxIter) {} +// public boolean isParralize() {} +// public void setParralize(boolean parralize) {} +// public float getLearnRate() {} +// public void setLearnRate(float learnRate) {} +// private double lossFunction(double[][] X, double[] W, int[] y) throws InconveninentShapeException {} +// private double[] lossFunctionDerivative(double[][] X, double[] W, +// int[] y, float alpha, float betta) throws InconveninentShapeException {} +//} diff --git a/src/result/machinelearning/preprocessing/LogisticRegression2.java b/src/result/machinelearning/preprocessing/LogisticRegression2.java deleted file mode 100644 index beef66f..0000000 --- a/src/result/machinelearning/preprocessing/LogisticRegression2.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import Exeptions.EmptyArrayException; -import Exeptions.InconveninentShapeException; -import java.io.Serializable; -import java.util.Random; -import Other.MathService; - -/** - * - * @author User - */ -public class LogisticRegression2 implements MlModel, Serializable { -private float alpha; -private float betta; -private boolean parralize; -private float learnRate; -private Random initializer = new Random(); -private int ITERATES=1000; -private double rate=0.001; - -private double[] weights; -private boolean fitted = false; - - public LogisticRegression2(float alpha, float betta, int maxIter, float learnRate, boolean parralize) {} - public static double sigmoid(double z){ - return 1/(1+Math.exp(-z)); - } - - public void train(double[][] X, int[] y) throws InconveninentShapeException, EmptyArrayException { - double zz=0; - double pr=0; - double delta[]=null; - for(int u=0;u Date: Sun, 8 Oct 2017 18:57:57 +0300 Subject: [PATCH 13/29] Update --- .../preprocessing/LogisticRegression.java | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index bdfa1de..d97d19f 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -16,21 +16,26 @@ * @author User */ public class LogisticRegression implements MlModel, Serializable { -private float alpha; -private float betta; -private boolean parralize; -private float learnRate; -private Random initializer = new Random(); +//private float alpha; +//private float betta; +//private boolean parralize; +//private float learnRate; +//private Random initializer = new Random(); private int ITERATES=1000; private double rate=0.001; private double[] weights; -private boolean fitted = false; +//private boolean fitted = false; // public LogisticRegression2(float alpha, float betta, int maxIter, float learnRate, boolean parralize) {} public static double sigmoid(double z){ return 1/(1+Math.exp(-z)); - } + } + /** + * Инициализация массива векторв - нужно добавить первый столбец с одними единицами + * @param X - координаты векторов + * @return + */ static public double[][] init(double[][]X){ int i,j; double [][]Y=new double[X.length][X.length+1]; @@ -40,20 +45,26 @@ static public double[][] init(double[][]X){ } return Y; }; + /** + * Тренировка весов + * С каждой итерацией вероятность будет точнее и точнее + * @param X полученные вектора из CountVectorizer + * @param y возможные варианты (1 или 0) + * @throws InconveninentShapeException + * @throws EmptyArrayException + */ public void train(double[][] X, int[] y) throws InconveninentShapeException, EmptyArrayException { - double zz=0; double pr=0; - double []sumdelta; + double []sumdelta; //сумма дельт в каждом столбце int i,j; - weights=new double[X.length+1]; + weights=new double[X[1].length+1]; X=init(X); - double delta[]=null; + double delta[]; sumdelta=new double[X.length]; for(int u=0;u Date: Sun, 8 Oct 2017 22:36:22 +0300 Subject: [PATCH 14/29] Update --- src/Exeptions/ModelNotFittedException.java | 26 +++ .../machinelearning/Model/NaiveBayes.java | 95 ++++++++- .../preprocessing/CountVectorizer.java | 198 +++++++++++++++++- .../preprocessing/LogisticRegression.java | 58 ++++- .../preprocessing/MlModel.java | 11 +- .../preprocessing/PorterStemmer.java | 98 ++++++++- .../preprocessing/SequenceProcessor.java | 14 +- .../preprocessing/TfidfVectorizer.java | 23 ++ .../preprocessing/Transformer.java | 2 +- 9 files changed, 499 insertions(+), 26 deletions(-) create mode 100644 src/Exeptions/ModelNotFittedException.java diff --git a/src/Exeptions/ModelNotFittedException.java b/src/Exeptions/ModelNotFittedException.java new file mode 100644 index 0000000..668350b --- /dev/null +++ b/src/Exeptions/ModelNotFittedException.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Exeptions; + +/** + * + * @author User + */ +public class ModelNotFittedException extends Exception { + ModelNotFittedException() { + super(); + } + ModelNotFittedException(String message) { + super(message); + } + ModelNotFittedException(Throwable cause) { + super(cause); + } + ModelNotFittedException(Throwable cause, String message) { + super(message); + } +} + diff --git a/src/result/machinelearning/Model/NaiveBayes.java b/src/result/machinelearning/Model/NaiveBayes.java index ca3566d..70423bc 100644 --- a/src/result/machinelearning/Model/NaiveBayes.java +++ b/src/result/machinelearning/Model/NaiveBayes.java @@ -3,12 +3,101 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.Model; + +import Exeptions.InconveninentShapeException; +import Exeptions.ModelNotFittedException; +import java.io.IOException; +import result.machinelearning.preprocessing.MlModel; /** * * @author User */ -public class NaiveBayes extends AbstractModel{ - +public class NaiveBayes implements MlModel { + private float alpha; + private double[][] weights; + private boolean fitted; + private boolean parallel; + public NaiveBayes(float alpha, boolean parallel) { + //Миша сказал забить + } + public MlModel train(double[][] X, int[] y) throws InconveninentShapeException { + //считаем у=0 и y=1 + if (X.length != y.length) + throw new InconveninentShapeException(); + double yZer = 0, yOne = 0; + for (int i=0; i matrix = new HashMap<>(); +private String[] stopWords; +final float minDf; +final float maxDf; +final boolean parralize; +private static List defaultStopWordsList = new ArrayList( +Arrays.asList(new String[]{ +"а","е","и","ж","м","о","на","не","ни","об","но","он","мне","мои","мож","она","они","оно", +"мной","много","многочисленное","многочисленная","многочисленные","многочисленный", +"мною","мой","мог","могут","можно","может","можно","мор","моя","моё","мочь","над","нее", +"оба","нам","нем","нами","ними","мимо","немного","одной","одного","менее","однажды","однако", +"меня","нему","меньше","ней","наверху","него","ниже","мало","надо","один","одиннадцать","одиннадцатый", +"назад","наиболее","недавно","миллионов","недалеко","между","низко","меля","нельзя","нибудь", +"непрерывно","наконец","никогда","никуда","нас","наш","нет","нею","неё","них","мира","наша", +"наше","наши","ничего","начала","нередко","несколько","обычно","опять","около","мы","ну","нх","от","отовсюду", +"особенно","нужно","очень","отсюда","в","во","вон","вниз","внизу","вокруг","вот","восемнадцать", +"восемнадцатый","восемь","восьмой","вверх","вам","вами","важное","важная","важные","важный","вдали","везде", +"ведь","вас","ваш","ваша","ваше","ваши","впрочем","весь","вдруг","вы","все","второй","всем","всеми","времени","время", +"всему","всего","всегда","всех","всею","всю","вся","всё","всюду","г","год","говорил","говорит","года","году","где", +"да","ее","за","из","ли","же","им","до","по","ими","под","иногда","довольно","именно","долго","позже", +"более","должно","пожалуйста","значит","иметь","больше","пока","ему","имя","пор","пора","потом","потому","после", +"почему","почти","посреди","ей","два","две","двенадцать","двенадцатый","двадцать","двадцатый", +"двух","его","дел","или","без","день","занят","занята","занято","заняты","действительно","давно", +"девятнадцать","девятнадцатый","девять","девятый","даже","алло","жизнь","далеко","близко","здесь","дальше","для", +"лет","зато","даром","первый","перед","затем","зачем","лишь","десять","десятый","ею","её","их","бы","еще","при", +"был","про","процентов","против","просто","бывает","бывь","если","люди","была","были","было","будем","будет","будете","будешь", +"прекрасно","буду","будь","будто","будут","ещё","пятнадцать","пятнадцатый","друго","другое","другой","другие","другая","других","есть","пять", +"быть","лучше","пятый","к","ком","конечно","кому","кого","когда","которой","которого","которая","которые","который","которых","кем", +"каждое","каждая","каждые","каждый","кажется","как","какой","какая","кто","кроме","куда","кругом","с","т","у","я", +"та","те","уж","со","то","том","снова","тому","совсем","того","тогда","тоже","собой","тобой","собою","тобою", +"сначала","только","уметь","тот","тою","хорошо","хотеть","хочешь","хоть","хотя","свое","свои","твой","своей","своего","своих", +"свою","твоя","твоё","раз","уже","сам","там","тем","чем","сама","сами","теми","само","рано","самом","самому", +"самой","самого","семнадцать","семнадцатый","самим","самими","самих","саму", +"семь","чему","раньше","сейчас","чего","сегодня","себе","тебе","сеаой","человек","разве","теперь","себя","тебя","седьмой","спасибо", +"слишком","так","такое","такой","такие","также","такая","сих","тех","чаще","четвертый","через","часто","шестой","шестнадцать","шестнадцатый", +"шесть","четыре","четырнадцать","четырнадцатый","сколько","сказал","сказала","сказать", +"ту","ты","три","эта","эти","что","это","чтоб","этом","этому","этой","этого","чтобы","этот","стал","туда", +"этим","этими","рядом","тринадцать","тринадцатый","этих","третий","тут","эту","суть","чуть","тысяч" +}) +); + +/** +* Заполняет матрицу +* @see CountVectorizer#matrix слова и возвращает список Мапов +* @param listOfTexts Список текстов +* @return Список Мапов +*/ +@Override +public List> fitAndTransform(List listOfTexts) { +List> listOfMaps = new ArrayList<>(); +for (String text : listOfTexts) { +List list = preprocess(text); +listOfMaps.add(countWordsAndEditMatrix(list)); +} +return listOfMaps; +} + +/** +* Заполняет матрицу +* @see CountVectorizer#matrix словами из списка текстов +* @param listOfTexts Список текстов +*/ +@Override +public void fit(List listOfTexts) { +for (String text : listOfTexts) { +List list = preprocess(text); +countWordsAndEditMatrix(list); +} +} + +/** +* Метод извлекающий слова из переданного в метод текста. +* Не учитываются слова поля из +* @see CountVectorizer#defaultStopWordsList +* Используется класс +* @see PorterStemmer для стемминга +* @param text Текст, из которого извлекаются слова +* @return Список слов +*/ +@Override +public List preprocess(String text) { +PorterStemmer stemmer = new PorterStemmer(); +text = text.toLowerCase().replaceAll("[^а-я -]","").replaceAll(" +-"," ").replaceAll("- +"," "); + +String[] array = text.split(" +"); +for (int i = 0; i list = new ArrayList(Arrays.asList(array)); +list.removeAll(defaultStopWordsList); +return list; +} + +/** +* Возвращает список Мапов из слов, взятых из переданного списка текстов +* @param listOfTexts Список текстов +* @return Список Мапов +*/ +@Override +public List> transform(List listOfTexts) { +List> listOfMaps = new ArrayList<>(); +for (String text : listOfTexts) { +List list = preprocess(text); +listOfMaps.add(countWords(list)); +} +return listOfMaps; +} + +/** +* Два конструктора +*/ +public CountVectorizer(float minDf, float maxDf, String[] stopWords, boolean parralize) { +this.minDf = minDf; +this.maxDf = maxDf; +this.stopWords = stopWords; +this.parralize = parralize; +} +public CountVectorizer(float minDf, float maxDf) { +this.minDf = minDf; +this.maxDf = maxDf; +parralize = false; +} +public CountVectorizer(String[] stopWords) { +this.stopWords = stopWords; +minDf = 1; +maxDf = 1; +parralize = false; +} +public CountVectorizer() { +minDf = 1; +maxDf = 1; +parralize = false; +} + +/** +* Геттеры для полей +* @see CountVectorizer#minDf и +* @see CountVectorizer#maxDf +*/ +public float getMinDf() { +return minDf; +} +public float getMaxDf() { +return maxDf; +} + +/** +* Считает, сколько раз встретилось одно слово в переданном списке слов +* @param words Список слов, в котором счиатем слова +* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово +*/ + +private Map countWords(List words) { +Map map = new HashMap(); +int value = 1; +for (String word : words) { +if (map.containsKey(word)) { +value += map.get(word); +} + +map.put(word, value); +} +return map; +} + +/** +* Делаем то же самое, что и в методе +* @see CountVectorizer#countWords(List), но еще и добавляем это в матрицу +* @see CountVectorizer#matrix +* @param words Список слов, в котором счиатем слова +* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово +*/ +private Map countWordsAndEditMatrix(List words) { +Map map = countWords(words); +int valueFromMatrix = 0; +for (Map.Entry pair : map.entrySet()) { +String key = pair.getKey(); +if (matrix.containsKey(key)) { +valueFromMatrix = matrix.get(key); +} +matrix.put(key, valueFromMatrix + pair.getValue()); +} +return map; +} + } + diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index d97d19f..87f0171 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -7,9 +7,13 @@ import Exeptions.EmptyArrayException; import Exeptions.InconveninentShapeException; +import Exeptions.ModelNotFittedException; import java.io.Serializable; import java.util.Random; import Other.MathService; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -50,10 +54,12 @@ static public double[][] init(double[][]X){ * С каждой итерацией вероятность будет точнее и точнее * @param X полученные вектора из CountVectorizer * @param y возможные варианты (1 или 0) + * @return * @throws InconveninentShapeException * @throws EmptyArrayException */ - public void train(double[][] X, int[] y) throws InconveninentShapeException, EmptyArrayException { +@Override + public MlModel train(double[][] X, int[] y) throws InconveninentShapeException { double pr=0; double []sumdelta; //сумма дельт в каждом столбце int i,j; @@ -64,13 +70,38 @@ public void train(double[][] X, int[] y) throws InconveninentShapeException, Emp for(int u=0;u0.5)System.out.println("It is a dog");else if(ver<0.4)System.out.println("It is a cat"); + if(ver>0.5){ + System.out.println("It is a dog"); + probability[0]=1; + }else if(ver<0.4)System.out.println("It is a cat"); else System.out.println("I don't know"); - return ver; + return probability; } + + @Override + public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void saveToFile(String filename) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } // public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java index d3a727d..300b881 100644 --- a/src/result/machinelearning/preprocessing/MlModel.java +++ b/src/result/machinelearning/preprocessing/MlModel.java @@ -6,6 +6,7 @@ package result.machinelearning.preprocessing; import Exeptions.InconveninentShapeException; +import Exeptions.ModelNotFittedException; import java.io.IOException; /** @@ -13,14 +14,14 @@ * @author User */ public interface MlModel { - //MlModel train(double[][] X, int[] y) throws InconveninentShapeException; + MlModel train(double[][] X, int[] y) throws InconveninentShapeException; - //int predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; + int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; - //double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; + double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; - //void saveToFile(String filename) throws IOException; - + void saveToFile(String filename) throws IOException; + } diff --git a/src/result/machinelearning/preprocessing/PorterStemmer.java b/src/result/machinelearning/preprocessing/PorterStemmer.java index b77851d..c6322fc 100644 --- a/src/result/machinelearning/preprocessing/PorterStemmer.java +++ b/src/result/machinelearning/preprocessing/PorterStemmer.java @@ -3,12 +3,98 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Preprocessing; +package result.machinelearning.preprocessing; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** - * - * @author User + * Stolen by ilysko on 03.08.17. + * original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html */ -public class PorterStemmer implements Transformer, WordProcessor{ - -} +public class PorterStemmer { + + private static final Pattern PERFECTIVEGROUND = Pattern.compile("((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$"); + + private static final Pattern REFLEXIVE = Pattern.compile("(с[яь])$"); + + private static final Pattern ADJECTIVE = Pattern.compile("(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$"); + + private static final Pattern PARTICIPLE = Pattern.compile("((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$"); + + private static final Pattern VERB = Pattern.compile("((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$"); + + private static final Pattern NOUN = Pattern.compile("(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$"); + + private static final Pattern RVRE = Pattern.compile("^(.*?[аеиоуыэюя])(.*)$"); + + private static final Pattern DERIVATIONAL = Pattern.compile(".*[^аеиоуыэюя]+[аеиоуыэюя].*ость?$"); + + private static final Pattern DER = Pattern.compile("ость?$"); + + private static final Pattern SUPERLATIVE = Pattern.compile("(ейше|ейш)$"); + + private static final Pattern I = Pattern.compile("и$"); + private static final Pattern P = Pattern.compile("ь$"); + private static final Pattern NN = Pattern.compile("нн$"); + + public String stem(String word) { + word = word.toLowerCase(); + word = word.replace('ё', 'е'); + Matcher m = RVRE.matcher(word); + if (m.matches()) { + String pre = m.group(1); + String rv = m.group(2); + String temp = PERFECTIVEGROUND.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = REFLEXIVE.matcher(rv).replaceFirst(""); + temp = ADJECTIVE.matcher(rv).replaceFirst(""); + if (!temp.equals(rv)) { + rv = temp; + rv = PARTICIPLE.matcher(rv).replaceFirst(""); + } else { + temp = VERB.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = NOUN.matcher(rv).replaceFirst(""); + } else { + rv = temp; + } + } + + } else { + rv = temp; + } + + rv = I.matcher(rv).replaceFirst(""); + + if (DERIVATIONAL.matcher(rv).matches()) { + rv = DER.matcher(rv).replaceFirst(""); + } + + temp = P.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = SUPERLATIVE.matcher(rv).replaceFirst(""); + rv = NN.matcher(rv).replaceFirst("н"); + } else { + rv = temp; + } + word = pre + rv; + + } + + return word; + } + + /** + * Some tests + */ + public static void main(String[] args) { + PorterStemmer porterStemmer = new PorterStemmer(); + String[] listOfWords = new String[] {"букварь", "здравие", + "птица", "интересный", "космос", "космический"}; + for (String word: listOfWords) { + System.out.println("Результат применения PorterStemmer к слову " + word + " : " +porterStemmer.stem(word)); + } + } + +} \ No newline at end of file diff --git a/src/result/machinelearning/preprocessing/SequenceProcessor.java b/src/result/machinelearning/preprocessing/SequenceProcessor.java index 071b263..76c289b 100644 --- a/src/result/machinelearning/preprocessing/SequenceProcessor.java +++ b/src/result/machinelearning/preprocessing/SequenceProcessor.java @@ -3,12 +3,22 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Preprocessing; +package result.machinelearning.preprocessing; + +import java.util.List; +import java.util.Map; /** * * @author User */ public interface SequenceProcessor { - + public List> fitAndTransform(List listOfTexts); + + public void fit(List listOfTexts); + + public List preprocess(String text); + + public List> transform(List listOfTexts); + } diff --git a/src/result/machinelearning/preprocessing/TfidfVectorizer.java b/src/result/machinelearning/preprocessing/TfidfVectorizer.java index 228386f..ff66a62 100644 --- a/src/result/machinelearning/preprocessing/TfidfVectorizer.java +++ b/src/result/machinelearning/preprocessing/TfidfVectorizer.java @@ -1,7 +1,30 @@ package result.machinelearning.preprocessing; +import java.util.List; +import java.util.Map; + /** * Created by ilysko on 03.08.17. */ public class TfidfVectorizer implements SequenceProcessor, Transformer { + + @Override + public List> fitAndTransform(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void fit(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public List preprocess(String text) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public List> transform(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/src/result/machinelearning/preprocessing/Transformer.java b/src/result/machinelearning/preprocessing/Transformer.java index 17bf461..f5e1244 100644 --- a/src/result/machinelearning/preprocessing/Transformer.java +++ b/src/result/machinelearning/preprocessing/Transformer.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Preprocessing; +package result.machinelearning.preprocessing; /** * From ae7804034ffed3068f433d3f721f336d265fc453 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 10 Oct 2017 21:33:30 +0300 Subject: [PATCH 15/29] 1 --- .../preprocessing/TfldfVectorizer.java | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 src/result/machinelearning/preprocessing/TfldfVectorizer.java diff --git a/src/result/machinelearning/preprocessing/TfldfVectorizer.java b/src/result/machinelearning/preprocessing/TfldfVectorizer.java deleted file mode 100644 index 53693ec..0000000 --- a/src/result/machinelearning/preprocessing/TfldfVectorizer.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package MachineLearning.Preprocessing; - -/** - * - * @author User - */ -public class TfldfVectorizer implements Transformer { - -} From ae2647b04a431bdc63ddc383de33427428ac8402 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 10 Oct 2017 23:38:12 +0300 Subject: [PATCH 16/29] HW --- nbproject/private/private.xml | 5 +- src/Other/MyOwnArrayList.java | 79 +++++++++++++++ src/Other/MyOwnLinkedList.java | 97 +++++++++++++++++++ .../preprocessing/LogisticRegression.java | 32 ++---- .../preprocessing/WordProcessor.java | 2 +- 5 files changed, 190 insertions(+), 25 deletions(-) create mode 100644 src/Other/MyOwnArrayList.java create mode 100644 src/Other/MyOwnLinkedList.java diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 6807a2b..8ad5119 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,6 +2,9 @@ - + + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnArrayList.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/Test.java + diff --git a/src/Other/MyOwnArrayList.java b/src/Other/MyOwnArrayList.java new file mode 100644 index 0000000..bd04bac --- /dev/null +++ b/src/Other/MyOwnArrayList.java @@ -0,0 +1,79 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; +import java.util.ArrayList; +import java.lang.Exception; +/** + * + * @author User + */ +public class MyOwnArrayList { + private Object[] ElementData; + MyOwnArrayList(){ + this(10); + } + MyOwnArrayList(int i){ + if (i < 0) + throw new IllegalArgumentException("Illegal Capacity: "+i); + this.ElementData=new Object[i]; + } + public void add(Object ob){ + int i=0; + for(i=0;i0; + } + public void remove(int index){ + System.arraycopy(ElementData, index+1, ElementData, index, ElementData.length-index-1); + ElementData[ElementData.length-1] = null; + Object[] NewElementData=new Object[ElementData.length-1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length-1); + ElementData=new Object[NewElementData.length]; + ElementData=NewElementData; + + } + public void remove(Object ob){ + int index=0; + for(int i=0;i0){ + Object[]NewElementData=new Object[ElementData.length+1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length); + ElementData=new Object[NewElementData.length]; + ElementData=NewElementData; + } + } + /* + Для проверки методов + */ + public void showAll(){ + for(Object x:ElementData)System.out.println("Element: "+x); + } +} diff --git a/src/Other/MyOwnLinkedList.java b/src/Other/MyOwnLinkedList.java new file mode 100644 index 0000000..406cfe8 --- /dev/null +++ b/src/Other/MyOwnLinkedList.java @@ -0,0 +1,97 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +/** + * + * @author User + */ +public class MyOwnLinkedList { + private int size; + private Entry head; + private Entry pred; + private static class Entry{ + Object element; + Entry next; + Entry prev; + Entry(E element){ + this.element = element; + } + } + public void add(Object ob){ + Entry e=new Entry(ob); + if(size==0){ + head=e; + }else{ + pred.next=e; + e.prev=pred; + } + pred=e; + size++; + + } + public boolean contains(Object ob){ + Entry e=head; + while(e.next!=null){ + if(e.element.equals(ob))return true; + e=e.next; + } + return false; + } + public void remove(Object ob){ + Entry e=head; + size--; + do{ + if(size==0){ + head=null; + break; + } + if(e.element.equals(ob))if(head.element.equals(ob)){ + poll(); + break; + } + else if(e.next==null){ + e.prev.next=null; + break; + }else{ + e.next.prev=e.prev; + e.prev.next=e.next; + break; + } + e=e.next; + }while(e!=null); + } + public void set(int index, Object ob){ + Entry e=head; + for(int i=0;i e=head; + head=head.next; + head.prev=null; + return e.element; + } + /* + Для проверки методов + */ + public void showAll(){ + Entry e=head; + while(e.next!=null){ + System.out.println(e.element); + e=e.next; + } + System.out.println(e.element); + } +} diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 87f0171..438247d 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -81,27 +81,7 @@ public MlModel train(double[][] X, int[] y) throws InconveninentShapeException { for(i=0;i0.5){ System.out.println("It is a dog"); probability[0]=1; - }else if(ver<0.4)System.out.println("It is a cat"); - else System.out.println("I don't know"); + }else if(ver<0.4){ + System.out.println("It is a cat"); + probability[0]=0; + } + else { + System.out.println("I don't know"); + probability[0]=-1; + } return probability; } diff --git a/src/result/machinelearning/preprocessing/WordProcessor.java b/src/result/machinelearning/preprocessing/WordProcessor.java index d2b465c..c31a106 100644 --- a/src/result/machinelearning/preprocessing/WordProcessor.java +++ b/src/result/machinelearning/preprocessing/WordProcessor.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Preprocessing; +package result.machinelearning.preprocessing; /** * From 4705809e46db422891411072e2b1c55e146a7226 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 17 Oct 2017 20:21:21 +0300 Subject: [PATCH 17/29] New --- nbproject/private/private.xml | 5 +- .../preprocessing/HomeWork.java | 60 +++++++++++++++++++ .../preprocessing/LogisticRegression.java | 41 ++++++++++++- 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 src/result/machinelearning/preprocessing/HomeWork.java diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 8ad5119..6807a2b 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,9 +2,6 @@ - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnArrayList.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/Test.java - + diff --git a/src/result/machinelearning/preprocessing/HomeWork.java b/src/result/machinelearning/preprocessing/HomeWork.java new file mode 100644 index 0000000..eb2b84c --- /dev/null +++ b/src/result/machinelearning/preprocessing/HomeWork.java @@ -0,0 +1,60 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +/** + * + * @author Danny + */ +public class HomeWork { + public static void main(String[] args) throws IOException, FileNotFoundException, ClassNotFoundException{ + HomeWork nc=new HomeWork(); + nc.ReadFromFile("fgg"); + nc.saveMlModelToFile(); + nc.readFromFile(); + } + public void ReadFromFile(String filename) throws IOException { + File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); + FileReader fir=new FileReader(file); + if(!file.exists())System.out.println("File no exist"); + StringBuffer sb=new StringBuffer(); + try{ + BufferedReader br=new BufferedReader(fir); + String s; + while ((s = br.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + } + catch(Exception e){ + System.out.println(e); + } + System.out.println(sb); + } + public void saveMlModelToFile() throws FileNotFoundException, IOException{ + FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + ObjectOutputStream os=new ObjectOutputStream(file); + LogisticRegression lr=new LogisticRegression(); + os.writeObject(lr); + os.close(); + } + public void readFromFile() throws FileNotFoundException, IOException, ClassNotFoundException{ + ObjectInputStream os=new ObjectInputStream(new FileInputStream("C:\\users\\user\\desktop\\work\\Save.dat")); + LogisticRegression lg=(LogisticRegression)os.readObject(); + double wes[]=lg.getWeights(); + for(double w:wes)System.out.println(w); + } +} diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 438247d..745a3a8 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -11,7 +11,14 @@ import java.io.Serializable; import java.util.Random; import Other.MathService; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; import java.util.logging.Level; import java.util.logging.Logger; @@ -124,6 +131,38 @@ public double[] predictProba(double[] X) throws ModelNotFittedException, Inconve throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + public void ReadFromFile(String filename) throws IOException { + File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); + FileReader fir=new FileReader(file); + if(!file.exists())System.out.println("File no exist"); + StringBuffer sb=new StringBuffer(); + try{ + BufferedReader br=new BufferedReader(fir); + String s; + while ((s = br.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + } + catch(Exception e){ + System.out.println(e); + } + } + public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException{ + FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + ObjectOutputStream os=new ObjectOutputStream(file); + LogisticRegression lr=new LogisticRegression(); + os.writeObject(lr); + os.close(); + } + + public double[] getWeights() { + return weights; + } + + public void setWeights(double[] weights) { + this.weights = weights; + } @Override public void saveToFile(String filename) throws IOException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. @@ -131,7 +170,7 @@ public void saveToFile(String filename) throws IOException { } // public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} -// public void saveToFile(String filename) throws IOException {} + // public double[] getWeights() {} // public float getAlpha() {} // public void setAlpha(float alpha) {} From e9798775b07ecedcf8acbb0c42c9720b607ed15c Mon Sep 17 00:00:00 2001 From: SychDan Date: Sun, 22 Oct 2017 15:20:12 +0300 Subject: [PATCH 18/29] Update --- nbproject/private/private.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 6807a2b..3db8086 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,6 +2,9 @@ - + + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/HomeWork.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression.java + From 37eb8f343f7e6c3200096c90893bd41a74755d08 Mon Sep 17 00:00:00 2001 From: SychDan Date: Mon, 23 Oct 2017 23:40:17 +0300 Subject: [PATCH 19/29] Correction MathService --- .../preprocessing => Other}/HomeWork.java | 0 src/Other/NewClass.java | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+) rename src/{result/machinelearning/preprocessing => Other}/HomeWork.java (100%) create mode 100644 src/Other/NewClass.java diff --git a/src/result/machinelearning/preprocessing/HomeWork.java b/src/Other/HomeWork.java similarity index 100% rename from src/result/machinelearning/preprocessing/HomeWork.java rename to src/Other/HomeWork.java diff --git a/src/Other/NewClass.java b/src/Other/NewClass.java new file mode 100644 index 0000000..da54811 --- /dev/null +++ b/src/Other/NewClass.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Other; + +import java.util.Iterator; + + +/** + * + * @author Danny + */ +public class NewClass { + public static void main(String[] args){ + MyOwnLinkedList moar=new MyOwnLinkedList(); + //Iterator it=moar.iterator(); + moar.add("SS"); + moar.add("dddddd"); + moar.add("ddd"); + //moar.showAll(); + Iterator it=moar.iterator(); + while(it.hasNext())System.out.println(it.next()); + } +} From df68a300e6cb0f2fe0a57606e3c4ca252c1cd724 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 24 Oct 2017 00:15:11 +0300 Subject: [PATCH 20/29] Correction --- .../Exeptions/EmptyArrayException.html | 301 ++++++++++++ .../InconveninentShapeException.html | 301 ++++++++++++ .../Exeptions/ModelNotFittedException.html | 223 +++++++++ .../MachineLearning/Model/AbstractModel.html | 242 ++++++++++ .../MachineLearning/Model/Boosting.html | 243 ++++++++++ .../MachineLearning/Model/KNeighbourhood.html | 247 ++++++++++ .../MachineLearning/Model/LinearKernel.html | 248 ++++++++++ .../MachineLearning/Model/NormalKernel.html | 248 ++++++++++ .../Preprocessing/WordProcessor.html | 168 +++++++ dist/javadoc/Other/DAO.html | 168 +++++++ dist/javadoc/Other/DAOImplementation.html | 238 ++++++++++ dist/javadoc/Other/MathService.html | 350 ++++++++++++++ .../Other/ModelSelectionHibernateEntity.html | 238 ++++++++++ dist/javadoc/Other/MyOwnArrayList.html | 285 +++++++++++ dist/javadoc/WorkFiles/FileReader.html | 243 ++++++++++ dist/javadoc/WorkFiles/FileWorker.html | 172 +++++++ dist/javadoc/WorkFiles/FileWriter.html | 243 ++++++++++ .../machinelearning/Model/NaiveBayes.html | 391 +++++++++++++++ .../preprocessing/CountVectorizer.html | 447 ++++++++++++++++++ .../preprocessing/LogisticRegression.html | 422 +++++++++++++++++ .../preprocessing/MlModel.html | 291 ++++++++++++ .../preprocessing/PorterStemmer.html | 290 ++++++++++++ .../preprocessing/SequenceProcessor.html | 265 +++++++++++ .../preprocessing/TfidfVectorizer.html | 333 +++++++++++++ .../preprocessing/TfldfVectorizer.html | 243 ++++++++++ .../preprocessing/Transformer.html | 172 +++++++ .../lecture04/ExceptionCatchingExample.html | 272 +++++++++++ .../lecture04/ExceptionCatchingIhExample.html | 272 +++++++++++ .../lecture04/MyExceptionClassExample.html | 334 +++++++++++++ .../lectures/lecture04/StackTraceExample.html | 273 +++++++++++ .../lecture04/ThrowExample.NegException.html | 227 +++++++++ .../lectures/lecture04/ThrowExample.html | 313 ++++++++++++ .../lecture04/WorkWithExceptions.html | 278 +++++++++++ src/Other/MathService.java | 68 +-- src/Other/MyOwnArrayList.java | 19 +- src/Other/MyOwnLinkedList.java | 26 +- 36 files changed, 9029 insertions(+), 65 deletions(-) create mode 100644 dist/javadoc/Exeptions/EmptyArrayException.html create mode 100644 dist/javadoc/Exeptions/InconveninentShapeException.html create mode 100644 dist/javadoc/Exeptions/ModelNotFittedException.html create mode 100644 dist/javadoc/MachineLearning/Model/AbstractModel.html create mode 100644 dist/javadoc/MachineLearning/Model/Boosting.html create mode 100644 dist/javadoc/MachineLearning/Model/KNeighbourhood.html create mode 100644 dist/javadoc/MachineLearning/Model/LinearKernel.html create mode 100644 dist/javadoc/MachineLearning/Model/NormalKernel.html create mode 100644 dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html create mode 100644 dist/javadoc/Other/DAO.html create mode 100644 dist/javadoc/Other/DAOImplementation.html create mode 100644 dist/javadoc/Other/MathService.html create mode 100644 dist/javadoc/Other/ModelSelectionHibernateEntity.html create mode 100644 dist/javadoc/Other/MyOwnArrayList.html create mode 100644 dist/javadoc/WorkFiles/FileReader.html create mode 100644 dist/javadoc/WorkFiles/FileWorker.html create mode 100644 dist/javadoc/WorkFiles/FileWriter.html create mode 100644 dist/javadoc/result/machinelearning/Model/NaiveBayes.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/MlModel.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/Transformer.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html diff --git a/dist/javadoc/Exeptions/EmptyArrayException.html b/dist/javadoc/Exeptions/EmptyArrayException.html new file mode 100644 index 0000000..4567ca4 --- /dev/null +++ b/dist/javadoc/Exeptions/EmptyArrayException.html @@ -0,0 +1,301 @@ + + + + + + +EmptyArrayException + + + + + + + + + + + + +
+
Exeptions
+

Class EmptyArrayException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.EmptyArrayException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class EmptyArrayException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException()
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.String message,
        +                           java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Exeptions/InconveninentShapeException.html b/dist/javadoc/Exeptions/InconveninentShapeException.html new file mode 100644 index 0000000..9461a6d --- /dev/null +++ b/dist/javadoc/Exeptions/InconveninentShapeException.html @@ -0,0 +1,301 @@ + + + + + + +InconveninentShapeException + + + + + + + + + + + + +
+
Exeptions
+

Class InconveninentShapeException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.InconveninentShapeException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class InconveninentShapeException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException()
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.String message,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Exeptions/ModelNotFittedException.html b/dist/javadoc/Exeptions/ModelNotFittedException.html new file mode 100644 index 0000000..b712f3e --- /dev/null +++ b/dist/javadoc/Exeptions/ModelNotFittedException.html @@ -0,0 +1,223 @@ + + + + + + +ModelNotFittedException + + + + + + + + + + + + +
+
Exeptions
+

Class ModelNotFittedException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.ModelNotFittedException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class ModelNotFittedException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/AbstractModel.html b/dist/javadoc/MachineLearning/Model/AbstractModel.html new file mode 100644 index 0000000..e64c1b6 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/AbstractModel.html @@ -0,0 +1,242 @@ + + + + + + +AbstractModel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class AbstractModel

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • MachineLearning.Model.AbstractModel
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    Boosting, KNeighbourhood
    +
    +
    +
    +
    public class AbstractModel
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      AbstractModel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AbstractModel

        +
        public AbstractModel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/Boosting.html b/dist/javadoc/MachineLearning/Model/Boosting.html new file mode 100644 index 0000000..1a5a90f --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/Boosting.html @@ -0,0 +1,243 @@ + + + + + + +Boosting + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class Boosting

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Boosting() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Boosting

        +
        public Boosting()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/KNeighbourhood.html b/dist/javadoc/MachineLearning/Model/KNeighbourhood.html new file mode 100644 index 0000000..9fb30f7 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/KNeighbourhood.html @@ -0,0 +1,247 @@ + + + + + + +KNeighbourhood + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class KNeighbourhood

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      KNeighbourhood() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        KNeighbourhood

        +
        public KNeighbourhood()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/LinearKernel.html b/dist/javadoc/MachineLearning/Model/LinearKernel.html new file mode 100644 index 0000000..44fee98 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/LinearKernel.html @@ -0,0 +1,248 @@ + + + + + + +LinearKernel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class LinearKernel

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      LinearKernel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LinearKernel

        +
        public LinearKernel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/NormalKernel.html b/dist/javadoc/MachineLearning/Model/NormalKernel.html new file mode 100644 index 0000000..fcc7bd7 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/NormalKernel.html @@ -0,0 +1,248 @@ + + + + + + +NormalKernel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class NormalKernel

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NormalKernel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NormalKernel

        +
        public NormalKernel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html b/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html new file mode 100644 index 0000000..0a83117 --- /dev/null +++ b/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html @@ -0,0 +1,168 @@ + + + + + + +WordProcessor + + + + + + + + + + + + +
+
MachineLearning.Preprocessing
+

Interface WordProcessor

+
+
+
+
    +
  • +
    +
    +
    public interface WordProcessor
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/DAO.html b/dist/javadoc/Other/DAO.html new file mode 100644 index 0000000..208e1ea --- /dev/null +++ b/dist/javadoc/Other/DAO.html @@ -0,0 +1,168 @@ + + + + + + +DAO + + + + + + + + + + + + +
+
Other
+

Interface DAO

+
+
+
+
    +
  • +
    +
    +
    public interface DAO
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/DAOImplementation.html b/dist/javadoc/Other/DAOImplementation.html new file mode 100644 index 0000000..32366f5 --- /dev/null +++ b/dist/javadoc/Other/DAOImplementation.html @@ -0,0 +1,238 @@ + + + + + + +DAOImplementation + + + + + + + + + + + + +
+
Other
+

Class DAOImplementation

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.DAOImplementation
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class DAOImplementation
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DAOImplementation() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DAOImplementation

        +
        public DAOImplementation()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/MathService.html b/dist/javadoc/Other/MathService.html new file mode 100644 index 0000000..41a87de --- /dev/null +++ b/dist/javadoc/Other/MathService.html @@ -0,0 +1,350 @@ + + + + + + +MathService + + + + + + + + + + + + +
+
Other
+

Class MathService

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.MathService
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class MathService
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MathService() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static doubledoProduct(double[] a, + double[] b) 
      static voidmain(java.lang.String[] args) 
      static double[][]MatrixNormalize(double[][] x) 
      static doublesigmoid(double x) 
      static doublesigmoid(double[] x, + double[] w) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/Other/ModelSelectionHibernateEntity.html b/dist/javadoc/Other/ModelSelectionHibernateEntity.html new file mode 100644 index 0000000..1b21656 --- /dev/null +++ b/dist/javadoc/Other/ModelSelectionHibernateEntity.html @@ -0,0 +1,238 @@ + + + + + + +ModelSelectionHibernateEntity + + + + + + + + + + + + +
+
Other
+

Class ModelSelectionHibernateEntity

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.ModelSelectionHibernateEntity
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ModelSelectionHibernateEntity
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ModelSelectionHibernateEntity

        +
        public ModelSelectionHibernateEntity()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/MyOwnArrayList.html b/dist/javadoc/Other/MyOwnArrayList.html new file mode 100644 index 0000000..bdac46f --- /dev/null +++ b/dist/javadoc/Other/MyOwnArrayList.html @@ -0,0 +1,285 @@ + + + + + + +MyOwnArrayList + + + + + + + + + + + + +
+
Other
+

Class MyOwnArrayList

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.MyOwnArrayList
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class MyOwnArrayList
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MyOwnArrayList() 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MyOwnArrayList

        +
        public MyOwnArrayList()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileReader.html b/dist/javadoc/WorkFiles/FileReader.html new file mode 100644 index 0000000..da1f07f --- /dev/null +++ b/dist/javadoc/WorkFiles/FileReader.html @@ -0,0 +1,243 @@ + + + + + + +FileReader + + + + + + + + + + + + +
+
WorkFiles
+

Class FileReader

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • WorkFiles.FileReader
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    FileWorker
    +
    +
    +
    +
    public class FileReader
    +extends java.lang.Object
    +implements FileWorker
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FileReader() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FileReader

        +
        public FileReader()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileWorker.html b/dist/javadoc/WorkFiles/FileWorker.html new file mode 100644 index 0000000..7fd473e --- /dev/null +++ b/dist/javadoc/WorkFiles/FileWorker.html @@ -0,0 +1,172 @@ + + + + + + +FileWorker + + + + + + + + + + + + +
+
WorkFiles
+

Interface FileWorker

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    FileReader, FileWriter
    +
    +
    +
    +
    public interface FileWorker
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileWriter.html b/dist/javadoc/WorkFiles/FileWriter.html new file mode 100644 index 0000000..68144fb --- /dev/null +++ b/dist/javadoc/WorkFiles/FileWriter.html @@ -0,0 +1,243 @@ + + + + + + +FileWriter + + + + + + + + + + + + +
+
WorkFiles
+

Class FileWriter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • WorkFiles.FileWriter
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    FileWorker
    +
    +
    +
    +
    public class FileWriter
    +extends java.lang.Object
    +implements FileWorker
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FileWriter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FileWriter

        +
        public FileWriter()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/Model/NaiveBayes.html b/dist/javadoc/result/machinelearning/Model/NaiveBayes.html new file mode 100644 index 0000000..a1c1c9f --- /dev/null +++ b/dist/javadoc/result/machinelearning/Model/NaiveBayes.html @@ -0,0 +1,391 @@ + + + + + + +NaiveBayes + + + + + + + + + + + + +
+
result.machinelearning.Model
+

Class NaiveBayes

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.Model.NaiveBayes
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MlModel
    +
    +
    +
    +
    public class NaiveBayes
    +extends java.lang.Object
    +implements MlModel
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NaiveBayes(float alpha, + boolean parallel) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      floatgetAlpha() 
      double[][]getWeights() 
      booleanisFitted() 
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      MlModeltrain(double[][] X, + int[] y) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html new file mode 100644 index 0000000..5df2d12 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html @@ -0,0 +1,447 @@ + + + + + + +CountVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class CountVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.CountVectorizer
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CountVectorizer() 
      CountVectorizer(float minDf, + float maxDf) 
      CountVectorizer(float minDf, + float maxDf, + java.lang.String[] stopWords, + boolean parralize) +
      Два конструктора
      +
      CountVectorizer(java.lang.String[] stopWords) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) +
      Заполняет матрицу
      +
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) +
      Заполняет матрицу
      +
      floatgetMaxDf() 
      floatgetMinDf() +
      Геттеры для полей
      +
      java.util.List<java.lang.String>preprocess(java.lang.String text) +
      Метод извлекающий слова из переданного в метод текста.
      +
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) +
      Возвращает список Мапов из слов, взятых из переданного списка текстов
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(float minDf,
        +                       float maxDf,
        +                       java.lang.String[] stopWords,
        +                       boolean parralize)
        +
        Два конструктора
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(float minDf,
        +                       float maxDf)
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(java.lang.String[] stopWords)
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        preprocess

        +
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
        Метод извлекающий слова из переданного в метод текста. + Не учитываются слова поля из
        +
        +
        Specified by:
        +
        preprocess in interface SequenceProcessor
        +
        Parameters:
        +
        text - Текст, из которого извлекаются слова
        +
        Returns:
        +
        Список слов
        +
        See Also:
        +
        Используется класс, +для стемминга
        +
        +
      • +
      + + + +
        +
      • +

        transform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
        Возвращает список Мапов из слов, взятых из переданного списка текстов
        +
        +
        Specified by:
        +
        transform in interface SequenceProcessor
        +
        Parameters:
        +
        listOfTexts - Список текстов
        +
        Returns:
        +
        Список Мапов
        +
        +
      • +
      + + + +
        +
      • +

        getMinDf

        +
        public float getMinDf()
        +
        Геттеры для полей
        +
        +
        See Also:
        +
        и, +maxDf
        +
        +
      • +
      + + + +
        +
      • +

        getMaxDf

        +
        public float getMaxDf()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html b/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html new file mode 100644 index 0000000..8c41de3 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html @@ -0,0 +1,422 @@ + + + + + + +LogisticRegression + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class LogisticRegression

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.LogisticRegression
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, MlModel
    +
    +
    +
    +
    public class LogisticRegression
    +extends java.lang.Object
    +implements MlModel, java.io.Serializable
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      LogisticRegression() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static double[][]init(double[][] X) +
      Инициализация массива векторв - нужно добавить первый столбец с одними единицами
      +
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      static doublesigmoid(double z) 
      doubless(double[] X) +
      Вспомогательный класс, который помогает вычислить сумму произведений координат вектора их весов
      +
      MlModeltrain(double[][] X, + int[] y) +
      Тренировка весов + С каждой итерацией вероятность будет точнее и точнее
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LogisticRegression

        +
        public LogisticRegression()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/MlModel.html b/dist/javadoc/result/machinelearning/preprocessing/MlModel.html new file mode 100644 index 0000000..399e5de --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/MlModel.html @@ -0,0 +1,291 @@ + + + + + + +MlModel + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface MlModel

+
+
+
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html b/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html new file mode 100644 index 0000000..322c33c --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html @@ -0,0 +1,290 @@ + + + + + + +PorterStemmer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class PorterStemmer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.PorterStemmer
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class PorterStemmer
    +extends java.lang.Object
    +
    Stolen by ilysko on 03.08.17. + original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PorterStemmer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) +
      Some tests
      +
      java.lang.Stringstem(java.lang.String word) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PorterStemmer

        +
        public PorterStemmer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        stem

        +
        public java.lang.String stem(java.lang.String word)
        +
      • +
      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
        Some tests
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html b/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html new file mode 100644 index 0000000..7d23e8d --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html @@ -0,0 +1,265 @@ + + + + + + +SequenceProcessor + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface SequenceProcessor

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fitAndTransform

        +
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      + + + +
        +
      • +

        fit

        +
        void fit(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      + + + +
        +
      • +

        preprocess

        +
        java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        transform

        +
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html new file mode 100644 index 0000000..6813a2e --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html @@ -0,0 +1,333 @@ + + + + + + +TfidfVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class TfidfVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.TfidfVectorizer
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TfidfVectorizer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TfidfVectorizer

        +
        public TfidfVectorizer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fitAndTransform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        fitAndTransform in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        fit

        +
        public void fit(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        fit in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        preprocess

        +
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
        +
        Specified by:
        +
        preprocess in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        transform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        transform in interface SequenceProcessor
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html new file mode 100644 index 0000000..8988857 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html @@ -0,0 +1,243 @@ + + + + + + +TfldfVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class TfldfVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.TfldfVectorizer
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Transformer
    +
    +
    +
    +
    public class TfldfVectorizer
    +extends java.lang.Object
    +implements Transformer
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TfldfVectorizer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TfldfVectorizer

        +
        public TfldfVectorizer()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/Transformer.html b/dist/javadoc/result/machinelearning/preprocessing/Transformer.html new file mode 100644 index 0000000..36b8b02 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/Transformer.html @@ -0,0 +1,172 @@ + + + + + + +Transformer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface Transformer

+
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html new file mode 100644 index 0000000..be285f9 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html @@ -0,0 +1,272 @@ + + + + + + +ExceptionCatchingExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ExceptionCatchingExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ExceptionCatchingExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ExceptionCatchingExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExceptionCatchingExample

        +
        public ExceptionCatchingExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html new file mode 100644 index 0000000..ff9b0a9 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html @@ -0,0 +1,272 @@ + + + + + + +ExceptionCatchingIhExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ExceptionCatchingIhExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ExceptionCatchingIhExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ExceptionCatchingIhExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExceptionCatchingIhExample

        +
        public ExceptionCatchingIhExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html new file mode 100644 index 0000000..1a5f115 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html @@ -0,0 +1,334 @@ + + + + + + +MyExceptionClassExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class MyExceptionClassExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • ru.caf82.lectures.lecture04.MyExceptionClassExample
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class MyExceptionClassExample
    +extends java.lang.Exception
    +
    Created by ilysko on 24.09.17.
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample()
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(java.lang.Exception e)
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(int amountOfSmth)
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(java.lang.String messageFullOfAnger)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html new file mode 100644 index 0000000..08adc0c --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html @@ -0,0 +1,273 @@ + + + + + + +StackTraceExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class StackTraceExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.StackTraceExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class StackTraceExample
    +extends java.lang.Object
    +
    Created by ilysko on 24.09.17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      StackTraceExample() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StackTraceExample

        +
        public StackTraceExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html new file mode 100644 index 0000000..fcc854c --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html @@ -0,0 +1,227 @@ + + + + + + +ThrowExample.NegException + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ThrowExample.NegException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • ru.caf82.lectures.lecture04.ThrowExample.NegException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    ThrowExample
    +
    +
    +
    +
    public static class ThrowExample.NegException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html new file mode 100644 index 0000000..1462228 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html @@ -0,0 +1,313 @@ + + + + + + +ThrowExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ThrowExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ThrowExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ThrowExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class ThrowExample.NegException 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ThrowExample() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static intdivide(int a, + int b) 
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ThrowExample

        +
        public ThrowExample()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html b/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html new file mode 100644 index 0000000..0b04e86 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html @@ -0,0 +1,278 @@ + + + + + + +WorkWithExceptions + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class WorkWithExceptions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.WorkWithExceptions
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class WorkWithExceptions
    +extends java.lang.Object
    +
    Created by ilysko on 24.09.17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      WorkWithExceptions() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/src/Other/MathService.java b/src/Other/MathService.java index 3ef475f..2b3c768 100644 --- a/src/Other/MathService.java +++ b/src/Other/MathService.java @@ -6,10 +6,6 @@ package Other; import Exeptions.EmptyArrayException; import Exeptions.InconveninentShapeException; -import java.util.Arrays; -import java.util.Random; -import java.util.logging.Level; -import java.util.logging.Logger; /** * @@ -20,29 +16,22 @@ public static double doProduct(double[] a, double[] b) throws InconveninentShape double result=0; boolean TT=true; if(a.length!=b.length) throw new InconveninentShapeException("DoProduct: разные размеры массивов!"); - if(a.length==0 & b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); + if(a.length==0 | b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); for (int x=0;x{ +public class MyOwnArrayList implements Iterable{ private Object[] ElementData; MyOwnArrayList(){ this(10); @@ -76,4 +77,20 @@ private void ensureCapacity(int copacity){ public void showAll(){ for(Object x:ElementData)System.out.println("Element: "+x); } + + @Override + public Iterator iterator() { + return new Iterator(){ + int i=0; + @Override + public boolean hasNext() { + return(ElementData[i]!=null); + } + + @Override + public Object next() { + return ElementData[i++]; + } + }; + } } diff --git a/src/Other/MyOwnLinkedList.java b/src/Other/MyOwnLinkedList.java index 406cfe8..76eba44 100644 --- a/src/Other/MyOwnLinkedList.java +++ b/src/Other/MyOwnLinkedList.java @@ -5,14 +5,35 @@ */ package Other; +import java.util.Iterator; + /** * * @author User */ -public class MyOwnLinkedList { +public class MyOwnLinkedList implements Iterable{ private int size; private Entry head; private Entry pred; + + @Override + public Iterator iterator() { + return new Iterator(){ + Entry e=head; + @Override + public boolean hasNext() { + return(e!=null); + } + + @Override + public Object next() { + Object ob=e.element; + e=e.next; + return ob; + } + + }; + } private static class Entry{ Object element; Entry next; @@ -25,11 +46,14 @@ public void add(Object ob){ Entry e=new Entry(ob); if(size==0){ head=e; + //head.next=e; + //head.prev=e; }else{ pred.next=e; e.prev=pred; } pred=e; + //head.prev=e; size++; } From fc4242dc30bff9ff0dfb8553495e11a3a9deeda3 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 24 Oct 2017 00:18:04 +0300 Subject: [PATCH 21/29] Correction --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 68fa45d..34f2cd4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /nbproject/private/ -/build/ \ No newline at end of file +/build/ +*.class +*.xml \ No newline at end of file From 1bf85303241f84b5d74fb5cbb878db6f57777bcd Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 24 Oct 2017 19:50:48 +0300 Subject: [PATCH 22/29] Update and correct --- nbproject/private/private.xml | 5 +- src/Other/MyOwnArrayList.java | 96 ------------ src/Other/MyOwnLinkedList.java | 121 --------------- .../EmptyArrayException.java | 2 +- .../InconveninentShapeException.java | 2 +- .../ModelNotFittedException.java | 2 +- src/{Other => other}/HomeWork.java | 3 +- src/{Other => other}/MathService.java | 6 +- src/other/MyOwnArrayList.java | 129 ++++++++++++++++ src/other/MyOwnLinkedList.java | 141 ++++++++++++++++++ src/{Other => other}/NewClass.java | 2 +- .../{Model => model}/AbstractModel.java | 2 +- .../{Model => model}/Boosting.java | 2 +- .../{Model => model}/KNeighbourhood.java | 2 +- .../{Model => model}/LinearKernel.java | 2 +- .../{Model => model}/NaiveBayes.java | 6 +- .../{Model => model}/NormalKernel.java | 2 +- .../preprocessing/LogisticRegression.java | 10 +- .../preprocessing/MlModel.java | 4 +- src/result/{Other => other}/DAO.java | 2 +- .../{Other => other}/DAOImplementation.java | 2 +- .../ModelSelectionHibernateEntity.java | 2 +- .../ReviewHibernateEntity.java | 2 +- src/result/{Other => other}/SwingModel.java | 2 +- .../{Other => other}/SwingTraining.java | 2 +- .../{WorkFiles => workFiles}/FileReader.java | 2 +- .../{WorkFiles => workFiles}/FileWorker.java | 2 +- .../{WorkFiles => workFiles}/FileWriter.java | 2 +- 28 files changed, 306 insertions(+), 251 deletions(-) delete mode 100644 src/Other/MyOwnArrayList.java delete mode 100644 src/Other/MyOwnLinkedList.java rename src/{Exeptions => exceptions}/EmptyArrayException.java (96%) rename src/{Exeptions => exceptions}/InconveninentShapeException.java (96%) rename src/{Exeptions => exceptions}/ModelNotFittedException.java (96%) rename src/{Other => other}/HomeWork.java (96%) rename src/{Other => other}/MathService.java (95%) create mode 100644 src/other/MyOwnArrayList.java create mode 100644 src/other/MyOwnLinkedList.java rename src/{Other => other}/NewClass.java (97%) rename src/result/machinelearning/{Model => model}/AbstractModel.java (86%) rename src/result/machinelearning/{Model => model}/Boosting.java (87%) rename src/result/machinelearning/{Model => model}/KNeighbourhood.java (87%) rename src/result/machinelearning/{Model => model}/LinearKernel.java (87%) rename src/result/machinelearning/{Model => model}/NaiveBayes.java (95%) rename src/result/machinelearning/{Model => model}/NormalKernel.java (87%) rename src/result/{Other => other}/DAO.java (91%) rename src/result/{Other => other}/DAOImplementation.java (92%) rename src/result/{Other => other}/ModelSelectionHibernateEntity.java (92%) rename src/result/{Other => other}/ReviewHibernateEntity.java (92%) rename src/result/{Other => other}/SwingModel.java (91%) rename src/result/{Other => other}/SwingTraining.java (91%) rename src/result/{WorkFiles => workFiles}/FileReader.java (91%) rename src/result/{WorkFiles => workFiles}/FileWorker.java (90%) rename src/result/{WorkFiles => workFiles}/FileWriter.java (91%) diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 3db8086..d24b155 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,8 +3,9 @@ - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/HomeWork.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnArrayList.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/NewClass.java + file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnLinkedList.java diff --git a/src/Other/MyOwnArrayList.java b/src/Other/MyOwnArrayList.java deleted file mode 100644 index 148feaa..0000000 --- a/src/Other/MyOwnArrayList.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; -import java.util.ArrayList; -import java.lang.Exception; -import java.util.Iterator; -/** - * - * @author User - */ -public class MyOwnArrayList implements Iterable{ - private Object[] ElementData; - MyOwnArrayList(){ - this(10); - } - MyOwnArrayList(int i){ - if (i < 0) - throw new IllegalArgumentException("Illegal Capacity: "+i); - this.ElementData=new Object[i]; - } - public void add(Object ob){ - int i=0; - for(i=0;i0; - } - public void remove(int index){ - System.arraycopy(ElementData, index+1, ElementData, index, ElementData.length-index-1); - ElementData[ElementData.length-1] = null; - Object[] NewElementData=new Object[ElementData.length-1]; - System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length-1); - ElementData=new Object[NewElementData.length]; - ElementData=NewElementData; - - } - public void remove(Object ob){ - int index=0; - for(int i=0;i0){ - Object[]NewElementData=new Object[ElementData.length+1]; - System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length); - ElementData=new Object[NewElementData.length]; - ElementData=NewElementData; - } - } - /* - Для проверки методов - */ - public void showAll(){ - for(Object x:ElementData)System.out.println("Element: "+x); - } - - @Override - public Iterator iterator() { - return new Iterator(){ - int i=0; - @Override - public boolean hasNext() { - return(ElementData[i]!=null); - } - - @Override - public Object next() { - return ElementData[i++]; - } - }; - } -} diff --git a/src/Other/MyOwnLinkedList.java b/src/Other/MyOwnLinkedList.java deleted file mode 100644 index 76eba44..0000000 --- a/src/Other/MyOwnLinkedList.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -import java.util.Iterator; - -/** - * - * @author User - */ -public class MyOwnLinkedList implements Iterable{ - private int size; - private Entry head; - private Entry pred; - - @Override - public Iterator iterator() { - return new Iterator(){ - Entry e=head; - @Override - public boolean hasNext() { - return(e!=null); - } - - @Override - public Object next() { - Object ob=e.element; - e=e.next; - return ob; - } - - }; - } - private static class Entry{ - Object element; - Entry next; - Entry prev; - Entry(E element){ - this.element = element; - } - } - public void add(Object ob){ - Entry e=new Entry(ob); - if(size==0){ - head=e; - //head.next=e; - //head.prev=e; - }else{ - pred.next=e; - e.prev=pred; - } - pred=e; - //head.prev=e; - size++; - - } - public boolean contains(Object ob){ - Entry e=head; - while(e.next!=null){ - if(e.element.equals(ob))return true; - e=e.next; - } - return false; - } - public void remove(Object ob){ - Entry e=head; - size--; - do{ - if(size==0){ - head=null; - break; - } - if(e.element.equals(ob))if(head.element.equals(ob)){ - poll(); - break; - } - else if(e.next==null){ - e.prev.next=null; - break; - }else{ - e.next.prev=e.prev; - e.prev.next=e.next; - break; - } - e=e.next; - }while(e!=null); - } - public void set(int index, Object ob){ - Entry e=head; - for(int i=0;i e=head; - head=head.next; - head.prev=null; - return e.element; - } - /* - Для проверки методов - */ - public void showAll(){ - Entry e=head; - while(e.next!=null){ - System.out.println(e.element); - e=e.next; - } - System.out.println(e.element); - } -} diff --git a/src/Exeptions/EmptyArrayException.java b/src/exceptions/EmptyArrayException.java similarity index 96% rename from src/Exeptions/EmptyArrayException.java rename to src/exceptions/EmptyArrayException.java index f84f9fd..b95ae07 100644 --- a/src/Exeptions/EmptyArrayException.java +++ b/src/exceptions/EmptyArrayException.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Exeptions; +package exceptions; /** * diff --git a/src/Exeptions/InconveninentShapeException.java b/src/exceptions/InconveninentShapeException.java similarity index 96% rename from src/Exeptions/InconveninentShapeException.java rename to src/exceptions/InconveninentShapeException.java index 2a9f866..f523b86 100644 --- a/src/Exeptions/InconveninentShapeException.java +++ b/src/exceptions/InconveninentShapeException.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Exeptions; +package exceptions; /** * diff --git a/src/Exeptions/ModelNotFittedException.java b/src/exceptions/ModelNotFittedException.java similarity index 96% rename from src/Exeptions/ModelNotFittedException.java rename to src/exceptions/ModelNotFittedException.java index 668350b..84e3fc5 100644 --- a/src/Exeptions/ModelNotFittedException.java +++ b/src/exceptions/ModelNotFittedException.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Exeptions; +package exceptions; /** * diff --git a/src/Other/HomeWork.java b/src/other/HomeWork.java similarity index 96% rename from src/Other/HomeWork.java rename to src/other/HomeWork.java index eb2b84c..9c250cc 100644 --- a/src/Other/HomeWork.java +++ b/src/other/HomeWork.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package result.machinelearning.preprocessing; +package other; import java.io.BufferedReader; import java.io.File; @@ -14,6 +14,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import result.machinelearning.preprocessing.LogisticRegression; /** * diff --git a/src/Other/MathService.java b/src/other/MathService.java similarity index 95% rename from src/Other/MathService.java rename to src/other/MathService.java index 2b3c768..4c626c5 100644 --- a/src/Other/MathService.java +++ b/src/other/MathService.java @@ -3,9 +3,9 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; -import Exeptions.EmptyArrayException; -import Exeptions.InconveninentShapeException; +package other; +import exceptions.EmptyArrayException; +import exceptions.InconveninentShapeException; /** * diff --git a/src/other/MyOwnArrayList.java b/src/other/MyOwnArrayList.java new file mode 100644 index 0000000..4a50ffe --- /dev/null +++ b/src/other/MyOwnArrayList.java @@ -0,0 +1,129 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.util.ArrayList; +import java.lang.Exception; +import java.util.Iterator; + +/** + * + * @author User + */ +public class MyOwnArrayList implements Iterable { + + private Object[] ElementData; + + MyOwnArrayList() { + this(10); + } + + MyOwnArrayList(int i) { + if (i < 0) { + throw new IllegalArgumentException("Illegal Capacity: " + i); + } + this.ElementData = new Object[i]; + } + + public void add(Object ob) { + int i = 0; + for (i = 0; i < ElementData.length; i++) { + if (ElementData[i] == null) { + break; + } + } + if (i == ElementData.length) { + ensureCapacity(ElementData.length + 1); + } + ElementData[i] = ob; + } + + public int size() { + int length = ElementData.length; + return length; + } + + public int indexOf(Object ob) { + int index = 0; + for (int i = 0; i < ElementData.length; i++) { + if (ob.equals(ElementData[i])) { + return i; + } + } + return -1; + } + + public boolean contains(Object ob) { + return indexOf(ob) > 0; + } + + public void remove(int index) { + System.arraycopy(ElementData, index + 1, ElementData, index, ElementData.length - index - 1); + ElementData[ElementData.length - 1] = null; + Object[] NewElementData = new Object[ElementData.length - 1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length - 1); + ElementData = new Object[NewElementData.length]; + ElementData = NewElementData; + + } + + public void remove(Object ob) { + int index = 0; + for (int i = 0; i < ElementData.length; i++) { + if (ob.equals(ElementData[i])) { + index = i; + break; + } + } + remove(index); + } + + public void set(int index, Object ob) { + ElementData[index] = ob; + } + + public void clear() { + for (int i = 0; i < ElementData.length; i++) { + ElementData[i] = null; + } + ElementData = new Object[0]; + } + + private void ensureCapacity(int copacity) { + if (copacity - ElementData.length > 0) { + Object[] NewElementData = new Object[ElementData.length + 1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length); + ElementData = new Object[NewElementData.length]; + ElementData = NewElementData; + } + } + + /* + Для проверки методов + */ + public void showAll() { + for (Object x : ElementData) { + System.out.println("Element: " + x); + } + } + + @Override + public Iterator iterator() { + return new Iterator() { + int i = 0; + + @Override + public boolean hasNext() { + return (ElementData[i] != null); + } + + @Override + public Object next() { + return ElementData[i++]; + } + }; + } +} diff --git a/src/other/MyOwnLinkedList.java b/src/other/MyOwnLinkedList.java new file mode 100644 index 0000000..2896331 --- /dev/null +++ b/src/other/MyOwnLinkedList.java @@ -0,0 +1,141 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.util.Iterator; + +/** + * + * @author User + */ +public class MyOwnLinkedList implements Iterable { + + private int size; + private Entry head; + private Entry pred; + + @Override + public Iterator iterator() { + return new Iterator() { + Entry e = head; + + @Override + public boolean hasNext() { + return (e != null); + } + + @Override + public Object next() { + Object ob = e.element; + e = e.next; + return ob; + } + + }; + } + + private static class Entry { + + Object element; + Entry next; + Entry prev; + + Entry(E element) { + this.element = element; + } + } + + public void add(Object ob) { + Entry e = new Entry(ob); + if (size == 0) { + head = e; + //head.next=e; + //head.prev=e; + } else { + pred.next = e; + e.prev = pred; + } + pred = e; + //head.prev=e; + size++; + + } + + public boolean contains(Object ob) { + Entry e = head; + while (e.next != null) { + if (e.element.equals(ob)) { + return true; + } + e = e.next; + } + return false; + } + + public void remove(Object ob) { + Entry e = head; + size--; + do { + if (size == 0) { + head = null; + break; + } + if (e.element.equals(ob)) { + if (head.element.equals(ob)) { + poll(); + break; + } else if (e.next == null) { + e.prev.next = null; + break; + } else { + e.next.prev = e.prev; + e.prev.next = e.next; + break; + } + } + e = e.next; + } while (e != null); + } + + public void set(int index, Object ob) { + Entry e = head; + for (int i = 0; i < size; i++) { + if (i == index) { + e.element = ob; + } + e = e.next; + } + } + + public Object peek() { + return head.element; + } + + public void addAll(Object[] ob) { + for (Object x : ob) { + add(x); + } + } + + public Object poll() { + Entry e = head; + head = head.next; + head.prev = null; + return e.element; + } + + /* + Для проверки методов + */ + public void showAll() { + Entry e = head; + while (e.next != null) { + System.out.println(e.element); + e = e.next; + } + System.out.println(e.element); + } +} diff --git a/src/Other/NewClass.java b/src/other/NewClass.java similarity index 97% rename from src/Other/NewClass.java rename to src/other/NewClass.java index da54811..5a59264 100644 --- a/src/Other/NewClass.java +++ b/src/other/NewClass.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package other; import java.util.Iterator; diff --git a/src/result/machinelearning/Model/AbstractModel.java b/src/result/machinelearning/model/AbstractModel.java similarity index 86% rename from src/result/machinelearning/Model/AbstractModel.java rename to src/result/machinelearning/model/AbstractModel.java index 3482291..4ed2fd3 100644 --- a/src/result/machinelearning/Model/AbstractModel.java +++ b/src/result/machinelearning/model/AbstractModel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.model; /** * diff --git a/src/result/machinelearning/Model/Boosting.java b/src/result/machinelearning/model/Boosting.java similarity index 87% rename from src/result/machinelearning/Model/Boosting.java rename to src/result/machinelearning/model/Boosting.java index 7e45961..e407ac0 100644 --- a/src/result/machinelearning/Model/Boosting.java +++ b/src/result/machinelearning/model/Boosting.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.model; /** * diff --git a/src/result/machinelearning/Model/KNeighbourhood.java b/src/result/machinelearning/model/KNeighbourhood.java similarity index 87% rename from src/result/machinelearning/Model/KNeighbourhood.java rename to src/result/machinelearning/model/KNeighbourhood.java index e817831..7d652f3 100644 --- a/src/result/machinelearning/Model/KNeighbourhood.java +++ b/src/result/machinelearning/model/KNeighbourhood.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.model; /** * diff --git a/src/result/machinelearning/Model/LinearKernel.java b/src/result/machinelearning/model/LinearKernel.java similarity index 87% rename from src/result/machinelearning/Model/LinearKernel.java rename to src/result/machinelearning/model/LinearKernel.java index 0891ac2..3b7625a 100644 --- a/src/result/machinelearning/Model/LinearKernel.java +++ b/src/result/machinelearning/model/LinearKernel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.model; /** * diff --git a/src/result/machinelearning/Model/NaiveBayes.java b/src/result/machinelearning/model/NaiveBayes.java similarity index 95% rename from src/result/machinelearning/Model/NaiveBayes.java rename to src/result/machinelearning/model/NaiveBayes.java index 70423bc..15714c2 100644 --- a/src/result/machinelearning/Model/NaiveBayes.java +++ b/src/result/machinelearning/model/NaiveBayes.java @@ -3,10 +3,10 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package result.machinelearning.Model; +package result.machinelearning.model; -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; import java.io.IOException; import result.machinelearning.preprocessing.MlModel; diff --git a/src/result/machinelearning/Model/NormalKernel.java b/src/result/machinelearning/model/NormalKernel.java similarity index 87% rename from src/result/machinelearning/Model/NormalKernel.java rename to src/result/machinelearning/model/NormalKernel.java index 15e5193..895b653 100644 --- a/src/result/machinelearning/Model/NormalKernel.java +++ b/src/result/machinelearning/model/NormalKernel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package MachineLearning.Model; +package result.machinelearning.model; /** * diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 745a3a8..c984737 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -5,12 +5,12 @@ */ package result.machinelearning.preprocessing; -import Exeptions.EmptyArrayException; -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; +import exceptions.EmptyArrayException; +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; import java.io.Serializable; import java.util.Random; -import Other.MathService; +import other.MathService; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -104,7 +104,7 @@ public double ss(double[] X){ * * @param X * @return - * @throws Exeptions.ModelNotFittedException + * @throws exceptions.ModelNotFittedException * @throws InconveninentShapeException */ @Override diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java index 300b881..c4a5dcd 100644 --- a/src/result/machinelearning/preprocessing/MlModel.java +++ b/src/result/machinelearning/preprocessing/MlModel.java @@ -5,8 +5,8 @@ */ package result.machinelearning.preprocessing; -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; import java.io.IOException; /** diff --git a/src/result/Other/DAO.java b/src/result/other/DAO.java similarity index 91% rename from src/result/Other/DAO.java rename to src/result/other/DAO.java index d33b691..380ef17 100644 --- a/src/result/Other/DAO.java +++ b/src/result/other/DAO.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/Other/DAOImplementation.java b/src/result/other/DAOImplementation.java similarity index 92% rename from src/result/Other/DAOImplementation.java rename to src/result/other/DAOImplementation.java index 623ce4b..ac2a0c2 100644 --- a/src/result/Other/DAOImplementation.java +++ b/src/result/other/DAOImplementation.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/Other/ModelSelectionHibernateEntity.java b/src/result/other/ModelSelectionHibernateEntity.java similarity index 92% rename from src/result/Other/ModelSelectionHibernateEntity.java rename to src/result/other/ModelSelectionHibernateEntity.java index f4f56c0..d2ff116 100644 --- a/src/result/Other/ModelSelectionHibernateEntity.java +++ b/src/result/other/ModelSelectionHibernateEntity.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/Other/ReviewHibernateEntity.java b/src/result/other/ReviewHibernateEntity.java similarity index 92% rename from src/result/Other/ReviewHibernateEntity.java rename to src/result/other/ReviewHibernateEntity.java index 3409488..79633cf 100644 --- a/src/result/Other/ReviewHibernateEntity.java +++ b/src/result/other/ReviewHibernateEntity.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/Other/SwingModel.java b/src/result/other/SwingModel.java similarity index 91% rename from src/result/Other/SwingModel.java rename to src/result/other/SwingModel.java index fea37dc..f591e48 100644 --- a/src/result/Other/SwingModel.java +++ b/src/result/other/SwingModel.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/Other/SwingTraining.java b/src/result/other/SwingTraining.java similarity index 91% rename from src/result/Other/SwingTraining.java rename to src/result/other/SwingTraining.java index 0809fe8..7ae56d3 100644 --- a/src/result/Other/SwingTraining.java +++ b/src/result/other/SwingTraining.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package Other; +package result.other; /** * diff --git a/src/result/WorkFiles/FileReader.java b/src/result/workFiles/FileReader.java similarity index 91% rename from src/result/WorkFiles/FileReader.java rename to src/result/workFiles/FileReader.java index 2057d9a..45fdc48 100644 --- a/src/result/WorkFiles/FileReader.java +++ b/src/result/workFiles/FileReader.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package WorkFiles; +package result.workFiles; /** * diff --git a/src/result/WorkFiles/FileWorker.java b/src/result/workFiles/FileWorker.java similarity index 90% rename from src/result/WorkFiles/FileWorker.java rename to src/result/workFiles/FileWorker.java index 9c053c7..cc0d055 100644 --- a/src/result/WorkFiles/FileWorker.java +++ b/src/result/workFiles/FileWorker.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package WorkFiles; +package result.workFiles; /** * diff --git a/src/result/WorkFiles/FileWriter.java b/src/result/workFiles/FileWriter.java similarity index 91% rename from src/result/WorkFiles/FileWriter.java rename to src/result/workFiles/FileWriter.java index 0242d4d..c0dc651 100644 --- a/src/result/WorkFiles/FileWriter.java +++ b/src/result/workFiles/FileWriter.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package WorkFiles; +package result.workFiles; /** * From bf954cca50534fedcc6dcdeb07bbcf710e14c310 Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 24 Oct 2017 20:31:19 +0300 Subject: [PATCH 23/29] Update & correct --- .gitignore | 4 +- .idea/vcs.xml | 6 - TextClassifierProject.iml | 13 - build.xml | 73 - build/classes/.netbeans_automatic_build | 0 build/classes/.netbeans_update_resources | 0 .../lectures/lecture03/AbstractAnimal.class | Bin 888 -> 0 bytes .../ru/caf82/lectures/lecture03/Animal.class | Bin 311 -> 0 bytes .../ru/caf82/lectures/lecture03/Cat.class | Bin 585 -> 0 bytes .../lecture03/CompositionExample.class | Bin 2152 -> 0 bytes .../caf82/lectures/lecture03/Crocodile.class | Bin 561 -> 0 bytes .../caf82/lectures/lecture03/Dishware.class | Bin 540 -> 0 bytes .../ru/caf82/lectures/lecture03/Dog.class | Bin 388 -> 0 bytes .../lecture03/InheritanceExample.class | Bin 997 -> 0 bytes .../lectures/lecture03/InterfaceExample.class | Bin 607 -> 0 bytes .../ru/caf82/lectures/lecture03/Kitty.class | Bin 531 -> 0 bytes .../lectures/lecture03/PassByValue.class | Bin 2205 -> 0 bytes .../lecture03/PolymorphysmExample.class | Bin 1203 -> 0 bytes .../caf82/lectures/lecture03/Season$1.class | Bin 782 -> 0 bytes .../ru/caf82/lectures/lecture03/Season.class | Bin 2423 -> 0 bytes .../ru/caf82/lectures/lecture03/Tiger.class | Bin 746 -> 0 bytes .../caf82/lectures/lecture03/Washable.class | Bin 136 -> 0 bytes .../ru/caf82/lectures/lecture03/Zoo.class | Bin 729 -> 0 bytes .../lecture04/ExceptionCatchingExample.class | Bin 1144 -> 0 bytes .../ExceptionCatchingIhExample.class | Bin 1094 -> 0 bytes .../lecture04/MyExceptionClassExample.class | Bin 1255 -> 0 bytes .../lecture04/StackTraceExample.class | Bin 1247 -> 0 bytes .../TemplateForMyExceptionClass.class | Bin 674 -> 0 bytes .../lecture04/ThrowExample$NegException.class | Bin 583 -> 0 bytes .../lectures/lecture04/ThrowExample.class | Bin 1658 -> 0 bytes .../lecture04/WorkWithExceptions.class | Bin 1473 -> 0 bytes .../Exeptions/EmptyArrayException.html | 301 ---- .../InconveninentShapeException.html | 301 ---- .../Exeptions/ModelNotFittedException.html | 223 --- .../MachineLearning/Model/AbstractModel.html | 242 --- .../MachineLearning/Model/Boosting.html | 243 --- .../MachineLearning/Model/KNeighbourhood.html | 247 --- .../MachineLearning/Model/LinearKernel.html | 248 --- .../MachineLearning/Model/NormalKernel.html | 248 --- .../Preprocessing/WordProcessor.html | 168 -- dist/javadoc/Other/DAO.html | 168 -- dist/javadoc/Other/DAOImplementation.html | 238 --- dist/javadoc/Other/MathService.html | 350 ---- .../Other/ModelSelectionHibernateEntity.html | 238 --- dist/javadoc/Other/MyOwnArrayList.html | 285 ---- dist/javadoc/WorkFiles/FileReader.html | 243 --- dist/javadoc/WorkFiles/FileWorker.html | 172 -- dist/javadoc/WorkFiles/FileWriter.html | 243 --- .../machinelearning/Model/NaiveBayes.html | 391 ----- .../preprocessing/CountVectorizer.html | 447 ------ .../preprocessing/LogisticRegression.html | 422 ----- .../preprocessing/MlModel.html | 291 ---- .../preprocessing/PorterStemmer.html | 290 ---- .../preprocessing/SequenceProcessor.html | 265 --- .../preprocessing/TfidfVectorizer.html | 333 ---- .../preprocessing/TfldfVectorizer.html | 243 --- .../preprocessing/Transformer.html | 172 -- .../lecture04/ExceptionCatchingExample.html | 272 ---- .../lecture04/ExceptionCatchingIhExample.html | 272 ---- .../lecture04/MyExceptionClassExample.html | 334 ---- .../lectures/lecture04/StackTraceExample.html | 273 ---- .../lecture04/ThrowExample.NegException.html | 227 --- .../lectures/lecture04/ThrowExample.html | 313 ---- .../lecture04/WorkWithExceptions.html | 278 ---- manifest.mf | 3 - nbproject/build-impl.xml | 1420 ----------------- nbproject/genfiles.properties | 8 - nbproject/private/private.properties | 2 - nbproject/private/private.xml | 10 - nbproject/project.properties | 74 - nbproject/project.xml | 15 - src/Exeptions/EmptyArrayException.java | 25 - .../InconveninentShapeException.java | 25 - src/Exeptions/ModelNotFittedException.java | 26 - src/Other/HomeWork.java | 60 - src/Other/MathService.java | 54 - src/Other/MyOwnArrayList.java | 96 -- src/Other/MyOwnLinkedList.java | 121 -- src/Other/NewClass.java | 26 - src/result/Other/DAO.java | 14 - src/result/Other/DAOImplementation.java | 14 - .../Other/ModelSelectionHibernateEntity.java | 14 - src/result/Other/ReviewHibernateEntity.java | 14 - src/result/Other/SwingModel.java | 14 - src/result/Other/SwingTraining.java | 14 - src/result/WorkFiles/FileReader.java | 14 - src/result/WorkFiles/FileWorker.java | 14 - src/result/WorkFiles/FileWriter.java | 14 - .../machinelearning/Model/AbstractModel.java | 14 - .../machinelearning/Model/Boosting.java | 14 - .../machinelearning/Model/KNeighbourhood.java | 14 - .../machinelearning/Model/LinearKernel.java | 14 - .../machinelearning/Model/NaiveBayes.java | 103 -- .../machinelearning/Model/NormalKernel.java | 14 - .../preprocessing/CountVectorizer.java | 206 --- .../preprocessing/LogisticRegression.java | 188 --- .../preprocessing/MlModel.java | 27 - .../preprocessing/PorterStemmer.java | 100 -- .../preprocessing/SequenceProcessor.java | 24 - .../preprocessing/TfidfVectorizer.java | 30 - .../preprocessing/Transformer.java | 14 - .../preprocessing/WordProcessor.java | 14 - .../lecture04/ExceptionCatchingExample.java | 21 - .../lecture04/ExceptionCatchingIhExample.java | 24 - .../lecture04/MyExceptionClassExample.java | 52 - .../lectures/lecture04/StackTraceExample.java | 32 - .../lectures/lecture04/ThrowExample.java | 51 - .../lecture04/WorkWithExceptions.java | 40 - 108 files changed, 2 insertions(+), 12162 deletions(-) delete mode 100644 .idea/vcs.xml delete mode 100644 TextClassifierProject.iml delete mode 100644 build.xml delete mode 100644 build/classes/.netbeans_automatic_build delete mode 100644 build/classes/.netbeans_update_resources delete mode 100644 build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Animal.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Cat.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/CompositionExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Crocodile.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Dishware.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Dog.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/InterfaceExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Kitty.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/PassByValue.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Season$1.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Season.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Tiger.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Washable.class delete mode 100644 build/classes/ru/caf82/lectures/lecture03/Zoo.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/MyExceptionClassExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/ThrowExample.class delete mode 100644 build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class delete mode 100644 dist/javadoc/Exeptions/EmptyArrayException.html delete mode 100644 dist/javadoc/Exeptions/InconveninentShapeException.html delete mode 100644 dist/javadoc/Exeptions/ModelNotFittedException.html delete mode 100644 dist/javadoc/MachineLearning/Model/AbstractModel.html delete mode 100644 dist/javadoc/MachineLearning/Model/Boosting.html delete mode 100644 dist/javadoc/MachineLearning/Model/KNeighbourhood.html delete mode 100644 dist/javadoc/MachineLearning/Model/LinearKernel.html delete mode 100644 dist/javadoc/MachineLearning/Model/NormalKernel.html delete mode 100644 dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html delete mode 100644 dist/javadoc/Other/DAO.html delete mode 100644 dist/javadoc/Other/DAOImplementation.html delete mode 100644 dist/javadoc/Other/MathService.html delete mode 100644 dist/javadoc/Other/ModelSelectionHibernateEntity.html delete mode 100644 dist/javadoc/Other/MyOwnArrayList.html delete mode 100644 dist/javadoc/WorkFiles/FileReader.html delete mode 100644 dist/javadoc/WorkFiles/FileWorker.html delete mode 100644 dist/javadoc/WorkFiles/FileWriter.html delete mode 100644 dist/javadoc/result/machinelearning/Model/NaiveBayes.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/MlModel.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html delete mode 100644 dist/javadoc/result/machinelearning/preprocessing/Transformer.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html delete mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html delete mode 100644 manifest.mf delete mode 100644 nbproject/build-impl.xml delete mode 100644 nbproject/genfiles.properties delete mode 100644 nbproject/private/private.properties delete mode 100644 nbproject/private/private.xml delete mode 100644 nbproject/project.properties delete mode 100644 nbproject/project.xml delete mode 100644 src/Exeptions/EmptyArrayException.java delete mode 100644 src/Exeptions/InconveninentShapeException.java delete mode 100644 src/Exeptions/ModelNotFittedException.java delete mode 100644 src/Other/HomeWork.java delete mode 100644 src/Other/MathService.java delete mode 100644 src/Other/MyOwnArrayList.java delete mode 100644 src/Other/MyOwnLinkedList.java delete mode 100644 src/Other/NewClass.java delete mode 100644 src/result/Other/DAO.java delete mode 100644 src/result/Other/DAOImplementation.java delete mode 100644 src/result/Other/ModelSelectionHibernateEntity.java delete mode 100644 src/result/Other/ReviewHibernateEntity.java delete mode 100644 src/result/Other/SwingModel.java delete mode 100644 src/result/Other/SwingTraining.java delete mode 100644 src/result/WorkFiles/FileReader.java delete mode 100644 src/result/WorkFiles/FileWorker.java delete mode 100644 src/result/WorkFiles/FileWriter.java delete mode 100644 src/result/machinelearning/Model/AbstractModel.java delete mode 100644 src/result/machinelearning/Model/Boosting.java delete mode 100644 src/result/machinelearning/Model/KNeighbourhood.java delete mode 100644 src/result/machinelearning/Model/LinearKernel.java delete mode 100644 src/result/machinelearning/Model/NaiveBayes.java delete mode 100644 src/result/machinelearning/Model/NormalKernel.java delete mode 100644 src/result/machinelearning/preprocessing/CountVectorizer.java delete mode 100644 src/result/machinelearning/preprocessing/LogisticRegression.java delete mode 100644 src/result/machinelearning/preprocessing/MlModel.java delete mode 100644 src/result/machinelearning/preprocessing/PorterStemmer.java delete mode 100644 src/result/machinelearning/preprocessing/SequenceProcessor.java delete mode 100644 src/result/machinelearning/preprocessing/TfidfVectorizer.java delete mode 100644 src/result/machinelearning/preprocessing/Transformer.java delete mode 100644 src/result/machinelearning/preprocessing/WordProcessor.java delete mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java delete mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java delete mode 100644 src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java delete mode 100644 src/ru/caf82/lectures/lecture04/StackTraceExample.java delete mode 100644 src/ru/caf82/lectures/lecture04/ThrowExample.java delete mode 100644 src/ru/caf82/lectures/lecture04/WorkWithExceptions.java diff --git a/.gitignore b/.gitignore index 34f2cd4..5f38543 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/nbproject/private/ -/build/ +/nbproject/* +/build/* *.class *.xml \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/TextClassifierProject.iml b/TextClassifierProject.iml deleted file mode 100644 index 560487b..0000000 --- a/TextClassifierProject.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.xml b/build.xml deleted file mode 100644 index 7fb9177..0000000 --- a/build.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - Builds, tests, and runs the project TextClassifierProject. - - - diff --git a/build/classes/.netbeans_automatic_build b/build/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000 diff --git a/build/classes/.netbeans_update_resources b/build/classes/.netbeans_update_resources deleted file mode 100644 index e69de29..0000000 diff --git a/build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class b/build/classes/ru/caf82/lectures/lecture03/AbstractAnimal.class deleted file mode 100644 index ea9922f8e3212beae3ffa684ea3900756e4c9f35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 888 zcma)4TWb?R6#iy+%_iHmiK%VXwz~D2tZBEleGn8O3PLfhLL`vKNixPMdkK3f4TO{U?A!9G0+!yC&{g(BKrYt>XO>mheDj4=p^x zV+%GMReNHhW}?nu`C^zfgD4AA26jXR9?F3GCp-`g)z&FL_#w zPtW%~U-Z)~7Rlda@4##Jk~HT1v^kYU^o5r)l<6ymwc635Jf+EMlc2tMD;4v~Jix9p zWWu%a6b**;fBn7Aq(2a`joYY_yW_DF(j*+2I5u{$Yom;c4G()Jp4r&PfsN}}W^n)C z14HGK^?mP@JkOQd<0KUU4LHi^U^VwBBku#vKc!a?JWylcqmc*)3_G37OprJ2i%&_1^iQC{8 z+Z(Pg8ajzY{OPQ1x)rW>7|fX89Se2CU{_TVHN>GzW%Cskv{Wp$RN=ub4_dxhz2ev0 zfsK9#Sy(3K9L%FYe@p946df#}#8CLBDMRTm#(pRR?la`lcCOFErdz#>wFqbxDxvL+ zd+m%=?r9`LUDc7`0ZlUc3rzF1Qj#B1-BPEpBdG~)?kv|(q>GqzAx1`H(VHQoDG71N z+om|p*(=XrE9N6I_ifHVo0W3cU|=1CZ(`|=ovAd(EC$llbV;m OiCA3`x-bc4F!})`@Oo|l diff --git a/build/classes/ru/caf82/lectures/lecture03/CompositionExample.class b/build/classes/ru/caf82/lectures/lecture03/CompositionExample.class deleted file mode 100644 index 5b60a853d688b522d6a35f8a33a43bcab844753e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2152 zcma)7dsiD(5dU2W*<@KB4KGo&JS7B5u+^4IAJDY4YABUdG}PB6+0vz(-MHCc(bJFM zm+%u*4+M`K{nvB+P#%AGHwYLE?m2sB?#$eo-^`ua{qwJ1e+Td`Ug#LdqJ||MEm(|W z5O*|WG~89}J+&I)_NGR|OM>G&E_!=^xMLHYtCS+ANd$fxs{ z)3#agtDadoV&<--Gtyt6WzpR_&+@LjMay`>a|>?KvQ2@>=AMrXmH+Qt_dNd_u1m}4 z4a>3oTLRT#q&8 zdRw!O>2I3Ssm$iws#h?x=8kDEIgaZ~<(^P_Pqbu{22|J&lzf_UTDZbKo1ct2RAp+nB%NU$-pHP1TLP_F$N~^_Bm#}PJz*8j+Pv&By9te zNE(#Ls)aWhof&51-xM%r zhX3hnZYgKO2Byyp&iQ-iX|z7^;`PJ4B8n^VmZORBy|vSFG*2x}fpPE?l5rc)HSlsu!y8btNNvNuoJ zhv63*C*s(CD4A)djwCk}@)IfLb}PPFVoGk6iS>n0EI0j#^XGF2Oj#m~o}dP&#R6Jc z8QGkjzO&L|AkCEi3SV*+xw~Sztfy{OmOYEruy+N-230a>PL9~b|0?Ja{;F@;=_SvT zyF5C1YI^^(QVSU2SACp+ln7r=7FVdL2q*_5pd1U*R=#W*2&BoqgvK8La6NSZkvc?6 z{s67}h>&f|M}I>!-JU!0J;gG9bM?e z6`>6!}h2RaF%ooI}G#17Fxt~1e9L$`uc z!-Yg5#rSIuBY9zZUyIIlC(gy_}`~W{n zoZWhR5HT>BnUgtZGRf=P^9z7Y%s9wn&_)rZZVWjnW7xuog;9q5t_-BvW9V91ZZKr4 zx+NI;Ycde0vELNoId3XLiZ$(V)!?B_@((a;u4KfpSPNs<;}_fOt`eS!LlJ!jYa4Dg z)ShlhC3YAr!OaO7gHzXW=!s*(8AhtwZ|g`Jse_|i?zfd#z2-N(01Mp~#tIn61aS_9 zlAhFYG-qM5fGJEfEc~lC!~9=$l|cGjF$^SKUB!b-w|*BH;nTb5n66u{r6*FmXQ2#C z-GqYsG*Iamn8s`;MJgcPQis@)Gz4GnEH^NV9Q{bLGGsI)7;K7M@{D|Lwf&|$pd;!CD*Mi)ii#bj`z^_g$Eb{29TjVzxopJ5m6Xa*!C*_;3na)yx~F8JMGu1=O0NWz^&msibYzQlk0`j$wNT diff --git a/build/classes/ru/caf82/lectures/lecture03/Dog.class b/build/classes/ru/caf82/lectures/lecture03/Dog.class deleted file mode 100644 index cc1a267328970cddb7a1633c82b5e383d9b4c441..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 388 zcmah_yH3ME5S(>POpGBAUIhh@DoKG6P#_W^p@1uk2IL~$#W~=jvoG=k!Dmq*Bnm!& zk3y^=w4l@7?u=&Ur1|)Kdk1igbr&|48>nH$LCe7^!Bu&XDVdJ-6M=?=dS9igI3w8Y zVJG4-Fk?w*hANd;Wipc4jTmWWTA_)Bjzp#^JR|MmUgd<{Ff097+@2izTE<10$^3UY zIPx#dU5|ghHf0veKviLz1CvZmt_o$+%SVw+wcMYG2jRiNnuj^m3ETf<688R5oTn-g znow(ZBJ6MnHg`gNIefM`m}jQJD1gNWaJ#Rd?$!&eXGRuWewWw_oU*^i+CCN-ZTzU= QVUZF0zEinTR#(2}7jV8&>Hq)$ diff --git a/build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class b/build/classes/ru/caf82/lectures/lecture03/InheritanceExample.class deleted file mode 100644 index c923df792f46b53a071a06817b3ea5075a77de51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 997 zcmb7?TWb?R6vzLQY_iFAZDVUwHQwSimzs@jAB3t9L?sZakPs+7$YdSUDSIiqv&DQY zMOsks1NfoDGn;A*m4N%OXU>^(e&;qnet!K9U6Aw((81heKAk{O5Y^^?IFrJ6+1;a{D24XMqMVkw=!*Ug&af$RnxsGozsn zWX#a+MTz6`50AGTPq-?HMEv{E-gdgdfrzByfh%5ovI_}lxuH$hy0j39uLM&Uqvz)r+kA)V`^~i zAJ+^yCC4ISu=-&Vx#FeNbJ{rHZcC$WEWtKWx6y#jP+c^!f#%w1>VQof57DyWpl#xj zjV)|5v=&95FMy#m>+bdFkaon-Sj3ngHN#TOC;QapbWesK9#gA-LHm zI!qZlZ)lQ=<|(*OOSe2Rjyrys1mwiJG}pAOc|Qj8NJn|J7o*m#4^c&tp0xh5pi*Gd z{{m?aNk%f)I0gGehYXhKpHGc>tk7Azk^@S(ND^4Z8d-GkQ<52yx#kHnvtTPV7GaQ+ z29&2xe*igL!a9W(>1N{$^^SZrs`3rl{Zkk{LZ;Zy$Tz>hJV9ZWpiI?(a0RN!rg}$h5lBc8AO+>_22)Zc4ssm?p9KdF9QXh} z3b6@LUMDUq&w6G(JAQe6dIqqAH4{^qE}>Dz3}y|?8JK4;C-!;h zaTTQaqgfzrpJBsMiS6^ty|x_+UnffRKM$MR_OaALU2-ty==6#EQiC5R%}G diff --git a/build/classes/ru/caf82/lectures/lecture03/Kitty.class b/build/classes/ru/caf82/lectures/lecture03/Kitty.class deleted file mode 100644 index 5b37e7ef7098e2c06d8b5861ad5e6766e269b92c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 531 zcmaiwO-}+b5Qg9KEutVI;!T4GFp)Lt!9-(Xj9%P`2?oyvDwOQDq+5vmD?OQb@CW## zjI#>{PI_qPqwg~_ov-hYPXMQ=WRbvT2BkE%(kQ2~&5*i~O4>_?c&*-MNL=flV92{t ziTknN5$2J1JjxVZ-Q`}J8yUv)WWo+)z)*F~*y-};vt!2-T{|`+_;rp>oI7dl^qe7M zb;}y5`V6I7-5v4?cRa58&MZrcsy6+G61F3_3K}gvHeKP0iSVwJ(w1AP6?H2uq0Naf zM)m~3*_r-UhSOFav^Vv&84ad^fAhlqktZ5q#~e~fGbE#-820`hoT0FowAmTb{}}fF z!k&0A2zP{C#A)BujFumxL!BwgkmrzPWRnN)U~kd$N+bxAWn}5j%>-B_59F_5or;9; e;T(<^W3Lp(ut0Z~(D)q9lO{z-Au6*G5yc-Cdv}Te diff --git a/build/classes/ru/caf82/lectures/lecture03/PassByValue.class b/build/classes/ru/caf82/lectures/lecture03/PassByValue.class deleted file mode 100644 index b77ff9149f7df15a646ed65d2e083332f44576cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2205 zcma)7TUQ%Z7~K+)%M8EuYBE zmWqsuM=Cy5u`LacReTmj7Ek16N5$t6JdNNB1>t$qHr)jU9f{Fx1;Kmef>6+tHf^z9 zE#-vs$jDi=#M9-xVQm|ZDfdld(A_gD3P#gTHI+Atx2IE<$h%cXR8AizXHuI+rLuIi zZCF(?N1ptiVeg7f$1Ityc_>zFmv2q1$d@YyuN4IYp3jyj3P;#^=_7W9!-GV6-#9c< z7AaCq>zqXPU0_!*=!gT$$cyttz1|x#u4CG}i;iO)N%9>Zi+9u@@3PE_yHQ*+>;jYR zyTD69ccGjqmjvr!?=Beyrc^Ran>WMRB`9D_$z@tWG*hlRd9iHDqQ-o+xhXT#@Fw2U z@FkvUFpyKwdoEw;l2mZ%LDjD4>m&MBxgz+6*qNgjI$a)CE3RqlOQv8S6=)|vp43l% zKY8)@Hz#!sqew=O*H8c>8El6yRZXiPQDdg<>IbLo(v6}k9Q}L~6Qla9uAzusx$J2$ zu^+*64HiloCU8^1WV2&>Ik(R-X`yOw(Mvj8!=waHT?l?fgBxfjoE8QBi8weAmh44z z)3l%K%U1b_{h?B(z<%8Ds-C&bU>y{U{7*%+ zG;X6&7X>Oy-q1@!l@vteP^xF6D2H@q)HkKgqEJ`<{vTCbQ6jcnrMCJ#ce9+L=4_Xd z3!_9p*kE03R${_0Dlf4)|2sTWa~=r1+8RRpvFesRlY+~M^E@QzYs^|}K+KUdX1f;q z)PGSx6nRUaUakH!P_HCa*R)a%iBlybEgF9%#~i=SIxqQ)K#`*4`Zjkd-Z?x7C6A%} z#D@TGa1A$%D&FC<<~d*l3GP&>Gg>5gnwJCzzx89I{mO{f1yR#&klf?KE*l z)#sz>dPzg+G-+-%X~M}+Je+A~7(fVvK87%6_}?e9qK=vj3;f%Yfy6?8Ad>BftC?&t z-kCWU%@w9J#dS2F7pbqx6cR|%l$4c4@`PWEyD diff --git a/build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class b/build/classes/ru/caf82/lectures/lecture03/PolymorphysmExample.class deleted file mode 100644 index 7f655f9a4d5c7461eefec9cb835f0557c56a3c77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1203 zcma)5*-{fh6g^FrNyfp1u&XGD#)NIyR21aF?S-gRVa2k1YLYP-oFz4xi1{pi2$od& z0e+O_=}9O=QYjy1ZujkT&$&zYuirm@0@%c^jx6$N+(SV_QAZ5<6c&_SR3}Sn#osbk zG?+Scy~?H1#jh{Lr<>c zSEN&xfvxsEXFROiO@Xyi&@wCXV~=RJ8jnw8ufP5eep%Q4aeH1 z(6MaR1&W1%vF`{{dfO_ulnUu)lmEXc%DB?@1SSd}N=NduG#%;H%!4qny;{T>mqCpc zjP^MeNPM!xuq`k@P;F0vSW&8KH|xhTV6z6N_q>N=jDFy^f{OLhRxO_D)2S7ewSf`j zG;A8Uj|T#i|5oy}Wjj?X5J*=XOM0wr*1$t-8F+-p8nzAW;EBN8peaRF2;3QjIZNEY z6s85tLD)XE2xQMQe{*=mt8&40&~Ap7%bV!8cre}_nC+YUoL0!0S<+?8lCsgTysE%* zq0dM!xq7`(^9lX#;04AC#Y;dUMx*pDDhg-~rSI?-jrUV5V~+1B%Qp$WIH5+x|0s7R zt)NXToIrf#VhCgWCnIMP<6IkE046ZWT}t(p9u>S7kpVN`Fm#I8`xC@-i4Kwr9cVNi zq&i5Slji&1{sA|pBj5l4 diff --git a/build/classes/ru/caf82/lectures/lecture03/Season$1.class b/build/classes/ru/caf82/lectures/lecture03/Season$1.class deleted file mode 100644 index 9c0ec618d94feee2127147e70cb1a2e5b89bccf2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 782 zcma)4+iuf95Ivi?wv)QlEu~G%trRyGZZ0h#BoId1lU8&CK!a?C(E6PXRo_y)qWDR6+@r5}{>DS2SFe@z4k@jx)lc7jN_+55goy1XCK$$TgFdAQG$K=Sj$8E?e>ccggE%U+x%zGwxq zV){(!!7)GK)Ug@)VVnlhkt0UKc%Wg;z-?FtrePRZN7Xo$abln$)9y%j7gYut)XoRB$AgZ+#+H31Z#`r%+EFBuosg%gNEytD!fyYVZir#+ z;zkVW2@f;bpjK}jb}p`XMkNPrx7*yKKmEUaElvhO#KU|Yv>$c5*X=nj0k7vcvXSb& z*=xJ6%vE|9WqK#ftjHUb2s&nPiQ+7=Pbd-sT0g)}f0e(X@Kt`r?@*N8&rn|HR3$n! zp&C(jLUp2APQO4Qy#*{`3Kd#gm0}H>cuesLw(*i;5hm%Wx#}|J2p7oa$rhm>Xq4gn Z>!{*#p0$806cx$?R>{iLqeKy={uf@xtbzal diff --git a/build/classes/ru/caf82/lectures/lecture03/Season.class b/build/classes/ru/caf82/lectures/lecture03/Season.class deleted file mode 100644 index 591f422e61df6f7f38bec02ed94cc2c7a5c831b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2423 zcma)7-BS}+6#p&x*iBd!gJ4mLhyeqL@w-;3HC42+Nl+HB6#H=rOITfY>1G#8KOWlY zW1srchtBl1(>~c)k!h>rbD!cr)af~QLkWc$$;|Gad++)9opXNY=I?+0cn;tkzDgj9 zTS>f!f{GCp#U%Pr;@3Ez+)m&a?j%W?NWj3PhN&c`aaY6p8fG+nz)G{cb&r)kOyVPa z%+e?P5*qq7%&}Nz#d!_KHJB_eXvk=&u(+sUP=lr7zKRD5^t|Jk-ZfiPt7cU}{BFK9 zIX0mnUGRczSu9*UleNvVA9!YULpXIdYnYSW?jH z1=Xr0oRU~F6{HIH#fr$_1zsK01YdI`g-ID*TrpkoK?K~mjYG5v|=8Xw3EZg;AneVNMb7hT6+td1{) zt>XgjCP9u9ugY#K*kkyj{Gce7H_}`ZmZP9EGrK)38%Bj!p19Vd9mMs(O%QqcEmM(a2ON5=)YI)*T; zV;P_7@K9CZ>jp#@j>wncBaRzVb=*Iw6r~ZBY$;+?n&v^Sd?`ZWOY3G~za~+vb z<0m?QQh)aHJ0jKQm~s>7B6xMx(x(-~%C_rJ{kL*(eC|G79@L}r%^a4u&E=+cH!g%` z_HuBt>uk1bsO6b0BWdHI<(C(Ujf5~QZ>sdhO|>DMI-B00d&_K|Cf@btEl1c2h;p=U z+f3G2tx~h-zzwJa9U(Z&&EDqOp}?kKIPKD4>o&QS17_1GY#G%?@{BeN6!?~%&3T?! zrK!+-H_V4ev3Wu^%(mC(>S?;a`{<7(ezl963(%KZD!|#f!D)KOkETlI_d>0YIP8vhQ-A@r88hHZsH>txh_tGhWrP%w?iWL1(0-a>Z9xuv# zSmKN#c$0QpaET%j=NtGqFUA)e`W@>3p>;@iA+%V-U4o~kVf+iZW8;Y$w4pU5PX0;@ z`sL~2eTLmj52tj2o?MOU(7FcwXB=g5j}$vu+$+Ua7Wa|J2}Wd*2B@4s7tPyYDn~aJ zwuj&!Aq+=xgW8ct8h5Cbn?;QUc-L+ ztRuCKb_zbcjsxL#M*~XOuR~O2P%WdBP%ClbAOSi|z3wMan{^++HC!h><{JYczG94^ zhWz;!F**b8{fX#Isxy*0_!O@_MweV3ilz?BWw%_u9!vGeT)WiCxSIE+TQ1td7wa GZQ8$aj)mJ zJy59!9)O2J%q9g|6oC)BGo%0iX2$mSALriyJj1q+QVGzLdK{=a*X3L8w&(8+dJhZTiMe`WR#UUp|_u9HcqMM%mNG3)*%{L_s|Zp zfrq@ODYb`Ah)rw>Z2Wg}ft`P8`oqE+nb^KonM?(iyL*>LA6TRGXxF{jn|~G>d?_qt zJW5_#fu)&V<-tMWQ#;XSqxW?IY&IRB8 zj@J}tsGM+ILC9yoH?YdSHC*Q?oat}_i=6S~Q-x!^V5MU;PEl>vzGC5T$U3)fUxG9) gAh+05XKQl`Z2cbU3a~y0*kR!293cN8jH+PiC;f??s{jB1 diff --git a/build/classes/ru/caf82/lectures/lecture03/Washable.class b/build/classes/ru/caf82/lectures/lecture03/Washable.class deleted file mode 100644 index 79fdc8fc8dc1e917bd6c7ea3ed5adde3803c6c6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmX^0Z`VEs1_l!bc6J6FN=N*WRNp3h@lL+bPVelVbHlJUG4-7 zh4YdhSvJ31S+E>ohmkLW@5B6}wUOvn8JgFmC&P7yV)0)U(-j77Q(Xv#_LB6(LF872 zf6A*4WpX8DbEm?68OL8qExeLsX#7t z%B`zFhEjQ3x7@8eV(yyXa1$-ao5;e@F=}EA<2oixOk#>*^shlsV}_0xVL9BZS%=kY zn%1vW`7Q{BOSV)*Ke|haSSsttmtI&7eZgJwo^Oz*2dT#*hc4A!{47kmP?hv*tJ4*7 zs?)0ij25}4Jx!|xCS_Xbw2c&ffHCt7HZ%K()ICKhw9(#{Xm_AtmumOWPPv{>H9F8q z5!EHsn4Uxai@8jiq~8P5IqeBeKS(1f-zQ542`;t~8~es}HHI`dfE*L#qydCRLC6$( FJ^<)DlX3t6 diff --git a/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class b/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingExample.class deleted file mode 100644 index 0a918cfc52f2f55a3fbba0a1dc7486779c1fc1e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1144 zcmbVLOHUI~6#i~IblPEBpg?^f()w&cJBSrfPy+-KNl}xUZd_f)u?)_mnNAHZ-MRB0 zn7DEaEGi+9AHZt*hm7a8&=&2=CcXDOzI)F1&AIpV_wfmU0-h@vLMDbAxT)Y4Zp*k6 z#a&@$6-dZMF|A+*_eA8rjC>TDfGWzj`6Z? zZyVklzHLz?S#))7mAPjM|12o^J7$exzUb98oxfk4(=0>x>z+|NH)adk`kro7ebaT; zxUcV+PGx^e zN@X%Vh&JgB*R#3bi;=ijA*!Q&Ix)mcKG#2N@#>i_rR3H<-PkaN^2tt_zXaq3XBER3 zkuj&@Aqp}cshGzC9qQ`o!6BU+_eUMHP?nguc)gx4DcZ70Y-k z5;Uo)ZtcEm>4OH}gI~c(a2V{TsliF}bMtF(oM9;Z&!8BFyB%L`@6w1bgi4=kzG2f1 za_f{BZx6$CwbwL9pQdSWn}#&ns&O&QAXf#*qDvrUUx<;9XM2X(a}}b#+x8g7vbldT z42dquqU%%`VpZlDtK1GW0|6JY^SD8wU9-4kS`D3&HUGla;K7>(pC5Th01D;THg nY=ZnNxJpd5mNn5*v5IS$B*b<4t912bNJ&}-la!sJSP1Dq9JC$} diff --git a/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class b/build/classes/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.class deleted file mode 100644 index a50980c3529274b3eefa86b5cd98f84f2a236595..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1094 zcmbVLO-~b16g{sko#}L-$d}*JB47dOAR?j|Hv|$$L6a&QSC4TlgPoaXIyJb%7!!B= z0~1%QOaucG68ZyNz4=4N`&ytSuyT@_ckj9Po_lWYn?HY#Y5=A%tDznJ38axxF`(ft z1~m*}SiwCNS!s@Fh+|a2n2P%f#uelk;?Hc?4xTeavm>hvu{rOp#gNL|uC-Ei)-3-O zUn>#PmG?|uTIIei{Sz=2tlJfanY>>$O#W_W(kNMGQ1z|KsWCBS%x{`jIj}u-rTYr&Qi_n*;R5T27-b#x%5z|b*)2Qt}R4!BbM-Bsmks zFe<)WM49^)t6}$MTUK|v`lZvM&vP*-WyxHk zI}^(;$s2NMIpJ#HHOLrxvLhE;AOoF#82Lm%5|N^BCwT^)jLx>v-(b7-@D=*T>tGaJ zWb2Itbfbs71bWd&h%EkrDA57AJw&>qhlm}ZZ3hE+=_&_M=^Q&if~+0rbu>x#ZoMW+ zBH~n=#2_@{kzI$09mJfZ4jqJ~sQ*>!n<0OYx(`wBaYCf3G}ScX*GSC}RKl;5$_4{FU@$`86^BAL{0oMm;_?|oa?igI3}Y4B6GxGI zE`n2j?$Al5;#awI#sgdJ+lNWnutSEeN)TC9UVF7}Iif0~K!mr8wN2~rYX7n-n$q^Y zJ%@+k{v~&tj@Y3dY7FT&wr9&-hRI^(1OLb^hkJFald+?kVpKmj&`S*$4^&95H~T~e zwpWi+Gp-0jUKi!aagJ+my}Ah0EZs`&SOU4+_89WT_kVk1Wq44hS+fJ&q~wVo1yxbD zl~l8LOuVY9YItE{9UCT0+|#gWVhhtIMloh0-!cQzwyRJImtKt@$tVSP6K_}z1dW}Tv8~FlO`ijIghCb7A0{6)p^jB6PGPE*V zp~&I^?SNbdvq2tJB2~IZvL7&tBn5T>sWyOK!T`VxQvHAo0kU@hCaA6&WS4qX-KI+` zH%Rvr@?4)J$pS8xmdKD2AxYG<7rs9kV@5qr)^} zsg)x1$OiSNb$Km~=cvCz4=dearK!e4V(55;xi)K?`crD_bZMF4Yv}#B1q@@cM=+h> N^OV5wm}~+IzX2Jt<@Nvo diff --git a/build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class b/build/classes/ru/caf82/lectures/lecture04/StackTraceExample.class deleted file mode 100644 index 98a7e659fcf383669deacb72ae3eea955422eb31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1247 zcmb7EO-~b16g{sUI_)sE$VZXV0xD<=!XTm|UoH&B#DXRzMC0mFhBDYrn_+5j?;p{P zYg_=)1o!?De}#D7P-w9x#!2RV+&S;wbMATVk6&L;0L-ft8;cRY0KzmZ%vIP=($FGK3E)5VEx~%KM zfQz=qOSaz>CNPrC{p(0enZkQ|SD}T~I*T>zajMo!_LpfrTUKb#V3Sv~)XEtJnnwn! zw!c%|T9Xy_xi_0@x9YsXmval~HC3rhhx@Yar*a#(&O09Gj|1p{P*!p5;?CkMRCN3Z z;(&_~u5ye7!3es!HqQX)K`(bv(DD-}OX1~A`V$5w zGBfkq7jz70hlm_P{}2|RPk$Z+38PFELO3XwVnHCrh{3UwwwuUuo?dIO*b-BHbh0kEe%g$ Ngsv%;H#mlH^EZuQ0J#7F diff --git a/build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class b/build/classes/ru/caf82/lectures/lecture04/TemplateForMyExceptionClass.class deleted file mode 100644 index 8e9a99f346aaf61f1cee89926d25ca72eb1d79fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 674 zcmbV}O;5r=5Qg97qg6yv6vU5%M}&kLAW?(iLf}-rK)5e;g__cmeklGdPb41v0sbiC zY(XGZFK)6kv)h?x-r0V9zP$se<0OS7a?<3bIaEQ-LkmnH5hV5{gFR$&Eob@>-w%~4;xa5Iu@SChhgU*2@HkxvL!UE zWK@$|gRZ_Zq`FSv8lq#$kxrv>+EY$aMMd^YLxC#Iwlv2Km;aoRVSlB6sUBy3S67mct0G$~W& uDy8xau_&QJO|_7apJ%NRc903F3U+^E#iOh$v1)&?_K+n8Jqsy`;ou8i-i#pt diff --git a/build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class b/build/classes/ru/caf82/lectures/lecture04/ThrowExample$NegException.class deleted file mode 100644 index 2afbf2d988a2a84d70f5f1591332add0986ba7ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 583 zcmbV~%}&BV6otZ3Z&<>lu2VE!jLPt@p6>K2$0nt2x*8l(j diff --git a/build/classes/ru/caf82/lectures/lecture04/ThrowExample.class b/build/classes/ru/caf82/lectures/lecture04/ThrowExample.class deleted file mode 100644 index 22536fcda8541a96102c6aabd4d28bac5c8dd8d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1658 zcma)6O-~zF6g_V|X6%U}#t@f4X-)G{n?jtVq)8hZ@*%2PxM?LKT2v|0*co6_f6(zb zrOhTy)DJ0b~k6;})PWj4Iy z+;dcqU^0_QWdwx9zglwwz4M-x|K>AmwcWt%5N8{`XgM4pp8Ps{*Scq=3sz}4J@2_r zY5B6^uGwn>Z+Gooa~*G`XnRh+149BA56$*uw{oo1Eq9qb1`g;iV9uATZr=XHQEK&f z4}C_ljbH$S0;7A(4`3%SE1&s~6aFulSV<3Ev`{%@)o`Cd5evFsaE;I@3KNIZ}=|5sU89VSRgF=!KLu;T;v z{aLOv+G@MwKPG81ulql;gfw5r&cJj8ALB{{!x%9z6Twwn6BuiDmAkSbU&?}l9JSAmrL;~-WeuN$nWUghPD_B zY(n21d8)kNVytHq#_sS);ZNoSnz(U(a1^=@1APb~M!Yw1q}eCl!lFOQ9HQbaT6`I4 z>(Kgo8Bw(we?iub;T`UhhgfU#xc?VIpXqnFu&C-n>d4b4t=*sTS(q5m{ z-r9#X)P)sk+I_^`ATe;n z5TnEc98RGOvU&*T7@ejZGu*jK`9GySN1?KmC;YSf(G@#8H%bKJHdqj diff --git a/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class b/build/classes/ru/caf82/lectures/lecture04/WorkWithExceptions.class deleted file mode 100644 index aff5b381d4fa5cdcac7f01a57edff6ad21fb4dd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1473 zcmaJ=?{Cvq6g@9ZYsa`P2_%KE4R_EsZK3H($JnSQO^A(2;fGX2h4}R9JYpBeuAG;Z z{zZIdA6kh@IB;>-#+r?`g>?rGez34%qKoG5o`p?;sjV;$^{)aGt>sq&4YG9=BZP6y)gDNb6d-6UY2btnqmT0 zH}M929SGd}+RUCF=H5Mucwm~58C2L*l|Q4i!Hf!{ zP23n^YGcN4c*drmSR;mSbIv{P4QF-b2-XL - - - - - -EmptyArrayException - - - - - - - - - - - - -
-
Exeptions
-

Class EmptyArrayException

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Throwable
    • -
    • -
        -
      • java.lang.Exception
      • -
      • -
          -
        • Exeptions.EmptyArrayException
        • -
        -
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    -
    public class EmptyArrayException
    -extends java.lang.Exception
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        EmptyArrayException

        -
        public EmptyArrayException()
        -
      • -
      - - - -
        -
      • -

        EmptyArrayException

        -
        public EmptyArrayException(java.lang.String message)
        -
      • -
      - - - -
        -
      • -

        EmptyArrayException

        -
        public EmptyArrayException(java.lang.String message,
        -                           java.lang.Throwable cause)
        -
      • -
      - - - -
        -
      • -

        EmptyArrayException

        -
        public EmptyArrayException(java.lang.Throwable cause)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Exeptions/InconveninentShapeException.html b/dist/javadoc/Exeptions/InconveninentShapeException.html deleted file mode 100644 index 9461a6d..0000000 --- a/dist/javadoc/Exeptions/InconveninentShapeException.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - -InconveninentShapeException - - - - - - - - - - - - -
-
Exeptions
-

Class InconveninentShapeException

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Throwable
    • -
    • -
        -
      • java.lang.Exception
      • -
      • -
          -
        • Exeptions.InconveninentShapeException
        • -
        -
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    -
    public class InconveninentShapeException
    -extends java.lang.Exception
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        InconveninentShapeException

        -
        public InconveninentShapeException()
        -
      • -
      - - - -
        -
      • -

        InconveninentShapeException

        -
        public InconveninentShapeException(java.lang.String message)
        -
      • -
      - - - -
        -
      • -

        InconveninentShapeException

        -
        public InconveninentShapeException(java.lang.String message,
        -                                   java.lang.Throwable cause)
        -
      • -
      - - - -
        -
      • -

        InconveninentShapeException

        -
        public InconveninentShapeException(java.lang.Throwable cause)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Exeptions/ModelNotFittedException.html b/dist/javadoc/Exeptions/ModelNotFittedException.html deleted file mode 100644 index b712f3e..0000000 --- a/dist/javadoc/Exeptions/ModelNotFittedException.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -ModelNotFittedException - - - - - - - - - - - - -
-
Exeptions
-

Class ModelNotFittedException

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Throwable
    • -
    • -
        -
      • java.lang.Exception
      • -
      • -
          -
        • Exeptions.ModelNotFittedException
        • -
        -
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    -
    public class ModelNotFittedException
    -extends java.lang.Exception
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Model/AbstractModel.html b/dist/javadoc/MachineLearning/Model/AbstractModel.html deleted file mode 100644 index e64c1b6..0000000 --- a/dist/javadoc/MachineLearning/Model/AbstractModel.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - -AbstractModel - - - - - - - - - - - - -
-
MachineLearning.Model
-

Class AbstractModel

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • MachineLearning.Model.AbstractModel
    • -
    -
  • -
-
-
    -
  • -
    -
    Direct Known Subclasses:
    -
    Boosting, KNeighbourhood
    -
    -
    -
    -
    public class AbstractModel
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      AbstractModel() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        AbstractModel

        -
        public AbstractModel()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Model/Boosting.html b/dist/javadoc/MachineLearning/Model/Boosting.html deleted file mode 100644 index 1a5a90f..0000000 --- a/dist/javadoc/MachineLearning/Model/Boosting.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - -Boosting - - - - - - - - - - - - -
-
MachineLearning.Model
-

Class Boosting

-
-
- -
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      Boosting() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Boosting

        -
        public Boosting()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Model/KNeighbourhood.html b/dist/javadoc/MachineLearning/Model/KNeighbourhood.html deleted file mode 100644 index 9fb30f7..0000000 --- a/dist/javadoc/MachineLearning/Model/KNeighbourhood.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - -KNeighbourhood - - - - - - - - - - - - -
-
MachineLearning.Model
-

Class KNeighbourhood

-
-
- -
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      KNeighbourhood() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        KNeighbourhood

        -
        public KNeighbourhood()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Model/LinearKernel.html b/dist/javadoc/MachineLearning/Model/LinearKernel.html deleted file mode 100644 index 44fee98..0000000 --- a/dist/javadoc/MachineLearning/Model/LinearKernel.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - -LinearKernel - - - - - - - - - - - - -
-
MachineLearning.Model
-

Class LinearKernel

-
-
- -
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      LinearKernel() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        LinearKernel

        -
        public LinearKernel()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Model/NormalKernel.html b/dist/javadoc/MachineLearning/Model/NormalKernel.html deleted file mode 100644 index fcc7bd7..0000000 --- a/dist/javadoc/MachineLearning/Model/NormalKernel.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - -NormalKernel - - - - - - - - - - - - -
-
MachineLearning.Model
-

Class NormalKernel

-
-
- -
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      NormalKernel() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        NormalKernel

        -
        public NormalKernel()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html b/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html deleted file mode 100644 index 0a83117..0000000 --- a/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -WordProcessor - - - - - - - - - - - - -
-
MachineLearning.Preprocessing
-

Interface WordProcessor

-
-
-
-
    -
  • -
    -
    -
    public interface WordProcessor
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Other/DAO.html b/dist/javadoc/Other/DAO.html deleted file mode 100644 index 208e1ea..0000000 --- a/dist/javadoc/Other/DAO.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -DAO - - - - - - - - - - - - -
-
Other
-

Interface DAO

-
-
-
-
    -
  • -
    -
    -
    public interface DAO
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Other/DAOImplementation.html b/dist/javadoc/Other/DAOImplementation.html deleted file mode 100644 index 32366f5..0000000 --- a/dist/javadoc/Other/DAOImplementation.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - -DAOImplementation - - - - - - - - - - - - -
-
Other
-

Class DAOImplementation

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • Other.DAOImplementation
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class DAOImplementation
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      DAOImplementation() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        DAOImplementation

        -
        public DAOImplementation()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Other/MathService.html b/dist/javadoc/Other/MathService.html deleted file mode 100644 index 41a87de..0000000 --- a/dist/javadoc/Other/MathService.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - -MathService - - - - - - - - - - - - -
-
Other
-

Class MathService

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • Other.MathService
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class MathService
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      MathService() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static doubledoProduct(double[] a, - double[] b) 
      static voidmain(java.lang.String[] args) 
      static double[][]MatrixNormalize(double[][] x) 
      static doublesigmoid(double x) 
      static doublesigmoid(double[] x, - double[] w) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
- -
-
- - - - - - - diff --git a/dist/javadoc/Other/ModelSelectionHibernateEntity.html b/dist/javadoc/Other/ModelSelectionHibernateEntity.html deleted file mode 100644 index 1b21656..0000000 --- a/dist/javadoc/Other/ModelSelectionHibernateEntity.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - -ModelSelectionHibernateEntity - - - - - - - - - - - - -
-
Other
-

Class ModelSelectionHibernateEntity

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • Other.ModelSelectionHibernateEntity
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class ModelSelectionHibernateEntity
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ModelSelectionHibernateEntity

        -
        public ModelSelectionHibernateEntity()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/Other/MyOwnArrayList.html b/dist/javadoc/Other/MyOwnArrayList.html deleted file mode 100644 index bdac46f..0000000 --- a/dist/javadoc/Other/MyOwnArrayList.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - -MyOwnArrayList - - - - - - - - - - - - -
-
Other
-

Class MyOwnArrayList

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • Other.MyOwnArrayList
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class MyOwnArrayList
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      MyOwnArrayList() 
      -
    • -
    - - -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        MyOwnArrayList

        -
        public MyOwnArrayList()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/WorkFiles/FileReader.html b/dist/javadoc/WorkFiles/FileReader.html deleted file mode 100644 index da1f07f..0000000 --- a/dist/javadoc/WorkFiles/FileReader.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - -FileReader - - - - - - - - - - - - -
-
WorkFiles
-

Class FileReader

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • WorkFiles.FileReader
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    FileWorker
    -
    -
    -
    -
    public class FileReader
    -extends java.lang.Object
    -implements FileWorker
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      FileReader() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        FileReader

        -
        public FileReader()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/WorkFiles/FileWorker.html b/dist/javadoc/WorkFiles/FileWorker.html deleted file mode 100644 index 7fd473e..0000000 --- a/dist/javadoc/WorkFiles/FileWorker.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - -FileWorker - - - - - - - - - - - - -
-
WorkFiles
-

Interface FileWorker

-
-
-
-
    -
  • -
    -
    All Known Implementing Classes:
    -
    FileReader, FileWriter
    -
    -
    -
    -
    public interface FileWorker
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/WorkFiles/FileWriter.html b/dist/javadoc/WorkFiles/FileWriter.html deleted file mode 100644 index 68144fb..0000000 --- a/dist/javadoc/WorkFiles/FileWriter.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - -FileWriter - - - - - - - - - - - - -
-
WorkFiles
-

Class FileWriter

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • WorkFiles.FileWriter
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    FileWorker
    -
    -
    -
    -
    public class FileWriter
    -extends java.lang.Object
    -implements FileWorker
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      FileWriter() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        FileWriter

        -
        public FileWriter()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/Model/NaiveBayes.html b/dist/javadoc/result/machinelearning/Model/NaiveBayes.html deleted file mode 100644 index a1c1c9f..0000000 --- a/dist/javadoc/result/machinelearning/Model/NaiveBayes.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - -NaiveBayes - - - - - - - - - - - - -
-
result.machinelearning.Model
-

Class NaiveBayes

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.Model.NaiveBayes
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    MlModel
    -
    -
    -
    -
    public class NaiveBayes
    -extends java.lang.Object
    -implements MlModel
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      NaiveBayes(float alpha, - boolean parallel) 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      floatgetAlpha() 
      double[][]getWeights() 
      booleanisFitted() 
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      MlModeltrain(double[][] X, - int[] y) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
- -
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html deleted file mode 100644 index 5df2d12..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - -CountVectorizer - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Class CountVectorizer

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.preprocessing.CountVectorizer
    • -
    -
  • -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - - - - - - - - - - -
      Constructors 
      Constructor and Description
      CountVectorizer() 
      CountVectorizer(float minDf, - float maxDf) 
      CountVectorizer(float minDf, - float maxDf, - java.lang.String[] stopWords, - boolean parralize) -
      Два конструктора
      -
      CountVectorizer(java.lang.String[] stopWords) 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) -
      Заполняет матрицу
      -
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) -
      Заполняет матрицу
      -
      floatgetMaxDf() 
      floatgetMinDf() -
      Геттеры для полей
      -
      java.util.List<java.lang.String>preprocess(java.lang.String text) -
      Метод извлекающий слова из переданного в метод текста.
      -
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) -
      Возвращает список Мапов из слов, взятых из переданного списка текстов
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        CountVectorizer

        -
        public CountVectorizer(float minDf,
        -                       float maxDf,
        -                       java.lang.String[] stopWords,
        -                       boolean parralize)
        -
        Два конструктора
        -
      • -
      - - - -
        -
      • -

        CountVectorizer

        -
        public CountVectorizer(float minDf,
        -                       float maxDf)
        -
      • -
      - - - -
        -
      • -

        CountVectorizer

        -
        public CountVectorizer(java.lang.String[] stopWords)
        -
      • -
      - - - -
        -
      • -

        CountVectorizer

        -
        public CountVectorizer()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - - - - - - - - - -
        -
      • -

        preprocess

        -
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        -
        Метод извлекающий слова из переданного в метод текста. - Не учитываются слова поля из
        -
        -
        Specified by:
        -
        preprocess in interface SequenceProcessor
        -
        Parameters:
        -
        text - Текст, из которого извлекаются слова
        -
        Returns:
        -
        Список слов
        -
        See Also:
        -
        Используется класс, -для стемминга
        -
        -
      • -
      - - - -
        -
      • -

        transform

        -
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        -
        Возвращает список Мапов из слов, взятых из переданного списка текстов
        -
        -
        Specified by:
        -
        transform in interface SequenceProcessor
        -
        Parameters:
        -
        listOfTexts - Список текстов
        -
        Returns:
        -
        Список Мапов
        -
        -
      • -
      - - - -
        -
      • -

        getMinDf

        -
        public float getMinDf()
        -
        Геттеры для полей
        -
        -
        See Also:
        -
        и, -maxDf
        -
        -
      • -
      - - - -
        -
      • -

        getMaxDf

        -
        public float getMaxDf()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html b/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html deleted file mode 100644 index 8c41de3..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - -LogisticRegression - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Class LogisticRegression

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.preprocessing.LogisticRegression
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable, MlModel
    -
    -
    -
    -
    public class LogisticRegression
    -extends java.lang.Object
    -implements MlModel, java.io.Serializable
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      LogisticRegression() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static double[][]init(double[][] X) -
      Инициализация массива векторв - нужно добавить первый столбец с одними единицами
      -
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      static doublesigmoid(double z) 
      doubless(double[] X) -
      Вспомогательный класс, который помогает вычислить сумму произведений координат вектора их весов
      -
      MlModeltrain(double[][] X, - int[] y) -
      Тренировка весов - С каждой итерацией вероятность будет точнее и точнее
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        LogisticRegression

        -
        public LogisticRegression()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/MlModel.html b/dist/javadoc/result/machinelearning/preprocessing/MlModel.html deleted file mode 100644 index 399e5de..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/MlModel.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - -MlModel - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Interface MlModel

-
-
-
- -
-
- -
-
- -
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html b/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html deleted file mode 100644 index 322c33c..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - -PorterStemmer - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Class PorterStemmer

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.preprocessing.PorterStemmer
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class PorterStemmer
    -extends java.lang.Object
    -
    Stolen by ilysko on 03.08.17. - original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      PorterStemmer() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) -
      Some tests
      -
      java.lang.Stringstem(java.lang.String word) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        PorterStemmer

        -
        public PorterStemmer()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        stem

        -
        public java.lang.String stem(java.lang.String word)
        -
      • -
      - - - -
        -
      • -

        main

        -
        public static void main(java.lang.String[] args)
        -
        Some tests
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html b/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html deleted file mode 100644 index 7d23e8d..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - -SequenceProcessor - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Interface SequenceProcessor

-
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        fitAndTransform

        -
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        -
      • -
      - - - -
        -
      • -

        fit

        -
        void fit(java.util.List<java.lang.String> listOfTexts)
        -
      • -
      - - - -
        -
      • -

        preprocess

        -
        java.util.List<java.lang.String> preprocess(java.lang.String text)
        -
      • -
      - - - -
        -
      • -

        transform

        -
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html deleted file mode 100644 index 6813a2e..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - -TfidfVectorizer - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Class TfidfVectorizer

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.preprocessing.TfidfVectorizer
    • -
    -
  • -
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      TfidfVectorizer() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        TfidfVectorizer

        -
        public TfidfVectorizer()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        fitAndTransform

        -
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        -
        -
        Specified by:
        -
        fitAndTransform in interface SequenceProcessor
        -
        -
      • -
      - - - -
        -
      • -

        fit

        -
        public void fit(java.util.List<java.lang.String> listOfTexts)
        -
        -
        Specified by:
        -
        fit in interface SequenceProcessor
        -
        -
      • -
      - - - -
        -
      • -

        preprocess

        -
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        -
        -
        Specified by:
        -
        preprocess in interface SequenceProcessor
        -
        -
      • -
      - - - -
        -
      • -

        transform

        -
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        -
        -
        Specified by:
        -
        transform in interface SequenceProcessor
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html deleted file mode 100644 index 8988857..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - -TfldfVectorizer - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Class TfldfVectorizer

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • result.machinelearning.preprocessing.TfldfVectorizer
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    Transformer
    -
    -
    -
    -
    public class TfldfVectorizer
    -extends java.lang.Object
    -implements Transformer
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      TfldfVectorizer() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        TfldfVectorizer

        -
        public TfldfVectorizer()
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/result/machinelearning/preprocessing/Transformer.html b/dist/javadoc/result/machinelearning/preprocessing/Transformer.html deleted file mode 100644 index 36b8b02..0000000 --- a/dist/javadoc/result/machinelearning/preprocessing/Transformer.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - -Transformer - - - - - - - - - - - - -
-
result.machinelearning.preprocessing
-

Interface Transformer

-
-
-
- -
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html deleted file mode 100644 index be285f9..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -ExceptionCatchingExample - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class ExceptionCatchingExample

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • ru.caf82.lectures.lecture04.ExceptionCatchingExample
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class ExceptionCatchingExample
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ExceptionCatchingExample

        -
        public ExceptionCatchingExample()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        main

        -
        public static void main(java.lang.String[] args)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html deleted file mode 100644 index ff9b0a9..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -ExceptionCatchingIhExample - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class ExceptionCatchingIhExample

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • ru.caf82.lectures.lecture04.ExceptionCatchingIhExample
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class ExceptionCatchingIhExample
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ExceptionCatchingIhExample

        -
        public ExceptionCatchingIhExample()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        main

        -
        public static void main(java.lang.String[] args)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html deleted file mode 100644 index 1a5f115..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -MyExceptionClassExample - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class MyExceptionClassExample

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Throwable
    • -
    • -
        -
      • java.lang.Exception
      • -
      • -
          -
        • ru.caf82.lectures.lecture04.MyExceptionClassExample
        • -
        -
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    -
    public class MyExceptionClassExample
    -extends java.lang.Exception
    -
    Created by ilysko on 24.09.17.
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        MyExceptionClassExample

        -
        public MyExceptionClassExample()
        -
      • -
      - - - -
        -
      • -

        MyExceptionClassExample

        -
        public MyExceptionClassExample(java.lang.Exception e)
        -
      • -
      - - - -
        -
      • -

        MyExceptionClassExample

        -
        public MyExceptionClassExample(int amountOfSmth)
        -
      • -
      - - - -
        -
      • -

        MyExceptionClassExample

        -
        public MyExceptionClassExample(java.lang.String messageFullOfAnger)
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        main

        -
        public static void main(java.lang.String[] args)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html deleted file mode 100644 index 08adc0c..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - -StackTraceExample - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class StackTraceExample

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • ru.caf82.lectures.lecture04.StackTraceExample
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class StackTraceExample
    -extends java.lang.Object
    -
    Created by ilysko on 24.09.17.
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      StackTraceExample() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        StackTraceExample

        -
        public StackTraceExample()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        main

        -
        public static void main(java.lang.String[] args)
        -
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html deleted file mode 100644 index fcc854c..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - -ThrowExample.NegException - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class ThrowExample.NegException

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Throwable
    • -
    • -
        -
      • java.lang.Exception
      • -
      • -
          -
        • ru.caf82.lectures.lecture04.ThrowExample.NegException
        • -
        -
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    Enclosing class:
    -
    ThrowExample
    -
    -
    -
    -
    public static class ThrowExample.NegException
    -extends java.lang.Exception
    -
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html deleted file mode 100644 index 1462228..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - -ThrowExample - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class ThrowExample

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • ru.caf82.lectures.lecture04.ThrowExample
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class ThrowExample
    -extends java.lang.Object
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Nested Class Summary

      - - - - - - - - - - -
      Nested Classes 
      Modifier and TypeClass and Description
      static class ThrowExample.NegException 
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      ThrowExample() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static intdivide(int a, - int b) 
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        ThrowExample

        -
        public ThrowExample()
        -
      • -
      -
    • -
    - - -
  • -
-
-
- - - - - - - diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html b/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html deleted file mode 100644 index 0b04e86..0000000 --- a/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - -WorkWithExceptions - - - - - - - - - - - - -
-
ru.caf82.lectures.lecture04
-

Class WorkWithExceptions

-
-
-
    -
  • java.lang.Object
  • -
  • -
      -
    • ru.caf82.lectures.lecture04.WorkWithExceptions
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class WorkWithExceptions
    -extends java.lang.Object
    -
    Created by ilysko on 24.09.17.
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      WorkWithExceptions() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
- -
-
- - - - - - - diff --git a/manifest.mf b/manifest.mf deleted file mode 100644 index 328e8e5..0000000 --- a/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml deleted file mode 100644 index bc3e7cb..0000000 --- a/nbproject/build-impl.xml +++ /dev/null @@ -1,1420 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - Must select one file in the IDE or set profile.class - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - Must select some files in the IDE or set test.includes - - - - - Must select one file in the IDE or set run.class - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties deleted file mode 100644 index 8e99bbf..0000000 --- a/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=0fd20a72 -build.xml.script.CRC32=687418d1 -build.xml.stylesheet.CRC32=8064a381@1.80.1.48 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=0fd20a72 -nbproject/build-impl.xml.script.CRC32=fbbe4592 -nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties deleted file mode 100644 index d06644e..0000000 --- a/nbproject/private/private.properties +++ /dev/null @@ -1,2 +0,0 @@ -compile.on.save=true -user.properties.file=C:\\Users\\User\\AppData\\Roaming\\NetBeans\\8.2\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml deleted file mode 100644 index 3db8086..0000000 --- a/nbproject/private/private.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/HomeWork.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/result/machinelearning/preprocessing/LogisticRegression.java - - - diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index 8de8683..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,74 +0,0 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# Files in build.classes.dir which should be excluded from distribution jar -dist.archive.excludes= -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/TextClassifierProject.jar -dist.javadoc.dir=${dist.dir}/javadoc -excludes= -includes=** -jar.compress=false -javac.classpath= -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.external.vm=true -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class= -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -source.encoding=UTF-8 -src.dir=src -test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index 764375f..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - org.netbeans.modules.java.j2seproject - - - TextClassifierProject - - - - - - - - - diff --git a/src/Exeptions/EmptyArrayException.java b/src/Exeptions/EmptyArrayException.java deleted file mode 100644 index f84f9fd..0000000 --- a/src/Exeptions/EmptyArrayException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Exeptions; - -/** - * - * @author User - */ -public class EmptyArrayException extends Exception{ - public EmptyArrayException(){ - super(); - } - public EmptyArrayException(String message){ - super(message); - } - public EmptyArrayException(String message, Throwable cause){ - super(message,cause); - } - public EmptyArrayException(Throwable cause){ - super(cause); - } -} diff --git a/src/Exeptions/InconveninentShapeException.java b/src/Exeptions/InconveninentShapeException.java deleted file mode 100644 index 2a9f866..0000000 --- a/src/Exeptions/InconveninentShapeException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Exeptions; - -/** - * - * @author User - */ -public class InconveninentShapeException extends Exception{ - public InconveninentShapeException(){ - super(); - } - public InconveninentShapeException(String message){ - super(message); - } - public InconveninentShapeException(String message, Throwable cause){ - super(message, cause); - } - public InconveninentShapeException(Throwable cause){ - super(cause); - } -} diff --git a/src/Exeptions/ModelNotFittedException.java b/src/Exeptions/ModelNotFittedException.java deleted file mode 100644 index 668350b..0000000 --- a/src/Exeptions/ModelNotFittedException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Exeptions; - -/** - * - * @author User - */ -public class ModelNotFittedException extends Exception { - ModelNotFittedException() { - super(); - } - ModelNotFittedException(String message) { - super(message); - } - ModelNotFittedException(Throwable cause) { - super(cause); - } - ModelNotFittedException(Throwable cause, String message) { - super(message); - } -} - diff --git a/src/Other/HomeWork.java b/src/Other/HomeWork.java deleted file mode 100644 index eb2b84c..0000000 --- a/src/Other/HomeWork.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -/** - * - * @author Danny - */ -public class HomeWork { - public static void main(String[] args) throws IOException, FileNotFoundException, ClassNotFoundException{ - HomeWork nc=new HomeWork(); - nc.ReadFromFile("fgg"); - nc.saveMlModelToFile(); - nc.readFromFile(); - } - public void ReadFromFile(String filename) throws IOException { - File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); - FileReader fir=new FileReader(file); - if(!file.exists())System.out.println("File no exist"); - StringBuffer sb=new StringBuffer(); - try{ - BufferedReader br=new BufferedReader(fir); - String s; - while ((s = br.readLine()) != null) { - sb.append(s); - sb.append("\n"); - } - } - catch(Exception e){ - System.out.println(e); - } - System.out.println(sb); - } - public void saveMlModelToFile() throws FileNotFoundException, IOException{ - FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); - ObjectOutputStream os=new ObjectOutputStream(file); - LogisticRegression lr=new LogisticRegression(); - os.writeObject(lr); - os.close(); - } - public void readFromFile() throws FileNotFoundException, IOException, ClassNotFoundException{ - ObjectInputStream os=new ObjectInputStream(new FileInputStream("C:\\users\\user\\desktop\\work\\Save.dat")); - LogisticRegression lg=(LogisticRegression)os.readObject(); - double wes[]=lg.getWeights(); - for(double w:wes)System.out.println(w); - } -} diff --git a/src/Other/MathService.java b/src/Other/MathService.java deleted file mode 100644 index 2b3c768..0000000 --- a/src/Other/MathService.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; -import Exeptions.EmptyArrayException; -import Exeptions.InconveninentShapeException; - -/** - * - * @author User - */ -public class MathService { - public static double doProduct(double[] a, double[] b) throws InconveninentShapeException,EmptyArrayException{ - double result=0; - boolean TT=true; - if(a.length!=b.length) throw new InconveninentShapeException("DoProduct: разные размеры массивов!"); - if(a.length==0 | b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); - for (int x=0;x implements Iterable{ - private Object[] ElementData; - MyOwnArrayList(){ - this(10); - } - MyOwnArrayList(int i){ - if (i < 0) - throw new IllegalArgumentException("Illegal Capacity: "+i); - this.ElementData=new Object[i]; - } - public void add(Object ob){ - int i=0; - for(i=0;i0; - } - public void remove(int index){ - System.arraycopy(ElementData, index+1, ElementData, index, ElementData.length-index-1); - ElementData[ElementData.length-1] = null; - Object[] NewElementData=new Object[ElementData.length-1]; - System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length-1); - ElementData=new Object[NewElementData.length]; - ElementData=NewElementData; - - } - public void remove(Object ob){ - int index=0; - for(int i=0;i0){ - Object[]NewElementData=new Object[ElementData.length+1]; - System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length); - ElementData=new Object[NewElementData.length]; - ElementData=NewElementData; - } - } - /* - Для проверки методов - */ - public void showAll(){ - for(Object x:ElementData)System.out.println("Element: "+x); - } - - @Override - public Iterator iterator() { - return new Iterator(){ - int i=0; - @Override - public boolean hasNext() { - return(ElementData[i]!=null); - } - - @Override - public Object next() { - return ElementData[i++]; - } - }; - } -} diff --git a/src/Other/MyOwnLinkedList.java b/src/Other/MyOwnLinkedList.java deleted file mode 100644 index 76eba44..0000000 --- a/src/Other/MyOwnLinkedList.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -import java.util.Iterator; - -/** - * - * @author User - */ -public class MyOwnLinkedList implements Iterable{ - private int size; - private Entry head; - private Entry pred; - - @Override - public Iterator iterator() { - return new Iterator(){ - Entry e=head; - @Override - public boolean hasNext() { - return(e!=null); - } - - @Override - public Object next() { - Object ob=e.element; - e=e.next; - return ob; - } - - }; - } - private static class Entry{ - Object element; - Entry next; - Entry prev; - Entry(E element){ - this.element = element; - } - } - public void add(Object ob){ - Entry e=new Entry(ob); - if(size==0){ - head=e; - //head.next=e; - //head.prev=e; - }else{ - pred.next=e; - e.prev=pred; - } - pred=e; - //head.prev=e; - size++; - - } - public boolean contains(Object ob){ - Entry e=head; - while(e.next!=null){ - if(e.element.equals(ob))return true; - e=e.next; - } - return false; - } - public void remove(Object ob){ - Entry e=head; - size--; - do{ - if(size==0){ - head=null; - break; - } - if(e.element.equals(ob))if(head.element.equals(ob)){ - poll(); - break; - } - else if(e.next==null){ - e.prev.next=null; - break; - }else{ - e.next.prev=e.prev; - e.prev.next=e.next; - break; - } - e=e.next; - }while(e!=null); - } - public void set(int index, Object ob){ - Entry e=head; - for(int i=0;i e=head; - head=head.next; - head.prev=null; - return e.element; - } - /* - Для проверки методов - */ - public void showAll(){ - Entry e=head; - while(e.next!=null){ - System.out.println(e.element); - e=e.next; - } - System.out.println(e.element); - } -} diff --git a/src/Other/NewClass.java b/src/Other/NewClass.java deleted file mode 100644 index da54811..0000000 --- a/src/Other/NewClass.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -import java.util.Iterator; - - -/** - * - * @author Danny - */ -public class NewClass { - public static void main(String[] args){ - MyOwnLinkedList moar=new MyOwnLinkedList(); - //Iterator it=moar.iterator(); - moar.add("SS"); - moar.add("dddddd"); - moar.add("ddd"); - //moar.showAll(); - Iterator it=moar.iterator(); - while(it.hasNext())System.out.println(it.next()); - } -} diff --git a/src/result/Other/DAO.java b/src/result/Other/DAO.java deleted file mode 100644 index d33b691..0000000 --- a/src/result/Other/DAO.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public interface DAO { - -} diff --git a/src/result/Other/DAOImplementation.java b/src/result/Other/DAOImplementation.java deleted file mode 100644 index 623ce4b..0000000 --- a/src/result/Other/DAOImplementation.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public class DAOImplementation { - -} diff --git a/src/result/Other/ModelSelectionHibernateEntity.java b/src/result/Other/ModelSelectionHibernateEntity.java deleted file mode 100644 index f4f56c0..0000000 --- a/src/result/Other/ModelSelectionHibernateEntity.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public class ModelSelectionHibernateEntity { - -} diff --git a/src/result/Other/ReviewHibernateEntity.java b/src/result/Other/ReviewHibernateEntity.java deleted file mode 100644 index 3409488..0000000 --- a/src/result/Other/ReviewHibernateEntity.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public class ReviewHibernateEntity { - -} diff --git a/src/result/Other/SwingModel.java b/src/result/Other/SwingModel.java deleted file mode 100644 index fea37dc..0000000 --- a/src/result/Other/SwingModel.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public class SwingModel { - -} diff --git a/src/result/Other/SwingTraining.java b/src/result/Other/SwingTraining.java deleted file mode 100644 index 0809fe8..0000000 --- a/src/result/Other/SwingTraining.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package Other; - -/** - * - * @author User - */ -public class SwingTraining { - -} diff --git a/src/result/WorkFiles/FileReader.java b/src/result/WorkFiles/FileReader.java deleted file mode 100644 index 2057d9a..0000000 --- a/src/result/WorkFiles/FileReader.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package WorkFiles; - -/** - * - * @author User - */ -public class FileReader implements FileWorker{ - -} diff --git a/src/result/WorkFiles/FileWorker.java b/src/result/WorkFiles/FileWorker.java deleted file mode 100644 index 9c053c7..0000000 --- a/src/result/WorkFiles/FileWorker.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package WorkFiles; - -/** - * - * @author User - */ -public interface FileWorker { - -} diff --git a/src/result/WorkFiles/FileWriter.java b/src/result/WorkFiles/FileWriter.java deleted file mode 100644 index 0242d4d..0000000 --- a/src/result/WorkFiles/FileWriter.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package WorkFiles; - -/** - * - * @author User - */ -public class FileWriter implements FileWorker{ - -} diff --git a/src/result/machinelearning/Model/AbstractModel.java b/src/result/machinelearning/Model/AbstractModel.java deleted file mode 100644 index 3482291..0000000 --- a/src/result/machinelearning/Model/AbstractModel.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package MachineLearning.Model; - -/** - * - * @author User - */ -public class AbstractModel { - -} diff --git a/src/result/machinelearning/Model/Boosting.java b/src/result/machinelearning/Model/Boosting.java deleted file mode 100644 index 7e45961..0000000 --- a/src/result/machinelearning/Model/Boosting.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package MachineLearning.Model; - -/** - * - * @author User - */ -public class Boosting extends AbstractModel{ - -} diff --git a/src/result/machinelearning/Model/KNeighbourhood.java b/src/result/machinelearning/Model/KNeighbourhood.java deleted file mode 100644 index e817831..0000000 --- a/src/result/machinelearning/Model/KNeighbourhood.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package MachineLearning.Model; - -/** - * - * @author User - */ -public class KNeighbourhood extends AbstractModel{ - -} diff --git a/src/result/machinelearning/Model/LinearKernel.java b/src/result/machinelearning/Model/LinearKernel.java deleted file mode 100644 index 0891ac2..0000000 --- a/src/result/machinelearning/Model/LinearKernel.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package MachineLearning.Model; - -/** - * - * @author User - */ -public class LinearKernel extends KNeighbourhood{ - -} diff --git a/src/result/machinelearning/Model/NaiveBayes.java b/src/result/machinelearning/Model/NaiveBayes.java deleted file mode 100644 index 70423bc..0000000 --- a/src/result/machinelearning/Model/NaiveBayes.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.Model; - -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; -import java.io.IOException; -import result.machinelearning.preprocessing.MlModel; - -/** - * - * @author User - */ -public class NaiveBayes implements MlModel { - private float alpha; - private double[][] weights; - private boolean fitted; - private boolean parallel; - public NaiveBayes(float alpha, boolean parallel) { - //Миша сказал забить - } - public MlModel train(double[][] X, int[] y) throws InconveninentShapeException { - //считаем у=0 и y=1 - if (X.length != y.length) - throw new InconveninentShapeException(); - double yZer = 0, yOne = 0; - for (int i=0; i matrix = new HashMap<>(); -private String[] stopWords; -final float minDf; -final float maxDf; -final boolean parralize; -private static List defaultStopWordsList = new ArrayList( -Arrays.asList(new String[]{ -"а","е","и","ж","м","о","на","не","ни","об","но","он","мне","мои","мож","она","они","оно", -"мной","много","многочисленное","многочисленная","многочисленные","многочисленный", -"мною","мой","мог","могут","можно","может","можно","мор","моя","моё","мочь","над","нее", -"оба","нам","нем","нами","ними","мимо","немного","одной","одного","менее","однажды","однако", -"меня","нему","меньше","ней","наверху","него","ниже","мало","надо","один","одиннадцать","одиннадцатый", -"назад","наиболее","недавно","миллионов","недалеко","между","низко","меля","нельзя","нибудь", -"непрерывно","наконец","никогда","никуда","нас","наш","нет","нею","неё","них","мира","наша", -"наше","наши","ничего","начала","нередко","несколько","обычно","опять","около","мы","ну","нх","от","отовсюду", -"особенно","нужно","очень","отсюда","в","во","вон","вниз","внизу","вокруг","вот","восемнадцать", -"восемнадцатый","восемь","восьмой","вверх","вам","вами","важное","важная","важные","важный","вдали","везде", -"ведь","вас","ваш","ваша","ваше","ваши","впрочем","весь","вдруг","вы","все","второй","всем","всеми","времени","время", -"всему","всего","всегда","всех","всею","всю","вся","всё","всюду","г","год","говорил","говорит","года","году","где", -"да","ее","за","из","ли","же","им","до","по","ими","под","иногда","довольно","именно","долго","позже", -"более","должно","пожалуйста","значит","иметь","больше","пока","ему","имя","пор","пора","потом","потому","после", -"почему","почти","посреди","ей","два","две","двенадцать","двенадцатый","двадцать","двадцатый", -"двух","его","дел","или","без","день","занят","занята","занято","заняты","действительно","давно", -"девятнадцать","девятнадцатый","девять","девятый","даже","алло","жизнь","далеко","близко","здесь","дальше","для", -"лет","зато","даром","первый","перед","затем","зачем","лишь","десять","десятый","ею","её","их","бы","еще","при", -"был","про","процентов","против","просто","бывает","бывь","если","люди","была","были","было","будем","будет","будете","будешь", -"прекрасно","буду","будь","будто","будут","ещё","пятнадцать","пятнадцатый","друго","другое","другой","другие","другая","других","есть","пять", -"быть","лучше","пятый","к","ком","конечно","кому","кого","когда","которой","которого","которая","которые","который","которых","кем", -"каждое","каждая","каждые","каждый","кажется","как","какой","какая","кто","кроме","куда","кругом","с","т","у","я", -"та","те","уж","со","то","том","снова","тому","совсем","того","тогда","тоже","собой","тобой","собою","тобою", -"сначала","только","уметь","тот","тою","хорошо","хотеть","хочешь","хоть","хотя","свое","свои","твой","своей","своего","своих", -"свою","твоя","твоё","раз","уже","сам","там","тем","чем","сама","сами","теми","само","рано","самом","самому", -"самой","самого","семнадцать","семнадцатый","самим","самими","самих","саму", -"семь","чему","раньше","сейчас","чего","сегодня","себе","тебе","сеаой","человек","разве","теперь","себя","тебя","седьмой","спасибо", -"слишком","так","такое","такой","такие","также","такая","сих","тех","чаще","четвертый","через","часто","шестой","шестнадцать","шестнадцатый", -"шесть","четыре","четырнадцать","четырнадцатый","сколько","сказал","сказала","сказать", -"ту","ты","три","эта","эти","что","это","чтоб","этом","этому","этой","этого","чтобы","этот","стал","туда", -"этим","этими","рядом","тринадцать","тринадцатый","этих","третий","тут","эту","суть","чуть","тысяч" -}) -); - -/** -* Заполняет матрицу -* @see CountVectorizer#matrix слова и возвращает список Мапов -* @param listOfTexts Список текстов -* @return Список Мапов -*/ -@Override -public List> fitAndTransform(List listOfTexts) { -List> listOfMaps = new ArrayList<>(); -for (String text : listOfTexts) { -List list = preprocess(text); -listOfMaps.add(countWordsAndEditMatrix(list)); -} -return listOfMaps; -} - -/** -* Заполняет матрицу -* @see CountVectorizer#matrix словами из списка текстов -* @param listOfTexts Список текстов -*/ -@Override -public void fit(List listOfTexts) { -for (String text : listOfTexts) { -List list = preprocess(text); -countWordsAndEditMatrix(list); -} -} - -/** -* Метод извлекающий слова из переданного в метод текста. -* Не учитываются слова поля из -* @see CountVectorizer#defaultStopWordsList -* Используется класс -* @see PorterStemmer для стемминга -* @param text Текст, из которого извлекаются слова -* @return Список слов -*/ -@Override -public List preprocess(String text) { -PorterStemmer stemmer = new PorterStemmer(); -text = text.toLowerCase().replaceAll("[^а-я -]","").replaceAll(" +-"," ").replaceAll("- +"," "); - -String[] array = text.split(" +"); -for (int i = 0; i list = new ArrayList(Arrays.asList(array)); -list.removeAll(defaultStopWordsList); -return list; -} - -/** -* Возвращает список Мапов из слов, взятых из переданного списка текстов -* @param listOfTexts Список текстов -* @return Список Мапов -*/ -@Override -public List> transform(List listOfTexts) { -List> listOfMaps = new ArrayList<>(); -for (String text : listOfTexts) { -List list = preprocess(text); -listOfMaps.add(countWords(list)); -} -return listOfMaps; -} - -/** -* Два конструктора -*/ -public CountVectorizer(float minDf, float maxDf, String[] stopWords, boolean parralize) { -this.minDf = minDf; -this.maxDf = maxDf; -this.stopWords = stopWords; -this.parralize = parralize; -} -public CountVectorizer(float minDf, float maxDf) { -this.minDf = minDf; -this.maxDf = maxDf; -parralize = false; -} -public CountVectorizer(String[] stopWords) { -this.stopWords = stopWords; -minDf = 1; -maxDf = 1; -parralize = false; -} -public CountVectorizer() { -minDf = 1; -maxDf = 1; -parralize = false; -} - -/** -* Геттеры для полей -* @see CountVectorizer#minDf и -* @see CountVectorizer#maxDf -*/ -public float getMinDf() { -return minDf; -} -public float getMaxDf() { -return maxDf; -} - -/** -* Считает, сколько раз встретилось одно слово в переданном списке слов -* @param words Список слов, в котором счиатем слова -* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово -*/ - -private Map countWords(List words) { -Map map = new HashMap(); -int value = 1; -for (String word : words) { -if (map.containsKey(word)) { -value += map.get(word); -} - -map.put(word, value); -} -return map; -} - -/** -* Делаем то же самое, что и в методе -* @see CountVectorizer#countWords(List), но еще и добавляем это в матрицу -* @see CountVectorizer#matrix -* @param words Список слов, в котором счиатем слова -* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово -*/ -private Map countWordsAndEditMatrix(List words) { -Map map = countWords(words); -int valueFromMatrix = 0; -for (Map.Entry pair : map.entrySet()) { -String key = pair.getKey(); -if (matrix.containsKey(key)) { -valueFromMatrix = matrix.get(key); -} -matrix.put(key, valueFromMatrix + pair.getValue()); -} -return map; -} - -} - diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java deleted file mode 100644 index 745a3a8..0000000 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import Exeptions.EmptyArrayException; -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; -import java.io.Serializable; -import java.util.Random; -import Other.MathService; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author User - */ -public class LogisticRegression implements MlModel, Serializable { -//private float alpha; -//private float betta; -//private boolean parralize; -//private float learnRate; -//private Random initializer = new Random(); -private int ITERATES=1000; -private double rate=0.001; - -private double[] weights; -//private boolean fitted = false; - - // public LogisticRegression2(float alpha, float betta, int maxIter, float learnRate, boolean parralize) {} - public static double sigmoid(double z){ - return 1/(1+Math.exp(-z)); - } - /** - * Инициализация массива векторв - нужно добавить первый столбец с одними единицами - * @param X - координаты векторов - * @return - */ - static public double[][] init(double[][]X){ - int i,j; - double [][]Y=new double[X.length][X.length+1]; - for(i=0;i0.5){ - System.out.println("It is a dog"); - probability[0]=1; - }else if(ver<0.4){ - System.out.println("It is a cat"); - probability[0]=0; - } - else { - System.out.println("I don't know"); - probability[0]=-1; - } - return probability; - } - - @Override - public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - public void ReadFromFile(String filename) throws IOException { - File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); - FileReader fir=new FileReader(file); - if(!file.exists())System.out.println("File no exist"); - StringBuffer sb=new StringBuffer(); - try{ - BufferedReader br=new BufferedReader(fir); - String s; - while ((s = br.readLine()) != null) { - sb.append(s); - sb.append("\n"); - } - } - catch(Exception e){ - System.out.println(e); - } - } - public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException{ - FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); - ObjectOutputStream os=new ObjectOutputStream(file); - LogisticRegression lr=new LogisticRegression(); - os.writeObject(lr); - os.close(); - } - - public double[] getWeights() { - return weights; - } - - public void setWeights(double[] weights) { - this.weights = weights; - } - @Override - public void saveToFile(String filename) throws IOException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - -} -// public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} - -// public double[] getWeights() {} -// public float getAlpha() {} -// public void setAlpha(float alpha) {} -// public float getBetta() {} -// public void setBetta(float betta) {} -// public int getMaxIter() {} -// public void setMaxIter(int maxIter) {} -// public boolean isParralize() {} -// public void setParralize(boolean parralize) {} -// public float getLearnRate() {} -// public void setLearnRate(float learnRate) {} -// private double lossFunction(double[][] X, double[] W, int[] y) throws InconveninentShapeException {} -// private double[] lossFunctionDerivative(double[][] X, double[] W, -// int[] y, float alpha, float betta) throws InconveninentShapeException {} -//} diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java deleted file mode 100644 index 300b881..0000000 --- a/src/result/machinelearning/preprocessing/MlModel.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import Exeptions.InconveninentShapeException; -import Exeptions.ModelNotFittedException; -import java.io.IOException; - -/** - * - * @author User - */ -public interface MlModel { - MlModel train(double[][] X, int[] y) throws InconveninentShapeException; - - int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; - - double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; - - - void saveToFile(String filename) throws IOException; - - -} diff --git a/src/result/machinelearning/preprocessing/PorterStemmer.java b/src/result/machinelearning/preprocessing/PorterStemmer.java deleted file mode 100644 index c6322fc..0000000 --- a/src/result/machinelearning/preprocessing/PorterStemmer.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Stolen by ilysko on 03.08.17. - * original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html - */ -public class PorterStemmer { - - private static final Pattern PERFECTIVEGROUND = Pattern.compile("((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$"); - - private static final Pattern REFLEXIVE = Pattern.compile("(с[яь])$"); - - private static final Pattern ADJECTIVE = Pattern.compile("(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$"); - - private static final Pattern PARTICIPLE = Pattern.compile("((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$"); - - private static final Pattern VERB = Pattern.compile("((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$"); - - private static final Pattern NOUN = Pattern.compile("(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$"); - - private static final Pattern RVRE = Pattern.compile("^(.*?[аеиоуыэюя])(.*)$"); - - private static final Pattern DERIVATIONAL = Pattern.compile(".*[^аеиоуыэюя]+[аеиоуыэюя].*ость?$"); - - private static final Pattern DER = Pattern.compile("ость?$"); - - private static final Pattern SUPERLATIVE = Pattern.compile("(ейше|ейш)$"); - - private static final Pattern I = Pattern.compile("и$"); - private static final Pattern P = Pattern.compile("ь$"); - private static final Pattern NN = Pattern.compile("нн$"); - - public String stem(String word) { - word = word.toLowerCase(); - word = word.replace('ё', 'е'); - Matcher m = RVRE.matcher(word); - if (m.matches()) { - String pre = m.group(1); - String rv = m.group(2); - String temp = PERFECTIVEGROUND.matcher(rv).replaceFirst(""); - if (temp.equals(rv)) { - rv = REFLEXIVE.matcher(rv).replaceFirst(""); - temp = ADJECTIVE.matcher(rv).replaceFirst(""); - if (!temp.equals(rv)) { - rv = temp; - rv = PARTICIPLE.matcher(rv).replaceFirst(""); - } else { - temp = VERB.matcher(rv).replaceFirst(""); - if (temp.equals(rv)) { - rv = NOUN.matcher(rv).replaceFirst(""); - } else { - rv = temp; - } - } - - } else { - rv = temp; - } - - rv = I.matcher(rv).replaceFirst(""); - - if (DERIVATIONAL.matcher(rv).matches()) { - rv = DER.matcher(rv).replaceFirst(""); - } - - temp = P.matcher(rv).replaceFirst(""); - if (temp.equals(rv)) { - rv = SUPERLATIVE.matcher(rv).replaceFirst(""); - rv = NN.matcher(rv).replaceFirst("н"); - } else { - rv = temp; - } - word = pre + rv; - - } - - return word; - } - - /** - * Some tests - */ - public static void main(String[] args) { - PorterStemmer porterStemmer = new PorterStemmer(); - String[] listOfWords = new String[] {"букварь", "здравие", - "птица", "интересный", "космос", "космический"}; - for (String word: listOfWords) { - System.out.println("Результат применения PorterStemmer к слову " + word + " : " +porterStemmer.stem(word)); - } - } - -} \ No newline at end of file diff --git a/src/result/machinelearning/preprocessing/SequenceProcessor.java b/src/result/machinelearning/preprocessing/SequenceProcessor.java deleted file mode 100644 index 76c289b..0000000 --- a/src/result/machinelearning/preprocessing/SequenceProcessor.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -import java.util.List; -import java.util.Map; - -/** - * - * @author User - */ -public interface SequenceProcessor { - public List> fitAndTransform(List listOfTexts); - - public void fit(List listOfTexts); - - public List preprocess(String text); - - public List> transform(List listOfTexts); - -} diff --git a/src/result/machinelearning/preprocessing/TfidfVectorizer.java b/src/result/machinelearning/preprocessing/TfidfVectorizer.java deleted file mode 100644 index ff66a62..0000000 --- a/src/result/machinelearning/preprocessing/TfidfVectorizer.java +++ /dev/null @@ -1,30 +0,0 @@ -package result.machinelearning.preprocessing; - -import java.util.List; -import java.util.Map; - -/** - * Created by ilysko on 03.08.17. - */ -public class TfidfVectorizer implements SequenceProcessor, Transformer { - - @Override - public List> fitAndTransform(List listOfTexts) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void fit(List listOfTexts) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public List preprocess(String text) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public List> transform(List listOfTexts) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } -} diff --git a/src/result/machinelearning/preprocessing/Transformer.java b/src/result/machinelearning/preprocessing/Transformer.java deleted file mode 100644 index f5e1244..0000000 --- a/src/result/machinelearning/preprocessing/Transformer.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -/** - * - * @author User - */ -public interface Transformer { - -} diff --git a/src/result/machinelearning/preprocessing/WordProcessor.java b/src/result/machinelearning/preprocessing/WordProcessor.java deleted file mode 100644 index c31a106..0000000 --- a/src/result/machinelearning/preprocessing/WordProcessor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.machinelearning.preprocessing; - -/** - * - * @author User - */ -public interface WordProcessor { - -} diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java deleted file mode 100644 index 8456e7c..0000000 --- a/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java +++ /dev/null @@ -1,21 +0,0 @@ -package ru.caf82.lectures.lecture04; - - -public class ExceptionCatchingExample { - - public static void main(String[] args) { - try { - System.out.println(6 / 0); - } catch (ArithmeticException ex) { - System.out.println("Ошибка! Ошибка!"); - System.out.println(ex.toString()); - } - - try { - System.out.println(Long.parseLong("Mama")); - } catch (NumberFormatException ex) { - System.out.println("Снова косяк!"); - System.out.println(ex.toString()); - } - } -} diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java deleted file mode 100644 index c4dfc32..0000000 --- a/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java +++ /dev/null @@ -1,24 +0,0 @@ -package ru.caf82.lectures.lecture04; - -public class ExceptionCatchingIhExample { - - public static void main(String[] args) { -// try { -// System.out.println(6 / 0); -// } catch (Exception ex) { -// System.out.println("Ошибка верхнего увроня"); -// } catch (ArithmeticException ex) { -// System.out.println("Ошибка! Ошибка!"); -// System.out.println(ex.toString()); -// } - - try { - System.out.println(Long.parseLong("Mama")); - } catch (NumberFormatException ex) { - System.out.println("Снова косяк!"); - System.out.println(ex.toString()); - } catch (Exception ex) { - System.out.println("Ошибка верхнего уровня"); - } - } -} diff --git a/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java b/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java deleted file mode 100644 index b741e17..0000000 --- a/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java +++ /dev/null @@ -1,52 +0,0 @@ -package ru.caf82.lectures.lecture04; - -/** - * Created by ilysko on 24.09.17. - */ -public class MyExceptionClassExample extends TemplateForMyExceptionClass { - int amountOfSmth; - - void someMethod() { - System.out.println(amountOfSmth); - } - - void f() { - someMethod(); - } - - public MyExceptionClassExample() { - super(); - } - - public MyExceptionClassExample(Exception e) { - super(e); - } - - public MyExceptionClassExample(int amountOfSmth) { - super(); - this.amountOfSmth = amountOfSmth; - } - - public MyExceptionClassExample(String messageFullOfAnger) { - super(messageFullOfAnger); - } - - public static void main(String[] args) { - System.out.println("let's throw an exception!"); -// throw new MyExceptionClassExample("lol"); - } -} - -class TemplateForMyExceptionClass extends Exception { - TemplateForMyExceptionClass() { - super(); - } - - TemplateForMyExceptionClass(String message) { - super(message); - } - - TemplateForMyExceptionClass(Exception e) { - super(e); - } -} diff --git a/src/ru/caf82/lectures/lecture04/StackTraceExample.java b/src/ru/caf82/lectures/lecture04/StackTraceExample.java deleted file mode 100644 index 96b7f71..0000000 --- a/src/ru/caf82/lectures/lecture04/StackTraceExample.java +++ /dev/null @@ -1,32 +0,0 @@ -package ru.caf82.lectures.lecture04; - -/** - * Created by ilysko on 24.09.17. - */ -public class StackTraceExample { - static void f() { - try { - throw new Exception(); - } catch (Exception e) { - for (StackTraceElement ste : e.getStackTrace()) { - System.out.println(ste.getMethodName()); - } - } - } - - static void g() { - f(); - } - - static void h() { - g(); - } - - public static void main(String[] args) { - f(); - System.out.println("---------------"); - g(); - System.out.println("---------------"); - h(); - } -} diff --git a/src/ru/caf82/lectures/lecture04/ThrowExample.java b/src/ru/caf82/lectures/lecture04/ThrowExample.java deleted file mode 100644 index 8c3a31a..0000000 --- a/src/ru/caf82/lectures/lecture04/ThrowExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package ru.caf82.lectures.lecture04; - -public class ThrowExample { - - public static int divide(int a, int b) throws ArithmeticException, NegException { - if (b == 0) { - throw new ArithmeticException("Ты че как лох-то, на нуль делить нельзя"); - } else if( b < 0) { - throw new NegException("Мы решили, что на отрицательные числа делить нельзя"); - } - return a / b; - } - - public static void main(String[] args) { - try { - System.out.println(divide(5, 2)); - System.out.println(divide(5, 0)); - } catch (ArithmeticException ex){ - System.out.println("Мы поймали ошибку!"); - } catch (Exception ex) { - // - } - try { - System.out.println(divide(5, 2)); - System.out.println(divide(5, -1)); - } catch (NegException ex){ - System.out.println("Мы поймали ошибку!"); - } catch (Exception ex) { - // - } - try { - System.out.println(divide(5, -1)); - System.out.println(divide(5, 0)); - } catch (ArithmeticException ex){ - System.out.println("Мы поймали ошибку!"); - } catch (NegException ex) { - System.out.println("Отрицательное деление"); - } - - } - - - public static class NegException extends Exception { - NegException(){ - super(); - } - NegException(String message) { - super(message); - } - } -} diff --git a/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java b/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java deleted file mode 100644 index 99a8775..0000000 --- a/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java +++ /dev/null @@ -1,40 +0,0 @@ -package ru.caf82.lectures.lecture04; - -/** - * Created by ilysko on 24.09.17. - */ -public class WorkWithExceptions { - void ignore() throws Exception { - throw new Exception(); - } - - void catchHere() { - try { - throw new Exception(); - } catch (Exception e) { - System.out.println("Lol, i caught it just here!"); - } - } - - void throwAhead() { - try { - ignore(); - } catch (Exception e) { - System.out.println("We didn't try to catch exception in ignore(). " + - "We did it here"); - } - } - - void createNewExceptionWhileWorkingWithOld() throws MyExceptionClassExample { - try { - ignore(); - } catch (Exception e) { - System.out.println("do smth"); - throw new MyExceptionClassExample(e); - } - } - public static void main(String[] args) throws MyExceptionClassExample{ - WorkWithExceptions w= new WorkWithExceptions(); - w.createNewExceptionWhileWorkingWithOld(); - } -} From 0bc80fdd553c9ab80b341720cc56979d6f18593e Mon Sep 17 00:00:00 2001 From: SychDan Date: Tue, 24 Oct 2017 20:38:19 +0300 Subject: [PATCH 24/29] Correct & update --- TextClassifierProject.iml | 13 + .../Exeptions/EmptyArrayException.html | 301 ++++++++++++ .../InconveninentShapeException.html | 301 ++++++++++++ .../Exeptions/ModelNotFittedException.html | 223 +++++++++ .../MachineLearning/Model/AbstractModel.html | 242 ++++++++++ .../MachineLearning/Model/Boosting.html | 243 ++++++++++ .../MachineLearning/Model/KNeighbourhood.html | 247 ++++++++++ .../MachineLearning/Model/LinearKernel.html | 248 ++++++++++ .../MachineLearning/Model/NormalKernel.html | 248 ++++++++++ .../Preprocessing/WordProcessor.html | 168 +++++++ dist/javadoc/Other/DAO.html | 168 +++++++ dist/javadoc/Other/DAOImplementation.html | 238 ++++++++++ dist/javadoc/Other/MathService.html | 350 ++++++++++++++ .../Other/ModelSelectionHibernateEntity.html | 238 ++++++++++ dist/javadoc/Other/MyOwnArrayList.html | 285 +++++++++++ dist/javadoc/WorkFiles/FileReader.html | 243 ++++++++++ dist/javadoc/WorkFiles/FileWorker.html | 172 +++++++ dist/javadoc/WorkFiles/FileWriter.html | 243 ++++++++++ .../machinelearning/Model/NaiveBayes.html | 391 +++++++++++++++ .../preprocessing/CountVectorizer.html | 447 ++++++++++++++++++ .../preprocessing/LogisticRegression.html | 422 +++++++++++++++++ .../preprocessing/MlModel.html | 291 ++++++++++++ .../preprocessing/PorterStemmer.html | 290 ++++++++++++ .../preprocessing/SequenceProcessor.html | 265 +++++++++++ .../preprocessing/TfidfVectorizer.html | 333 +++++++++++++ .../preprocessing/TfldfVectorizer.html | 243 ++++++++++ .../preprocessing/Transformer.html | 172 +++++++ .../lecture04/ExceptionCatchingExample.html | 272 +++++++++++ .../lecture04/ExceptionCatchingIhExample.html | 272 +++++++++++ .../lecture04/MyExceptionClassExample.html | 334 +++++++++++++ .../lectures/lecture04/StackTraceExample.html | 273 +++++++++++ .../lecture04/ThrowExample.NegException.html | 227 +++++++++ .../lectures/lecture04/ThrowExample.html | 313 ++++++++++++ .../lecture04/WorkWithExceptions.html | 278 +++++++++++ manifest.mf | 3 + src/exceptions/EmptyArrayException.java | 25 + .../InconveninentShapeException.java | 25 + src/exceptions/ModelNotFittedException.java | 26 + src/other/HomeWork.java | 61 +++ src/other/MathService.java | 54 +++ src/other/MyOwnArrayList.java | 129 +++++ src/other/MyOwnLinkedList.java | 141 ++++++ src/other/NewClass.java | 26 + .../machinelearning/model/AbstractModel.java | 14 + .../machinelearning/model/Boosting.java | 14 + .../machinelearning/model/KNeighbourhood.java | 14 + .../machinelearning/model/LinearKernel.java | 14 + .../machinelearning/model/NaiveBayes.java | 103 ++++ .../machinelearning/model/NormalKernel.java | 14 + .../preprocessing/CountVectorizer.java | 206 ++++++++ .../preprocessing/LogisticRegression.java | 188 ++++++++ .../preprocessing/MlModel.java | 27 ++ .../preprocessing/PorterStemmer.java | 100 ++++ .../preprocessing/SequenceProcessor.java | 24 + .../preprocessing/TfidfVectorizer.java | 30 ++ .../preprocessing/Transformer.java | 14 + .../preprocessing/WordProcessor.java | 14 + src/result/other/DAO.java | 14 + src/result/other/DAOImplementation.java | 14 + .../other/ModelSelectionHibernateEntity.java | 14 + src/result/other/ReviewHibernateEntity.java | 14 + src/result/other/SwingModel.java | 14 + src/result/other/SwingTraining.java | 14 + src/result/workFiles/FileReader.java | 14 + src/result/workFiles/FileWorker.java | 14 + src/result/workFiles/FileWriter.java | 14 + .../lecture04/ExceptionCatchingExample.java | 21 + .../lecture04/ExceptionCatchingIhExample.java | 24 + .../lecture04/MyExceptionClassExample.java | 52 ++ .../lectures/lecture04/StackTraceExample.java | 32 ++ .../lectures/lecture04/ThrowExample.java | 51 ++ .../lecture04/WorkWithExceptions.java | 40 ++ 72 files changed, 10606 insertions(+) create mode 100644 TextClassifierProject.iml create mode 100644 dist/javadoc/Exeptions/EmptyArrayException.html create mode 100644 dist/javadoc/Exeptions/InconveninentShapeException.html create mode 100644 dist/javadoc/Exeptions/ModelNotFittedException.html create mode 100644 dist/javadoc/MachineLearning/Model/AbstractModel.html create mode 100644 dist/javadoc/MachineLearning/Model/Boosting.html create mode 100644 dist/javadoc/MachineLearning/Model/KNeighbourhood.html create mode 100644 dist/javadoc/MachineLearning/Model/LinearKernel.html create mode 100644 dist/javadoc/MachineLearning/Model/NormalKernel.html create mode 100644 dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html create mode 100644 dist/javadoc/Other/DAO.html create mode 100644 dist/javadoc/Other/DAOImplementation.html create mode 100644 dist/javadoc/Other/MathService.html create mode 100644 dist/javadoc/Other/ModelSelectionHibernateEntity.html create mode 100644 dist/javadoc/Other/MyOwnArrayList.html create mode 100644 dist/javadoc/WorkFiles/FileReader.html create mode 100644 dist/javadoc/WorkFiles/FileWorker.html create mode 100644 dist/javadoc/WorkFiles/FileWriter.html create mode 100644 dist/javadoc/result/machinelearning/Model/NaiveBayes.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/MlModel.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html create mode 100644 dist/javadoc/result/machinelearning/preprocessing/Transformer.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html create mode 100644 dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html create mode 100644 manifest.mf create mode 100644 src/exceptions/EmptyArrayException.java create mode 100644 src/exceptions/InconveninentShapeException.java create mode 100644 src/exceptions/ModelNotFittedException.java create mode 100644 src/other/HomeWork.java create mode 100644 src/other/MathService.java create mode 100644 src/other/MyOwnArrayList.java create mode 100644 src/other/MyOwnLinkedList.java create mode 100644 src/other/NewClass.java create mode 100644 src/result/machinelearning/model/AbstractModel.java create mode 100644 src/result/machinelearning/model/Boosting.java create mode 100644 src/result/machinelearning/model/KNeighbourhood.java create mode 100644 src/result/machinelearning/model/LinearKernel.java create mode 100644 src/result/machinelearning/model/NaiveBayes.java create mode 100644 src/result/machinelearning/model/NormalKernel.java create mode 100644 src/result/machinelearning/preprocessing/CountVectorizer.java create mode 100644 src/result/machinelearning/preprocessing/LogisticRegression.java create mode 100644 src/result/machinelearning/preprocessing/MlModel.java create mode 100644 src/result/machinelearning/preprocessing/PorterStemmer.java create mode 100644 src/result/machinelearning/preprocessing/SequenceProcessor.java create mode 100644 src/result/machinelearning/preprocessing/TfidfVectorizer.java create mode 100644 src/result/machinelearning/preprocessing/Transformer.java create mode 100644 src/result/machinelearning/preprocessing/WordProcessor.java create mode 100644 src/result/other/DAO.java create mode 100644 src/result/other/DAOImplementation.java create mode 100644 src/result/other/ModelSelectionHibernateEntity.java create mode 100644 src/result/other/ReviewHibernateEntity.java create mode 100644 src/result/other/SwingModel.java create mode 100644 src/result/other/SwingTraining.java create mode 100644 src/result/workFiles/FileReader.java create mode 100644 src/result/workFiles/FileWorker.java create mode 100644 src/result/workFiles/FileWriter.java create mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java create mode 100644 src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java create mode 100644 src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java create mode 100644 src/ru/caf82/lectures/lecture04/StackTraceExample.java create mode 100644 src/ru/caf82/lectures/lecture04/ThrowExample.java create mode 100644 src/ru/caf82/lectures/lecture04/WorkWithExceptions.java diff --git a/TextClassifierProject.iml b/TextClassifierProject.iml new file mode 100644 index 0000000..560487b --- /dev/null +++ b/TextClassifierProject.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/javadoc/Exeptions/EmptyArrayException.html b/dist/javadoc/Exeptions/EmptyArrayException.html new file mode 100644 index 0000000..4567ca4 --- /dev/null +++ b/dist/javadoc/Exeptions/EmptyArrayException.html @@ -0,0 +1,301 @@ + + + + + + +EmptyArrayException + + + + + + + + + + + + +
+
Exeptions
+

Class EmptyArrayException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.EmptyArrayException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class EmptyArrayException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException()
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.String message,
        +                           java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        EmptyArrayException

        +
        public EmptyArrayException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Exeptions/InconveninentShapeException.html b/dist/javadoc/Exeptions/InconveninentShapeException.html new file mode 100644 index 0000000..9461a6d --- /dev/null +++ b/dist/javadoc/Exeptions/InconveninentShapeException.html @@ -0,0 +1,301 @@ + + + + + + +InconveninentShapeException + + + + + + + + + + + + +
+
Exeptions
+

Class InconveninentShapeException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.InconveninentShapeException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class InconveninentShapeException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException()
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.String message)
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.String message,
        +                                   java.lang.Throwable cause)
        +
      • +
      + + + +
        +
      • +

        InconveninentShapeException

        +
        public InconveninentShapeException(java.lang.Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Exeptions/ModelNotFittedException.html b/dist/javadoc/Exeptions/ModelNotFittedException.html new file mode 100644 index 0000000..b712f3e --- /dev/null +++ b/dist/javadoc/Exeptions/ModelNotFittedException.html @@ -0,0 +1,223 @@ + + + + + + +ModelNotFittedException + + + + + + + + + + + + +
+
Exeptions
+

Class ModelNotFittedException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • Exeptions.ModelNotFittedException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class ModelNotFittedException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/AbstractModel.html b/dist/javadoc/MachineLearning/Model/AbstractModel.html new file mode 100644 index 0000000..e64c1b6 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/AbstractModel.html @@ -0,0 +1,242 @@ + + + + + + +AbstractModel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class AbstractModel

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • MachineLearning.Model.AbstractModel
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    Boosting, KNeighbourhood
    +
    +
    +
    +
    public class AbstractModel
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      AbstractModel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AbstractModel

        +
        public AbstractModel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/Boosting.html b/dist/javadoc/MachineLearning/Model/Boosting.html new file mode 100644 index 0000000..1a5a90f --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/Boosting.html @@ -0,0 +1,243 @@ + + + + + + +Boosting + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class Boosting

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Boosting() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Boosting

        +
        public Boosting()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/KNeighbourhood.html b/dist/javadoc/MachineLearning/Model/KNeighbourhood.html new file mode 100644 index 0000000..9fb30f7 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/KNeighbourhood.html @@ -0,0 +1,247 @@ + + + + + + +KNeighbourhood + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class KNeighbourhood

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      KNeighbourhood() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        KNeighbourhood

        +
        public KNeighbourhood()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/LinearKernel.html b/dist/javadoc/MachineLearning/Model/LinearKernel.html new file mode 100644 index 0000000..44fee98 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/LinearKernel.html @@ -0,0 +1,248 @@ + + + + + + +LinearKernel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class LinearKernel

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      LinearKernel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LinearKernel

        +
        public LinearKernel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Model/NormalKernel.html b/dist/javadoc/MachineLearning/Model/NormalKernel.html new file mode 100644 index 0000000..fcc7bd7 --- /dev/null +++ b/dist/javadoc/MachineLearning/Model/NormalKernel.html @@ -0,0 +1,248 @@ + + + + + + +NormalKernel + + + + + + + + + + + + +
+
MachineLearning.Model
+

Class NormalKernel

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NormalKernel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NormalKernel

        +
        public NormalKernel()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html b/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html new file mode 100644 index 0000000..0a83117 --- /dev/null +++ b/dist/javadoc/MachineLearning/Preprocessing/WordProcessor.html @@ -0,0 +1,168 @@ + + + + + + +WordProcessor + + + + + + + + + + + + +
+
MachineLearning.Preprocessing
+

Interface WordProcessor

+
+
+
+
    +
  • +
    +
    +
    public interface WordProcessor
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/DAO.html b/dist/javadoc/Other/DAO.html new file mode 100644 index 0000000..208e1ea --- /dev/null +++ b/dist/javadoc/Other/DAO.html @@ -0,0 +1,168 @@ + + + + + + +DAO + + + + + + + + + + + + +
+
Other
+

Interface DAO

+
+
+
+
    +
  • +
    +
    +
    public interface DAO
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/DAOImplementation.html b/dist/javadoc/Other/DAOImplementation.html new file mode 100644 index 0000000..32366f5 --- /dev/null +++ b/dist/javadoc/Other/DAOImplementation.html @@ -0,0 +1,238 @@ + + + + + + +DAOImplementation + + + + + + + + + + + + +
+
Other
+

Class DAOImplementation

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.DAOImplementation
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class DAOImplementation
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DAOImplementation() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DAOImplementation

        +
        public DAOImplementation()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/MathService.html b/dist/javadoc/Other/MathService.html new file mode 100644 index 0000000..41a87de --- /dev/null +++ b/dist/javadoc/Other/MathService.html @@ -0,0 +1,350 @@ + + + + + + +MathService + + + + + + + + + + + + +
+
Other
+

Class MathService

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.MathService
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class MathService
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MathService() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static doubledoProduct(double[] a, + double[] b) 
      static voidmain(java.lang.String[] args) 
      static double[][]MatrixNormalize(double[][] x) 
      static doublesigmoid(double x) 
      static doublesigmoid(double[] x, + double[] w) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/Other/ModelSelectionHibernateEntity.html b/dist/javadoc/Other/ModelSelectionHibernateEntity.html new file mode 100644 index 0000000..1b21656 --- /dev/null +++ b/dist/javadoc/Other/ModelSelectionHibernateEntity.html @@ -0,0 +1,238 @@ + + + + + + +ModelSelectionHibernateEntity + + + + + + + + + + + + +
+
Other
+

Class ModelSelectionHibernateEntity

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.ModelSelectionHibernateEntity
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ModelSelectionHibernateEntity
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ModelSelectionHibernateEntity

        +
        public ModelSelectionHibernateEntity()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/Other/MyOwnArrayList.html b/dist/javadoc/Other/MyOwnArrayList.html new file mode 100644 index 0000000..bdac46f --- /dev/null +++ b/dist/javadoc/Other/MyOwnArrayList.html @@ -0,0 +1,285 @@ + + + + + + +MyOwnArrayList + + + + + + + + + + + + +
+
Other
+

Class MyOwnArrayList

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Other.MyOwnArrayList
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class MyOwnArrayList
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MyOwnArrayList() 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MyOwnArrayList

        +
        public MyOwnArrayList()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileReader.html b/dist/javadoc/WorkFiles/FileReader.html new file mode 100644 index 0000000..da1f07f --- /dev/null +++ b/dist/javadoc/WorkFiles/FileReader.html @@ -0,0 +1,243 @@ + + + + + + +FileReader + + + + + + + + + + + + +
+
WorkFiles
+

Class FileReader

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • WorkFiles.FileReader
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    FileWorker
    +
    +
    +
    +
    public class FileReader
    +extends java.lang.Object
    +implements FileWorker
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FileReader() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FileReader

        +
        public FileReader()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileWorker.html b/dist/javadoc/WorkFiles/FileWorker.html new file mode 100644 index 0000000..7fd473e --- /dev/null +++ b/dist/javadoc/WorkFiles/FileWorker.html @@ -0,0 +1,172 @@ + + + + + + +FileWorker + + + + + + + + + + + + +
+
WorkFiles
+

Interface FileWorker

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    FileReader, FileWriter
    +
    +
    +
    +
    public interface FileWorker
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/WorkFiles/FileWriter.html b/dist/javadoc/WorkFiles/FileWriter.html new file mode 100644 index 0000000..68144fb --- /dev/null +++ b/dist/javadoc/WorkFiles/FileWriter.html @@ -0,0 +1,243 @@ + + + + + + +FileWriter + + + + + + + + + + + + +
+
WorkFiles
+

Class FileWriter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • WorkFiles.FileWriter
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    FileWorker
    +
    +
    +
    +
    public class FileWriter
    +extends java.lang.Object
    +implements FileWorker
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FileWriter() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FileWriter

        +
        public FileWriter()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/Model/NaiveBayes.html b/dist/javadoc/result/machinelearning/Model/NaiveBayes.html new file mode 100644 index 0000000..a1c1c9f --- /dev/null +++ b/dist/javadoc/result/machinelearning/Model/NaiveBayes.html @@ -0,0 +1,391 @@ + + + + + + +NaiveBayes + + + + + + + + + + + + +
+
result.machinelearning.Model
+

Class NaiveBayes

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.Model.NaiveBayes
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MlModel
    +
    +
    +
    +
    public class NaiveBayes
    +extends java.lang.Object
    +implements MlModel
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NaiveBayes(float alpha, + boolean parallel) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      floatgetAlpha() 
      double[][]getWeights() 
      booleanisFitted() 
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      MlModeltrain(double[][] X, + int[] y) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html new file mode 100644 index 0000000..5df2d12 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/CountVectorizer.html @@ -0,0 +1,447 @@ + + + + + + +CountVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class CountVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.CountVectorizer
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CountVectorizer() 
      CountVectorizer(float minDf, + float maxDf) 
      CountVectorizer(float minDf, + float maxDf, + java.lang.String[] stopWords, + boolean parralize) +
      Два конструктора
      +
      CountVectorizer(java.lang.String[] stopWords) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) +
      Заполняет матрицу
      +
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) +
      Заполняет матрицу
      +
      floatgetMaxDf() 
      floatgetMinDf() +
      Геттеры для полей
      +
      java.util.List<java.lang.String>preprocess(java.lang.String text) +
      Метод извлекающий слова из переданного в метод текста.
      +
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) +
      Возвращает список Мапов из слов, взятых из переданного списка текстов
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(float minDf,
        +                       float maxDf,
        +                       java.lang.String[] stopWords,
        +                       boolean parralize)
        +
        Два конструктора
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(float minDf,
        +                       float maxDf)
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer(java.lang.String[] stopWords)
        +
      • +
      + + + +
        +
      • +

        CountVectorizer

        +
        public CountVectorizer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        preprocess

        +
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
        Метод извлекающий слова из переданного в метод текста. + Не учитываются слова поля из
        +
        +
        Specified by:
        +
        preprocess in interface SequenceProcessor
        +
        Parameters:
        +
        text - Текст, из которого извлекаются слова
        +
        Returns:
        +
        Список слов
        +
        See Also:
        +
        Используется класс, +для стемминга
        +
        +
      • +
      + + + +
        +
      • +

        transform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
        Возвращает список Мапов из слов, взятых из переданного списка текстов
        +
        +
        Specified by:
        +
        transform in interface SequenceProcessor
        +
        Parameters:
        +
        listOfTexts - Список текстов
        +
        Returns:
        +
        Список Мапов
        +
        +
      • +
      + + + +
        +
      • +

        getMinDf

        +
        public float getMinDf()
        +
        Геттеры для полей
        +
        +
        See Also:
        +
        и, +maxDf
        +
        +
      • +
      + + + +
        +
      • +

        getMaxDf

        +
        public float getMaxDf()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html b/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html new file mode 100644 index 0000000..8c41de3 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/LogisticRegression.html @@ -0,0 +1,422 @@ + + + + + + +LogisticRegression + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class LogisticRegression

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.LogisticRegression
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, MlModel
    +
    +
    +
    +
    public class LogisticRegression
    +extends java.lang.Object
    +implements MlModel, java.io.Serializable
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      LogisticRegression() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static double[][]init(double[][] X) +
      Инициализация массива векторв - нужно добавить первый столбец с одними единицами
      +
      int[]predict(double[] X) 
      double[]predictProba(double[] X) 
      voidsaveToFile(java.lang.String filename) 
      static doublesigmoid(double z) 
      doubless(double[] X) +
      Вспомогательный класс, который помогает вычислить сумму произведений координат вектора их весов
      +
      MlModeltrain(double[][] X, + int[] y) +
      Тренировка весов + С каждой итерацией вероятность будет точнее и точнее
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LogisticRegression

        +
        public LogisticRegression()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/MlModel.html b/dist/javadoc/result/machinelearning/preprocessing/MlModel.html new file mode 100644 index 0000000..399e5de --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/MlModel.html @@ -0,0 +1,291 @@ + + + + + + +MlModel + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface MlModel

+
+
+
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html b/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html new file mode 100644 index 0000000..322c33c --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/PorterStemmer.html @@ -0,0 +1,290 @@ + + + + + + +PorterStemmer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class PorterStemmer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.PorterStemmer
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class PorterStemmer
    +extends java.lang.Object
    +
    Stolen by ilysko on 03.08.17. + original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PorterStemmer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) +
      Some tests
      +
      java.lang.Stringstem(java.lang.String word) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PorterStemmer

        +
        public PorterStemmer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        stem

        +
        public java.lang.String stem(java.lang.String word)
        +
      • +
      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
        Some tests
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html b/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html new file mode 100644 index 0000000..7d23e8d --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/SequenceProcessor.html @@ -0,0 +1,265 @@ + + + + + + +SequenceProcessor + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface SequenceProcessor

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fitAndTransform

        +
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      + + + +
        +
      • +

        fit

        +
        void fit(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      + + + +
        +
      • +

        preprocess

        +
        java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        transform

        +
        java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html new file mode 100644 index 0000000..6813a2e --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/TfidfVectorizer.html @@ -0,0 +1,333 @@ + + + + + + +TfidfVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class TfidfVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.TfidfVectorizer
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TfidfVectorizer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidfit(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>fitAndTransform(java.util.List<java.lang.String> listOfTexts) 
      java.util.List<java.lang.String>preprocess(java.lang.String text) 
      java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>transform(java.util.List<java.lang.String> listOfTexts) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TfidfVectorizer

        +
        public TfidfVectorizer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fitAndTransform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fitAndTransform(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        fitAndTransform in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        fit

        +
        public void fit(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        fit in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        preprocess

        +
        public java.util.List<java.lang.String> preprocess(java.lang.String text)
        +
        +
        Specified by:
        +
        preprocess in interface SequenceProcessor
        +
        +
      • +
      + + + +
        +
      • +

        transform

        +
        public java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> transform(java.util.List<java.lang.String> listOfTexts)
        +
        +
        Specified by:
        +
        transform in interface SequenceProcessor
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html b/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html new file mode 100644 index 0000000..8988857 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/TfldfVectorizer.html @@ -0,0 +1,243 @@ + + + + + + +TfldfVectorizer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Class TfldfVectorizer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • result.machinelearning.preprocessing.TfldfVectorizer
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Transformer
    +
    +
    +
    +
    public class TfldfVectorizer
    +extends java.lang.Object
    +implements Transformer
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TfldfVectorizer() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TfldfVectorizer

        +
        public TfldfVectorizer()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/result/machinelearning/preprocessing/Transformer.html b/dist/javadoc/result/machinelearning/preprocessing/Transformer.html new file mode 100644 index 0000000..36b8b02 --- /dev/null +++ b/dist/javadoc/result/machinelearning/preprocessing/Transformer.html @@ -0,0 +1,172 @@ + + + + + + +Transformer + + + + + + + + + + + + +
+
result.machinelearning.preprocessing
+

Interface Transformer

+
+
+
+ +
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html new file mode 100644 index 0000000..be285f9 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingExample.html @@ -0,0 +1,272 @@ + + + + + + +ExceptionCatchingExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ExceptionCatchingExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ExceptionCatchingExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ExceptionCatchingExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExceptionCatchingExample

        +
        public ExceptionCatchingExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html new file mode 100644 index 0000000..ff9b0a9 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.html @@ -0,0 +1,272 @@ + + + + + + +ExceptionCatchingIhExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ExceptionCatchingIhExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ExceptionCatchingIhExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ExceptionCatchingIhExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExceptionCatchingIhExample

        +
        public ExceptionCatchingIhExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html new file mode 100644 index 0000000..1a5f115 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/MyExceptionClassExample.html @@ -0,0 +1,334 @@ + + + + + + +MyExceptionClassExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class MyExceptionClassExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • ru.caf82.lectures.lecture04.MyExceptionClassExample
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class MyExceptionClassExample
    +extends java.lang.Exception
    +
    Created by ilysko on 24.09.17.
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample()
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(java.lang.Exception e)
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(int amountOfSmth)
        +
      • +
      + + + +
        +
      • +

        MyExceptionClassExample

        +
        public MyExceptionClassExample(java.lang.String messageFullOfAnger)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html new file mode 100644 index 0000000..08adc0c --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/StackTraceExample.html @@ -0,0 +1,273 @@ + + + + + + +StackTraceExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class StackTraceExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.StackTraceExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class StackTraceExample
    +extends java.lang.Object
    +
    Created by ilysko on 24.09.17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      StackTraceExample() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StackTraceExample

        +
        public StackTraceExample()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html new file mode 100644 index 0000000..fcc854c --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.NegException.html @@ -0,0 +1,227 @@ + + + + + + +ThrowExample.NegException + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ThrowExample.NegException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • ru.caf82.lectures.lecture04.ThrowExample.NegException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    Enclosing class:
    +
    ThrowExample
    +
    +
    +
    +
    public static class ThrowExample.NegException
    +extends java.lang.Exception
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html new file mode 100644 index 0000000..1462228 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/ThrowExample.html @@ -0,0 +1,313 @@ + + + + + + +ThrowExample + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class ThrowExample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.ThrowExample
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ThrowExample
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class ThrowExample.NegException 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ThrowExample() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static intdivide(int a, + int b) 
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ThrowExample

        +
        public ThrowExample()
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html b/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html new file mode 100644 index 0000000..0b04e86 --- /dev/null +++ b/dist/javadoc/ru/caf82/lectures/lecture04/WorkWithExceptions.html @@ -0,0 +1,278 @@ + + + + + + +WorkWithExceptions + + + + + + + + + + + + +
+
ru.caf82.lectures.lecture04
+

Class WorkWithExceptions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • ru.caf82.lectures.lecture04.WorkWithExceptions
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class WorkWithExceptions
    +extends java.lang.Object
    +
    Created by ilysko on 24.09.17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      WorkWithExceptions() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/manifest.mf b/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/src/exceptions/EmptyArrayException.java b/src/exceptions/EmptyArrayException.java new file mode 100644 index 0000000..b95ae07 --- /dev/null +++ b/src/exceptions/EmptyArrayException.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package exceptions; + +/** + * + * @author User + */ +public class EmptyArrayException extends Exception{ + public EmptyArrayException(){ + super(); + } + public EmptyArrayException(String message){ + super(message); + } + public EmptyArrayException(String message, Throwable cause){ + super(message,cause); + } + public EmptyArrayException(Throwable cause){ + super(cause); + } +} diff --git a/src/exceptions/InconveninentShapeException.java b/src/exceptions/InconveninentShapeException.java new file mode 100644 index 0000000..f523b86 --- /dev/null +++ b/src/exceptions/InconveninentShapeException.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package exceptions; + +/** + * + * @author User + */ +public class InconveninentShapeException extends Exception{ + public InconveninentShapeException(){ + super(); + } + public InconveninentShapeException(String message){ + super(message); + } + public InconveninentShapeException(String message, Throwable cause){ + super(message, cause); + } + public InconveninentShapeException(Throwable cause){ + super(cause); + } +} diff --git a/src/exceptions/ModelNotFittedException.java b/src/exceptions/ModelNotFittedException.java new file mode 100644 index 0000000..84e3fc5 --- /dev/null +++ b/src/exceptions/ModelNotFittedException.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package exceptions; + +/** + * + * @author User + */ +public class ModelNotFittedException extends Exception { + ModelNotFittedException() { + super(); + } + ModelNotFittedException(String message) { + super(message); + } + ModelNotFittedException(Throwable cause) { + super(cause); + } + ModelNotFittedException(Throwable cause, String message) { + super(message); + } +} + diff --git a/src/other/HomeWork.java b/src/other/HomeWork.java new file mode 100644 index 0000000..9c250cc --- /dev/null +++ b/src/other/HomeWork.java @@ -0,0 +1,61 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import result.machinelearning.preprocessing.LogisticRegression; + +/** + * + * @author Danny + */ +public class HomeWork { + public static void main(String[] args) throws IOException, FileNotFoundException, ClassNotFoundException{ + HomeWork nc=new HomeWork(); + nc.ReadFromFile("fgg"); + nc.saveMlModelToFile(); + nc.readFromFile(); + } + public void ReadFromFile(String filename) throws IOException { + File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); + FileReader fir=new FileReader(file); + if(!file.exists())System.out.println("File no exist"); + StringBuffer sb=new StringBuffer(); + try{ + BufferedReader br=new BufferedReader(fir); + String s; + while ((s = br.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + } + catch(Exception e){ + System.out.println(e); + } + System.out.println(sb); + } + public void saveMlModelToFile() throws FileNotFoundException, IOException{ + FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + ObjectOutputStream os=new ObjectOutputStream(file); + LogisticRegression lr=new LogisticRegression(); + os.writeObject(lr); + os.close(); + } + public void readFromFile() throws FileNotFoundException, IOException, ClassNotFoundException{ + ObjectInputStream os=new ObjectInputStream(new FileInputStream("C:\\users\\user\\desktop\\work\\Save.dat")); + LogisticRegression lg=(LogisticRegression)os.readObject(); + double wes[]=lg.getWeights(); + for(double w:wes)System.out.println(w); + } +} diff --git a/src/other/MathService.java b/src/other/MathService.java new file mode 100644 index 0000000..4c626c5 --- /dev/null +++ b/src/other/MathService.java @@ -0,0 +1,54 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; +import exceptions.EmptyArrayException; +import exceptions.InconveninentShapeException; + +/** + * + * @author User + */ +public class MathService { + public static double doProduct(double[] a, double[] b) throws InconveninentShapeException,EmptyArrayException{ + double result=0; + boolean TT=true; + if(a.length!=b.length) throw new InconveninentShapeException("DoProduct: разные размеры массивов!"); + if(a.length==0 | b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); + for (int x=0;x implements Iterable { + + private Object[] ElementData; + + MyOwnArrayList() { + this(10); + } + + MyOwnArrayList(int i) { + if (i < 0) { + throw new IllegalArgumentException("Illegal Capacity: " + i); + } + this.ElementData = new Object[i]; + } + + public void add(Object ob) { + int i = 0; + for (i = 0; i < ElementData.length; i++) { + if (ElementData[i] == null) { + break; + } + } + if (i == ElementData.length) { + ensureCapacity(ElementData.length + 1); + } + ElementData[i] = ob; + } + + public int size() { + int length = ElementData.length; + return length; + } + + public int indexOf(Object ob) { + int index = 0; + for (int i = 0; i < ElementData.length; i++) { + if (ob.equals(ElementData[i])) { + return i; + } + } + return -1; + } + + public boolean contains(Object ob) { + return indexOf(ob) > 0; + } + + public void remove(int index) { + System.arraycopy(ElementData, index + 1, ElementData, index, ElementData.length - index - 1); + ElementData[ElementData.length - 1] = null; + Object[] NewElementData = new Object[ElementData.length - 1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length - 1); + ElementData = new Object[NewElementData.length]; + ElementData = NewElementData; + + } + + public void remove(Object ob) { + int index = 0; + for (int i = 0; i < ElementData.length; i++) { + if (ob.equals(ElementData[i])) { + index = i; + break; + } + } + remove(index); + } + + public void set(int index, Object ob) { + ElementData[index] = ob; + } + + public void clear() { + for (int i = 0; i < ElementData.length; i++) { + ElementData[i] = null; + } + ElementData = new Object[0]; + } + + private void ensureCapacity(int copacity) { + if (copacity - ElementData.length > 0) { + Object[] NewElementData = new Object[ElementData.length + 1]; + System.arraycopy(ElementData, 0, NewElementData, 0, ElementData.length); + ElementData = new Object[NewElementData.length]; + ElementData = NewElementData; + } + } + + /* + Для проверки методов + */ + public void showAll() { + for (Object x : ElementData) { + System.out.println("Element: " + x); + } + } + + @Override + public Iterator iterator() { + return new Iterator() { + int i = 0; + + @Override + public boolean hasNext() { + return (ElementData[i] != null); + } + + @Override + public Object next() { + return ElementData[i++]; + } + }; + } +} diff --git a/src/other/MyOwnLinkedList.java b/src/other/MyOwnLinkedList.java new file mode 100644 index 0000000..2896331 --- /dev/null +++ b/src/other/MyOwnLinkedList.java @@ -0,0 +1,141 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.util.Iterator; + +/** + * + * @author User + */ +public class MyOwnLinkedList implements Iterable { + + private int size; + private Entry head; + private Entry pred; + + @Override + public Iterator iterator() { + return new Iterator() { + Entry e = head; + + @Override + public boolean hasNext() { + return (e != null); + } + + @Override + public Object next() { + Object ob = e.element; + e = e.next; + return ob; + } + + }; + } + + private static class Entry { + + Object element; + Entry next; + Entry prev; + + Entry(E element) { + this.element = element; + } + } + + public void add(Object ob) { + Entry e = new Entry(ob); + if (size == 0) { + head = e; + //head.next=e; + //head.prev=e; + } else { + pred.next = e; + e.prev = pred; + } + pred = e; + //head.prev=e; + size++; + + } + + public boolean contains(Object ob) { + Entry e = head; + while (e.next != null) { + if (e.element.equals(ob)) { + return true; + } + e = e.next; + } + return false; + } + + public void remove(Object ob) { + Entry e = head; + size--; + do { + if (size == 0) { + head = null; + break; + } + if (e.element.equals(ob)) { + if (head.element.equals(ob)) { + poll(); + break; + } else if (e.next == null) { + e.prev.next = null; + break; + } else { + e.next.prev = e.prev; + e.prev.next = e.next; + break; + } + } + e = e.next; + } while (e != null); + } + + public void set(int index, Object ob) { + Entry e = head; + for (int i = 0; i < size; i++) { + if (i == index) { + e.element = ob; + } + e = e.next; + } + } + + public Object peek() { + return head.element; + } + + public void addAll(Object[] ob) { + for (Object x : ob) { + add(x); + } + } + + public Object poll() { + Entry e = head; + head = head.next; + head.prev = null; + return e.element; + } + + /* + Для проверки методов + */ + public void showAll() { + Entry e = head; + while (e.next != null) { + System.out.println(e.element); + e = e.next; + } + System.out.println(e.element); + } +} diff --git a/src/other/NewClass.java b/src/other/NewClass.java new file mode 100644 index 0000000..5a59264 --- /dev/null +++ b/src/other/NewClass.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.util.Iterator; + + +/** + * + * @author Danny + */ +public class NewClass { + public static void main(String[] args){ + MyOwnLinkedList moar=new MyOwnLinkedList(); + //Iterator it=moar.iterator(); + moar.add("SS"); + moar.add("dddddd"); + moar.add("ddd"); + //moar.showAll(); + Iterator it=moar.iterator(); + while(it.hasNext())System.out.println(it.next()); + } +} diff --git a/src/result/machinelearning/model/AbstractModel.java b/src/result/machinelearning/model/AbstractModel.java new file mode 100644 index 0000000..4ed2fd3 --- /dev/null +++ b/src/result/machinelearning/model/AbstractModel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.model; + +/** + * + * @author User + */ +public class AbstractModel { + +} diff --git a/src/result/machinelearning/model/Boosting.java b/src/result/machinelearning/model/Boosting.java new file mode 100644 index 0000000..e407ac0 --- /dev/null +++ b/src/result/machinelearning/model/Boosting.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.model; + +/** + * + * @author User + */ +public class Boosting extends AbstractModel{ + +} diff --git a/src/result/machinelearning/model/KNeighbourhood.java b/src/result/machinelearning/model/KNeighbourhood.java new file mode 100644 index 0000000..7d652f3 --- /dev/null +++ b/src/result/machinelearning/model/KNeighbourhood.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.model; + +/** + * + * @author User + */ +public class KNeighbourhood extends AbstractModel{ + +} diff --git a/src/result/machinelearning/model/LinearKernel.java b/src/result/machinelearning/model/LinearKernel.java new file mode 100644 index 0000000..3b7625a --- /dev/null +++ b/src/result/machinelearning/model/LinearKernel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.model; + +/** + * + * @author User + */ +public class LinearKernel extends KNeighbourhood{ + +} diff --git a/src/result/machinelearning/model/NaiveBayes.java b/src/result/machinelearning/model/NaiveBayes.java new file mode 100644 index 0000000..15714c2 --- /dev/null +++ b/src/result/machinelearning/model/NaiveBayes.java @@ -0,0 +1,103 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.model; + +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; +import java.io.IOException; +import result.machinelearning.preprocessing.MlModel; + +/** + * + * @author User + */ +public class NaiveBayes implements MlModel { + private float alpha; + private double[][] weights; + private boolean fitted; + private boolean parallel; + public NaiveBayes(float alpha, boolean parallel) { + //Миша сказал забить + } + public MlModel train(double[][] X, int[] y) throws InconveninentShapeException { + //считаем у=0 и y=1 + if (X.length != y.length) + throw new InconveninentShapeException(); + double yZer = 0, yOne = 0; + for (int i=0; i matrix = new HashMap<>(); +private String[] stopWords; +final float minDf; +final float maxDf; +final boolean parralize; +private static List defaultStopWordsList = new ArrayList( +Arrays.asList(new String[]{ +"а","е","и","ж","м","о","на","не","ни","об","но","он","мне","мои","мож","она","они","оно", +"мной","много","многочисленное","многочисленная","многочисленные","многочисленный", +"мною","мой","мог","могут","можно","может","можно","мор","моя","моё","мочь","над","нее", +"оба","нам","нем","нами","ними","мимо","немного","одной","одного","менее","однажды","однако", +"меня","нему","меньше","ней","наверху","него","ниже","мало","надо","один","одиннадцать","одиннадцатый", +"назад","наиболее","недавно","миллионов","недалеко","между","низко","меля","нельзя","нибудь", +"непрерывно","наконец","никогда","никуда","нас","наш","нет","нею","неё","них","мира","наша", +"наше","наши","ничего","начала","нередко","несколько","обычно","опять","около","мы","ну","нх","от","отовсюду", +"особенно","нужно","очень","отсюда","в","во","вон","вниз","внизу","вокруг","вот","восемнадцать", +"восемнадцатый","восемь","восьмой","вверх","вам","вами","важное","важная","важные","важный","вдали","везде", +"ведь","вас","ваш","ваша","ваше","ваши","впрочем","весь","вдруг","вы","все","второй","всем","всеми","времени","время", +"всему","всего","всегда","всех","всею","всю","вся","всё","всюду","г","год","говорил","говорит","года","году","где", +"да","ее","за","из","ли","же","им","до","по","ими","под","иногда","довольно","именно","долго","позже", +"более","должно","пожалуйста","значит","иметь","больше","пока","ему","имя","пор","пора","потом","потому","после", +"почему","почти","посреди","ей","два","две","двенадцать","двенадцатый","двадцать","двадцатый", +"двух","его","дел","или","без","день","занят","занята","занято","заняты","действительно","давно", +"девятнадцать","девятнадцатый","девять","девятый","даже","алло","жизнь","далеко","близко","здесь","дальше","для", +"лет","зато","даром","первый","перед","затем","зачем","лишь","десять","десятый","ею","её","их","бы","еще","при", +"был","про","процентов","против","просто","бывает","бывь","если","люди","была","были","было","будем","будет","будете","будешь", +"прекрасно","буду","будь","будто","будут","ещё","пятнадцать","пятнадцатый","друго","другое","другой","другие","другая","других","есть","пять", +"быть","лучше","пятый","к","ком","конечно","кому","кого","когда","которой","которого","которая","которые","который","которых","кем", +"каждое","каждая","каждые","каждый","кажется","как","какой","какая","кто","кроме","куда","кругом","с","т","у","я", +"та","те","уж","со","то","том","снова","тому","совсем","того","тогда","тоже","собой","тобой","собою","тобою", +"сначала","только","уметь","тот","тою","хорошо","хотеть","хочешь","хоть","хотя","свое","свои","твой","своей","своего","своих", +"свою","твоя","твоё","раз","уже","сам","там","тем","чем","сама","сами","теми","само","рано","самом","самому", +"самой","самого","семнадцать","семнадцатый","самим","самими","самих","саму", +"семь","чему","раньше","сейчас","чего","сегодня","себе","тебе","сеаой","человек","разве","теперь","себя","тебя","седьмой","спасибо", +"слишком","так","такое","такой","такие","также","такая","сих","тех","чаще","четвертый","через","часто","шестой","шестнадцать","шестнадцатый", +"шесть","четыре","четырнадцать","четырнадцатый","сколько","сказал","сказала","сказать", +"ту","ты","три","эта","эти","что","это","чтоб","этом","этому","этой","этого","чтобы","этот","стал","туда", +"этим","этими","рядом","тринадцать","тринадцатый","этих","третий","тут","эту","суть","чуть","тысяч" +}) +); + +/** +* Заполняет матрицу +* @see CountVectorizer#matrix слова и возвращает список Мапов +* @param listOfTexts Список текстов +* @return Список Мапов +*/ +@Override +public List> fitAndTransform(List listOfTexts) { +List> listOfMaps = new ArrayList<>(); +for (String text : listOfTexts) { +List list = preprocess(text); +listOfMaps.add(countWordsAndEditMatrix(list)); +} +return listOfMaps; +} + +/** +* Заполняет матрицу +* @see CountVectorizer#matrix словами из списка текстов +* @param listOfTexts Список текстов +*/ +@Override +public void fit(List listOfTexts) { +for (String text : listOfTexts) { +List list = preprocess(text); +countWordsAndEditMatrix(list); +} +} + +/** +* Метод извлекающий слова из переданного в метод текста. +* Не учитываются слова поля из +* @see CountVectorizer#defaultStopWordsList +* Используется класс +* @see PorterStemmer для стемминга +* @param text Текст, из которого извлекаются слова +* @return Список слов +*/ +@Override +public List preprocess(String text) { +PorterStemmer stemmer = new PorterStemmer(); +text = text.toLowerCase().replaceAll("[^а-я -]","").replaceAll(" +-"," ").replaceAll("- +"," "); + +String[] array = text.split(" +"); +for (int i = 0; i list = new ArrayList(Arrays.asList(array)); +list.removeAll(defaultStopWordsList); +return list; +} + +/** +* Возвращает список Мапов из слов, взятых из переданного списка текстов +* @param listOfTexts Список текстов +* @return Список Мапов +*/ +@Override +public List> transform(List listOfTexts) { +List> listOfMaps = new ArrayList<>(); +for (String text : listOfTexts) { +List list = preprocess(text); +listOfMaps.add(countWords(list)); +} +return listOfMaps; +} + +/** +* Два конструктора +*/ +public CountVectorizer(float minDf, float maxDf, String[] stopWords, boolean parralize) { +this.minDf = minDf; +this.maxDf = maxDf; +this.stopWords = stopWords; +this.parralize = parralize; +} +public CountVectorizer(float minDf, float maxDf) { +this.minDf = minDf; +this.maxDf = maxDf; +parralize = false; +} +public CountVectorizer(String[] stopWords) { +this.stopWords = stopWords; +minDf = 1; +maxDf = 1; +parralize = false; +} +public CountVectorizer() { +minDf = 1; +maxDf = 1; +parralize = false; +} + +/** +* Геттеры для полей +* @see CountVectorizer#minDf и +* @see CountVectorizer#maxDf +*/ +public float getMinDf() { +return minDf; +} +public float getMaxDf() { +return maxDf; +} + +/** +* Считает, сколько раз встретилось одно слово в переданном списке слов +* @param words Список слов, в котором счиатем слова +* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово +*/ + +private Map countWords(List words) { +Map map = new HashMap(); +int value = 1; +for (String word : words) { +if (map.containsKey(word)) { +value += map.get(word); +} + +map.put(word, value); +} +return map; +} + +/** +* Делаем то же самое, что и в методе +* @see CountVectorizer#countWords(List), но еще и добавляем это в матрицу +* @see CountVectorizer#matrix +* @param words Список слов, в котором счиатем слова +* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово +*/ +private Map countWordsAndEditMatrix(List words) { +Map map = countWords(words); +int valueFromMatrix = 0; +for (Map.Entry pair : map.entrySet()) { +String key = pair.getKey(); +if (matrix.containsKey(key)) { +valueFromMatrix = matrix.get(key); +} +matrix.put(key, valueFromMatrix + pair.getValue()); +} +return map; +} + +} + diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java new file mode 100644 index 0000000..c984737 --- /dev/null +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -0,0 +1,188 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +import exceptions.EmptyArrayException; +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; +import java.io.Serializable; +import java.util.Random; +import other.MathService; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author User + */ +public class LogisticRegression implements MlModel, Serializable { +//private float alpha; +//private float betta; +//private boolean parralize; +//private float learnRate; +//private Random initializer = new Random(); +private int ITERATES=1000; +private double rate=0.001; + +private double[] weights; +//private boolean fitted = false; + + // public LogisticRegression2(float alpha, float betta, int maxIter, float learnRate, boolean parralize) {} + public static double sigmoid(double z){ + return 1/(1+Math.exp(-z)); + } + /** + * Инициализация массива векторв - нужно добавить первый столбец с одними единицами + * @param X - координаты векторов + * @return + */ + static public double[][] init(double[][]X){ + int i,j; + double [][]Y=new double[X.length][X.length+1]; + for(i=0;i0.5){ + System.out.println("It is a dog"); + probability[0]=1; + }else if(ver<0.4){ + System.out.println("It is a cat"); + probability[0]=0; + } + else { + System.out.println("I don't know"); + probability[0]=-1; + } + return probability; + } + + @Override + public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + public void ReadFromFile(String filename) throws IOException { + File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); + FileReader fir=new FileReader(file); + if(!file.exists())System.out.println("File no exist"); + StringBuffer sb=new StringBuffer(); + try{ + BufferedReader br=new BufferedReader(fir); + String s; + while ((s = br.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + } + catch(Exception e){ + System.out.println(e); + } + } + public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException{ + FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + ObjectOutputStream os=new ObjectOutputStream(file); + LogisticRegression lr=new LogisticRegression(); + os.writeObject(lr); + os.close(); + } + + public double[] getWeights() { + return weights; + } + + public void setWeights(double[] weights) { + this.weights = weights; + } + @Override + public void saveToFile(String filename) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} +// public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} + +// public double[] getWeights() {} +// public float getAlpha() {} +// public void setAlpha(float alpha) {} +// public float getBetta() {} +// public void setBetta(float betta) {} +// public int getMaxIter() {} +// public void setMaxIter(int maxIter) {} +// public boolean isParralize() {} +// public void setParralize(boolean parralize) {} +// public float getLearnRate() {} +// public void setLearnRate(float learnRate) {} +// private double lossFunction(double[][] X, double[] W, int[] y) throws InconveninentShapeException {} +// private double[] lossFunctionDerivative(double[][] X, double[] W, +// int[] y, float alpha, float betta) throws InconveninentShapeException {} +//} diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java new file mode 100644 index 0000000..c4a5dcd --- /dev/null +++ b/src/result/machinelearning/preprocessing/MlModel.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +import exceptions.InconveninentShapeException; +import exceptions.ModelNotFittedException; +import java.io.IOException; + +/** + * + * @author User + */ +public interface MlModel { + MlModel train(double[][] X, int[] y) throws InconveninentShapeException; + + int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; + + double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; + + + void saveToFile(String filename) throws IOException; + + +} diff --git a/src/result/machinelearning/preprocessing/PorterStemmer.java b/src/result/machinelearning/preprocessing/PorterStemmer.java new file mode 100644 index 0000000..c6322fc --- /dev/null +++ b/src/result/machinelearning/preprocessing/PorterStemmer.java @@ -0,0 +1,100 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Stolen by ilysko on 03.08.17. + * original: http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html + */ +public class PorterStemmer { + + private static final Pattern PERFECTIVEGROUND = Pattern.compile("((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$"); + + private static final Pattern REFLEXIVE = Pattern.compile("(с[яь])$"); + + private static final Pattern ADJECTIVE = Pattern.compile("(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$"); + + private static final Pattern PARTICIPLE = Pattern.compile("((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$"); + + private static final Pattern VERB = Pattern.compile("((ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)|((?<=[ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)))$"); + + private static final Pattern NOUN = Pattern.compile("(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$"); + + private static final Pattern RVRE = Pattern.compile("^(.*?[аеиоуыэюя])(.*)$"); + + private static final Pattern DERIVATIONAL = Pattern.compile(".*[^аеиоуыэюя]+[аеиоуыэюя].*ость?$"); + + private static final Pattern DER = Pattern.compile("ость?$"); + + private static final Pattern SUPERLATIVE = Pattern.compile("(ейше|ейш)$"); + + private static final Pattern I = Pattern.compile("и$"); + private static final Pattern P = Pattern.compile("ь$"); + private static final Pattern NN = Pattern.compile("нн$"); + + public String stem(String word) { + word = word.toLowerCase(); + word = word.replace('ё', 'е'); + Matcher m = RVRE.matcher(word); + if (m.matches()) { + String pre = m.group(1); + String rv = m.group(2); + String temp = PERFECTIVEGROUND.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = REFLEXIVE.matcher(rv).replaceFirst(""); + temp = ADJECTIVE.matcher(rv).replaceFirst(""); + if (!temp.equals(rv)) { + rv = temp; + rv = PARTICIPLE.matcher(rv).replaceFirst(""); + } else { + temp = VERB.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = NOUN.matcher(rv).replaceFirst(""); + } else { + rv = temp; + } + } + + } else { + rv = temp; + } + + rv = I.matcher(rv).replaceFirst(""); + + if (DERIVATIONAL.matcher(rv).matches()) { + rv = DER.matcher(rv).replaceFirst(""); + } + + temp = P.matcher(rv).replaceFirst(""); + if (temp.equals(rv)) { + rv = SUPERLATIVE.matcher(rv).replaceFirst(""); + rv = NN.matcher(rv).replaceFirst("н"); + } else { + rv = temp; + } + word = pre + rv; + + } + + return word; + } + + /** + * Some tests + */ + public static void main(String[] args) { + PorterStemmer porterStemmer = new PorterStemmer(); + String[] listOfWords = new String[] {"букварь", "здравие", + "птица", "интересный", "космос", "космический"}; + for (String word: listOfWords) { + System.out.println("Результат применения PorterStemmer к слову " + word + " : " +porterStemmer.stem(word)); + } + } + +} \ No newline at end of file diff --git a/src/result/machinelearning/preprocessing/SequenceProcessor.java b/src/result/machinelearning/preprocessing/SequenceProcessor.java new file mode 100644 index 0000000..76c289b --- /dev/null +++ b/src/result/machinelearning/preprocessing/SequenceProcessor.java @@ -0,0 +1,24 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +import java.util.List; +import java.util.Map; + +/** + * + * @author User + */ +public interface SequenceProcessor { + public List> fitAndTransform(List listOfTexts); + + public void fit(List listOfTexts); + + public List preprocess(String text); + + public List> transform(List listOfTexts); + +} diff --git a/src/result/machinelearning/preprocessing/TfidfVectorizer.java b/src/result/machinelearning/preprocessing/TfidfVectorizer.java new file mode 100644 index 0000000..ff66a62 --- /dev/null +++ b/src/result/machinelearning/preprocessing/TfidfVectorizer.java @@ -0,0 +1,30 @@ +package result.machinelearning.preprocessing; + +import java.util.List; +import java.util.Map; + +/** + * Created by ilysko on 03.08.17. + */ +public class TfidfVectorizer implements SequenceProcessor, Transformer { + + @Override + public List> fitAndTransform(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void fit(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public List preprocess(String text) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public List> transform(List listOfTexts) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } +} diff --git a/src/result/machinelearning/preprocessing/Transformer.java b/src/result/machinelearning/preprocessing/Transformer.java new file mode 100644 index 0000000..f5e1244 --- /dev/null +++ b/src/result/machinelearning/preprocessing/Transformer.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +/** + * + * @author User + */ +public interface Transformer { + +} diff --git a/src/result/machinelearning/preprocessing/WordProcessor.java b/src/result/machinelearning/preprocessing/WordProcessor.java new file mode 100644 index 0000000..c31a106 --- /dev/null +++ b/src/result/machinelearning/preprocessing/WordProcessor.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.machinelearning.preprocessing; + +/** + * + * @author User + */ +public interface WordProcessor { + +} diff --git a/src/result/other/DAO.java b/src/result/other/DAO.java new file mode 100644 index 0000000..380ef17 --- /dev/null +++ b/src/result/other/DAO.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public interface DAO { + +} diff --git a/src/result/other/DAOImplementation.java b/src/result/other/DAOImplementation.java new file mode 100644 index 0000000..ac2a0c2 --- /dev/null +++ b/src/result/other/DAOImplementation.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public class DAOImplementation { + +} diff --git a/src/result/other/ModelSelectionHibernateEntity.java b/src/result/other/ModelSelectionHibernateEntity.java new file mode 100644 index 0000000..d2ff116 --- /dev/null +++ b/src/result/other/ModelSelectionHibernateEntity.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public class ModelSelectionHibernateEntity { + +} diff --git a/src/result/other/ReviewHibernateEntity.java b/src/result/other/ReviewHibernateEntity.java new file mode 100644 index 0000000..79633cf --- /dev/null +++ b/src/result/other/ReviewHibernateEntity.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public class ReviewHibernateEntity { + +} diff --git a/src/result/other/SwingModel.java b/src/result/other/SwingModel.java new file mode 100644 index 0000000..f591e48 --- /dev/null +++ b/src/result/other/SwingModel.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public class SwingModel { + +} diff --git a/src/result/other/SwingTraining.java b/src/result/other/SwingTraining.java new file mode 100644 index 0000000..7ae56d3 --- /dev/null +++ b/src/result/other/SwingTraining.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +/** + * + * @author User + */ +public class SwingTraining { + +} diff --git a/src/result/workFiles/FileReader.java b/src/result/workFiles/FileReader.java new file mode 100644 index 0000000..45fdc48 --- /dev/null +++ b/src/result/workFiles/FileReader.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.workFiles; + +/** + * + * @author User + */ +public class FileReader implements FileWorker{ + +} diff --git a/src/result/workFiles/FileWorker.java b/src/result/workFiles/FileWorker.java new file mode 100644 index 0000000..cc0d055 --- /dev/null +++ b/src/result/workFiles/FileWorker.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.workFiles; + +/** + * + * @author User + */ +public interface FileWorker { + +} diff --git a/src/result/workFiles/FileWriter.java b/src/result/workFiles/FileWriter.java new file mode 100644 index 0000000..c0dc651 --- /dev/null +++ b/src/result/workFiles/FileWriter.java @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.workFiles; + +/** + * + * @author User + */ +public class FileWriter implements FileWorker{ + +} diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java new file mode 100644 index 0000000..8456e7c --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ExceptionCatchingExample.java @@ -0,0 +1,21 @@ +package ru.caf82.lectures.lecture04; + + +public class ExceptionCatchingExample { + + public static void main(String[] args) { + try { + System.out.println(6 / 0); + } catch (ArithmeticException ex) { + System.out.println("Ошибка! Ошибка!"); + System.out.println(ex.toString()); + } + + try { + System.out.println(Long.parseLong("Mama")); + } catch (NumberFormatException ex) { + System.out.println("Снова косяк!"); + System.out.println(ex.toString()); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java b/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java new file mode 100644 index 0000000..c4dfc32 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ExceptionCatchingIhExample.java @@ -0,0 +1,24 @@ +package ru.caf82.lectures.lecture04; + +public class ExceptionCatchingIhExample { + + public static void main(String[] args) { +// try { +// System.out.println(6 / 0); +// } catch (Exception ex) { +// System.out.println("Ошибка верхнего увроня"); +// } catch (ArithmeticException ex) { +// System.out.println("Ошибка! Ошибка!"); +// System.out.println(ex.toString()); +// } + + try { + System.out.println(Long.parseLong("Mama")); + } catch (NumberFormatException ex) { + System.out.println("Снова косяк!"); + System.out.println(ex.toString()); + } catch (Exception ex) { + System.out.println("Ошибка верхнего уровня"); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java b/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java new file mode 100644 index 0000000..b741e17 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/MyExceptionClassExample.java @@ -0,0 +1,52 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class MyExceptionClassExample extends TemplateForMyExceptionClass { + int amountOfSmth; + + void someMethod() { + System.out.println(amountOfSmth); + } + + void f() { + someMethod(); + } + + public MyExceptionClassExample() { + super(); + } + + public MyExceptionClassExample(Exception e) { + super(e); + } + + public MyExceptionClassExample(int amountOfSmth) { + super(); + this.amountOfSmth = amountOfSmth; + } + + public MyExceptionClassExample(String messageFullOfAnger) { + super(messageFullOfAnger); + } + + public static void main(String[] args) { + System.out.println("let's throw an exception!"); +// throw new MyExceptionClassExample("lol"); + } +} + +class TemplateForMyExceptionClass extends Exception { + TemplateForMyExceptionClass() { + super(); + } + + TemplateForMyExceptionClass(String message) { + super(message); + } + + TemplateForMyExceptionClass(Exception e) { + super(e); + } +} diff --git a/src/ru/caf82/lectures/lecture04/StackTraceExample.java b/src/ru/caf82/lectures/lecture04/StackTraceExample.java new file mode 100644 index 0000000..96b7f71 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/StackTraceExample.java @@ -0,0 +1,32 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class StackTraceExample { + static void f() { + try { + throw new Exception(); + } catch (Exception e) { + for (StackTraceElement ste : e.getStackTrace()) { + System.out.println(ste.getMethodName()); + } + } + } + + static void g() { + f(); + } + + static void h() { + g(); + } + + public static void main(String[] args) { + f(); + System.out.println("---------------"); + g(); + System.out.println("---------------"); + h(); + } +} diff --git a/src/ru/caf82/lectures/lecture04/ThrowExample.java b/src/ru/caf82/lectures/lecture04/ThrowExample.java new file mode 100644 index 0000000..8c3a31a --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/ThrowExample.java @@ -0,0 +1,51 @@ +package ru.caf82.lectures.lecture04; + +public class ThrowExample { + + public static int divide(int a, int b) throws ArithmeticException, NegException { + if (b == 0) { + throw new ArithmeticException("Ты че как лох-то, на нуль делить нельзя"); + } else if( b < 0) { + throw new NegException("Мы решили, что на отрицательные числа делить нельзя"); + } + return a / b; + } + + public static void main(String[] args) { + try { + System.out.println(divide(5, 2)); + System.out.println(divide(5, 0)); + } catch (ArithmeticException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (Exception ex) { + // + } + try { + System.out.println(divide(5, 2)); + System.out.println(divide(5, -1)); + } catch (NegException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (Exception ex) { + // + } + try { + System.out.println(divide(5, -1)); + System.out.println(divide(5, 0)); + } catch (ArithmeticException ex){ + System.out.println("Мы поймали ошибку!"); + } catch (NegException ex) { + System.out.println("Отрицательное деление"); + } + + } + + + public static class NegException extends Exception { + NegException(){ + super(); + } + NegException(String message) { + super(message); + } + } +} diff --git a/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java b/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java new file mode 100644 index 0000000..99a8775 --- /dev/null +++ b/src/ru/caf82/lectures/lecture04/WorkWithExceptions.java @@ -0,0 +1,40 @@ +package ru.caf82.lectures.lecture04; + +/** + * Created by ilysko on 24.09.17. + */ +public class WorkWithExceptions { + void ignore() throws Exception { + throw new Exception(); + } + + void catchHere() { + try { + throw new Exception(); + } catch (Exception e) { + System.out.println("Lol, i caught it just here!"); + } + } + + void throwAhead() { + try { + ignore(); + } catch (Exception e) { + System.out.println("We didn't try to catch exception in ignore(). " + + "We did it here"); + } + } + + void createNewExceptionWhileWorkingWithOld() throws MyExceptionClassExample { + try { + ignore(); + } catch (Exception e) { + System.out.println("do smth"); + throw new MyExceptionClassExample(e); + } + } + public static void main(String[] args) throws MyExceptionClassExample{ + WorkWithExceptions w= new WorkWithExceptions(); + w.createNewExceptionWhileWorkingWithOld(); + } +} From e6cb321ffa8182eeb7f0021934aafa2085b2f3f5 Mon Sep 17 00:00:00 2001 From: SychDan <31612319+SychDan@users.noreply.github.com> Date: Tue, 24 Oct 2017 21:14:21 +0300 Subject: [PATCH 25/29] Delete private.xml --- nbproject/private/private.xml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 nbproject/private/private.xml diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml deleted file mode 100644 index d24b155..0000000 --- a/nbproject/private/private.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnArrayList.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/NewClass.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnLinkedList.java - - - From 3eca96adc403145862eb4cd9830edaa9d88191e1 Mon Sep 17 00:00:00 2001 From: SychDan Date: Mon, 6 Nov 2017 22:20:37 +0300 Subject: [PATCH 26/29] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D0=BE=20?= =?UTF-8?q?=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nbproject/private/private.xml | 6 +- src/other/MathService.java | 5 +- src/other/MyOwnArrayList.java | 3 +- src/other/NewClass.java | 19 +- .../machinelearning/model/NaiveBayes.java | 6 + .../preprocessing/LogisticRegression.java | 280 +++++++++--------- .../preprocessing/MlModel.java | 4 +- src/result/workFiles/FileReader.java | 14 - src/result/workFiles/FileReading.java | 69 +++++ 9 files changed, 244 insertions(+), 162 deletions(-) delete mode 100644 src/result/workFiles/FileReader.java create mode 100644 src/result/workFiles/FileReading.java diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index d24b155..6807a2b 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -2,10 +2,6 @@ - - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnArrayList.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/NewClass.java - file:/C:/Users/User/Documents/NetBeansProjects/TextClassfierProject/src/Other/MyOwnLinkedList.java - + diff --git a/src/other/MathService.java b/src/other/MathService.java index 4c626c5..3a27296 100644 --- a/src/other/MathService.java +++ b/src/other/MathService.java @@ -14,7 +14,6 @@ public class MathService { public static double doProduct(double[] a, double[] b) throws InconveninentShapeException,EmptyArrayException{ double result=0; - boolean TT=true; if(a.length!=b.length) throw new InconveninentShapeException("DoProduct: разные размеры массивов!"); if(a.length==0 | b.length==0) throw new EmptyArrayException("DoProduct: пустые массивы!"); for (int x=0;x> X, List y) throws InconveninentShapeException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index c984737..2bfaa84 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -9,7 +9,6 @@ import exceptions.InconveninentShapeException; import exceptions.ModelNotFittedException; import java.io.Serializable; -import java.util.Random; import other.MathService; import java.io.BufferedReader; import java.io.File; @@ -18,140 +17,169 @@ import java.io.FileReader; import java.io.IOException; import java.io.ObjectOutputStream; -import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; /** * - * @author User + * @author Danny */ public class LogisticRegression implements MlModel, Serializable { -//private float alpha; -//private float betta; -//private boolean parralize; -//private float learnRate; -//private Random initializer = new Random(); -private int ITERATES=1000; -private double rate=0.001; -private double[] weights; -//private boolean fitted = false; + private final int ITERATES = 1000; + private final double rate = 0.001; + private double[] weights = null; - // public LogisticRegression2(float alpha, float betta, int maxIter, float learnRate, boolean parralize) {} - public static double sigmoid(double z){ - return 1/(1+Math.exp(-z)); - } /** - * Инициализация массива векторв - нужно добавить первый столбец с одними единицами + * Инициализация массива векторв - нужно добавить первый столбец с одними + * единицами + * * @param X - координаты векторов - * @return + * @return */ - static public double[][] init(double[][]X){ - int i,j; - double [][]Y=new double[X.length][X.length+1]; - for(i=0;i0.5){ - System.out.println("It is a dog"); - probability[0]=1; - }else if(ver<0.4){ - System.out.println("It is a cat"); - probability[0]=0; - } - else { - System.out.println("I don't know"); - probability[0]=-1; - } - return probability; - } + private List> init(List> X) { + int i, j; + List> xx = new ArrayList>(); + for (i = 0; i < X.size(); i++) { + xx.get(i).add(1); + for (j = 0; j < X.get(1).size(); j++) { + xx.get(i).add(X.get(i).get(j)); + } + } + return xx; + } - @Override - public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + /** + * Список Integer в массив double + * + * @param list + * @return + */ + private double[] toIntArray(List list) { + double[] intArray = new double[list.size()]; + for (int i = 0; i < list.size(); i++) { + intArray[i] = list.get(i); + } + return intArray; } - public void ReadFromFile(String filename) throws IOException { - File file =new File("C:\\users\\user\\desktop\\work\\DD.txt"); - FileReader fir=new FileReader(file); - if(!file.exists())System.out.println("File no exist"); - StringBuffer sb=new StringBuffer(); - try{ - BufferedReader br=new BufferedReader(fir); - String s; - while ((s = br.readLine()) != null) { - sb.append(s); - sb.append("\n"); + /** + * Список boolean в массив double + * + * @param list + * @return + */ + private double[] toBoolArray(List list) { + double[] intArray = new double[list.size()]; + for (int i = 0; i < list.size(); i++) { + if (list.get(i) == true) { + intArray[i] = 1; + } else { + intArray[i] = 0; + } + } + return intArray; + } + + /** + * Тренировка весов С каждой итерацией вероятность будет точнее и точнее + * + * @param X полученные вектора из CountVectorizer + * @param y возможные варианты (1 или 0) + * @return + * @throws InconveninentShapeException + */ + @Override + public MlModel train(List> X, List y) throws InconveninentShapeException { + + double pr = 0; + double[] sumdelta; //сумма дельт в каждом столбце + int i, j; + weights = new double[X.get(1).size() + 1]; + X = init(X); + double delta[]; + sumdelta = new double[X.size()]; + for (int u = 0; u < ITERATES; u++) { + delta = new double[X.size()]; + for (i = 0; i < X.size(); i++) { + try { + pr = MathService.sigmoid(MathService.doProduct(toIntArray(X.get(i)), weights)); + } catch (EmptyArrayException ex) { + Logger.getLogger(LogisticRegression.class.getName()).log(Level.SEVERE, null, ex); + } + for (j = 0; j < X.get(i).size(); j++) { + delta[i] = pr - toBoolArray(y)[i] * X.get(i).get(j); } + for (i = 0; i < X.size(); i++) { + sumdelta[i] = sumdelta[i] + delta[i]; + } + } + for (i = 0; i < X.size(); i++) { + sumdelta[i] = sumdelta[i] / X.size(); + } + for (i = 0; i < X.size(); i++) { + weights[i] = weights[i] - rate * sumdelta[i]; + } } - catch(Exception e){ - System.out.println(e); + return this; + } + + /** + * Вспомогательный класс, который помогает вычислить сумму произведений + * координат вектора их весов + * + * @param X вектор + * @return + */ + private double help(double[] X) { + double result = 0; + for (int i = 0; i < X.length; i++) { + result = result + X[i] * weights[i]; + } + return result; + } + + /** + * + * @param X + * @return + * @throws exceptions.ModelNotFittedException + * @throws InconveninentShapeException + */ + @Override + public int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException { + double ver; + int[] probability = new int[X.length]; + ver = Math.exp(help(X)) / (1 + Math.exp(help(X))); + if (ver > 0.5) { + System.out.println("It is a dog"); + probability[0] = 1; + } else if (ver < 0.4) { + System.out.println("It is a cat"); + probability[0] = 0; + } else { + System.out.println("I don't know"); + probability[0] = -1; } + return probability; } - public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException{ - FileOutputStream file=new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); - ObjectOutputStream os=new ObjectOutputStream(file); - LogisticRegression lr=new LogisticRegression(); + + @Override + public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + /** + * Сериализация + * @param model + * @throws FileNotFoundException + * @throws IOException + */ + public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException { + FileOutputStream file = new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + ObjectOutputStream os = new ObjectOutputStream(file); + LogisticRegression lr = new LogisticRegression(); os.writeObject(lr); os.close(); } @@ -163,26 +191,10 @@ public double[] getWeights() { public void setWeights(double[] weights) { this.weights = weights; } + @Override public void saveToFile(String filename) throws IOException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } - -} -// public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException {} -// public double[] getWeights() {} -// public float getAlpha() {} -// public void setAlpha(float alpha) {} -// public float getBetta() {} -// public void setBetta(float betta) {} -// public int getMaxIter() {} -// public void setMaxIter(int maxIter) {} -// public boolean isParralize() {} -// public void setParralize(boolean parralize) {} -// public float getLearnRate() {} -// public void setLearnRate(float learnRate) {} -// private double lossFunction(double[][] X, double[] W, int[] y) throws InconveninentShapeException {} -// private double[] lossFunctionDerivative(double[][] X, double[] W, -// int[] y, float alpha, float betta) throws InconveninentShapeException {} -//} +} diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java index c4a5dcd..ea83614 100644 --- a/src/result/machinelearning/preprocessing/MlModel.java +++ b/src/result/machinelearning/preprocessing/MlModel.java @@ -8,19 +8,19 @@ import exceptions.InconveninentShapeException; import exceptions.ModelNotFittedException; import java.io.IOException; +import java.util.List; /** * * @author User */ public interface MlModel { - MlModel train(double[][] X, int[] y) throws InconveninentShapeException; + MlModel train(List> X, List y) throws InconveninentShapeException; int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; - void saveToFile(String filename) throws IOException; diff --git a/src/result/workFiles/FileReader.java b/src/result/workFiles/FileReader.java deleted file mode 100644 index 45fdc48..0000000 --- a/src/result/workFiles/FileReader.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package result.workFiles; - -/** - * - * @author User - */ -public class FileReader implements FileWorker{ - -} diff --git a/src/result/workFiles/FileReading.java b/src/result/workFiles/FileReading.java new file mode 100644 index 0000000..bec8a7f --- /dev/null +++ b/src/result/workFiles/FileReading.java @@ -0,0 +1,69 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.workFiles; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Map; + + +/** + * + * @author User + */ +public class FileReading{ + Mapmap; + public Map readFile(int ZeroAmount, int OneAmount){ + for(int i=1;i Date: Sat, 18 Nov 2017 00:39:28 +0300 Subject: [PATCH 27/29] JBDC homework --- src/LectureDB/Connector.java | 32 +++++++ src/LectureDB/DAO.java | 93 +++++++++++++++++++ src/LectureDB/Main.java | 22 +++++ src/LectureDB/Password.java | 41 ++++++++ src/LectureDB/User.java | 41 ++++++++ .../{FileReading.java => Reading.java} | 0 6 files changed, 229 insertions(+) create mode 100644 src/LectureDB/Connector.java create mode 100644 src/LectureDB/DAO.java create mode 100644 src/LectureDB/Main.java create mode 100644 src/LectureDB/Password.java create mode 100644 src/LectureDB/User.java rename src/result/workFiles/{FileReading.java => Reading.java} (100%) diff --git a/src/LectureDB/Connector.java b/src/LectureDB/Connector.java new file mode 100644 index 0000000..3a4b739 --- /dev/null +++ b/src/LectureDB/Connector.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package LectureDB; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +/** + * + * @author Danny + */ +public class Connector { + public Connection link() { + String Url ="jdbc:mysql://localhost:3306/axample_mask"; + String Name="root"; + String Password="12345"; + Connection cn = null; + try { + Class.forName("com.mysql.jdbc.Driver"); + System.out.println("Драйвер подключен"); + cn = DriverManager.getConnection(Url, Name, Password); + System.out.println("Соединение установлено"); + } catch (ClassNotFoundException | SQLException ex) { + System.out.println("Error: " + ex.getMessage()); + } + return cn; + } +} diff --git a/src/LectureDB/DAO.java b/src/LectureDB/DAO.java new file mode 100644 index 0000000..2bfcbea --- /dev/null +++ b/src/LectureDB/DAO.java @@ -0,0 +1,93 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package LectureDB; + +import static java.lang.System.exit; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +/** + * + * @author Danny + */ +public class DAO { + + Connection connection = new Connector().link(); + + public void show() throws SQLException { + Statement State = null;//Simple inquiry without argument + State = connection.createStatement(); + ResultSet res = State.executeQuery("Select user.id, user.Login, user.Age, password.LoginId ,password.password from user , password"); + while (res.next()) { + System.out.println("Номер в выборке #" + res.getRow() + + "\t Номер в базе #" + res.getInt("id") + + "\t" + res.getString("Login") + + "\t" + res.getString("Age") + + "\t" + res.getString("LoginId") + + "\t" + res.getString("password")); + } + } + + public void add(String login, int age, String password) throws SQLException { + Statement State = null; + State = connection.createStatement(); + State.execute("INSERT INTO user (`Login`,`Age`) values ('" + login + "','" + age + "')"); + ResultSet res = State.executeQuery("select max(id) from user"); + int maxid = 0; + if (res.next()) { + maxid = res.getInt("max(id)"); + } + State.execute("insert into password (`LoginId`,`Password`) values ('" + maxid + "','" + password + "')"); + } + + public void delete(int num) throws SQLException { + Statement State = null; + State = connection.createStatement(); + ResultSet res = State.executeQuery("select id from user where id=" + num); + int id = 0; + if (res.next()) { + id = res.getInt("id"); + } + State.execute("delete from user where id=" + num); + State.execute("delete from password where LoginId=" + num); + } + + public void check(String login, String password) throws SQLException { + Statement State = null; + State = connection.createStatement(); + ResultSet res = State.executeQuery("select Login from user where Login='" + login+"'"); + String log = null; + if (res.next()) { + log = res.getString("Login"); + } + if(log==null){ + System.out.println("Not exist"); + System.exit(0); + } + System.out.println(log); + res = State.executeQuery("select Password from password where Password='" + password+"'"); + log=null; + if (res.next()) { + log = res.getString("Password"); + } + if(log==null){ + System.out.println("Not exist"); + System.exit(0); + } + System.out.println(log); + res = State.executeQuery("select * from user, password where user.Login='"+login+"' and password.Password='"+password+"'"); + while (res.next()) { + System.out.println("Номер в выборке #" + res.getRow() + + "\t Номер в базе #" + res.getInt("id") + + "\t" + res.getString("Login") + + "\t" + res.getString("Age") + + "\t" + res.getString("LoginId") + + "\t" + res.getString("password")); + } + } +} diff --git a/src/LectureDB/Main.java b/src/LectureDB/Main.java new file mode 100644 index 0000000..30450e4 --- /dev/null +++ b/src/LectureDB/Main.java @@ -0,0 +1,22 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package LectureDB; + +import java.sql.SQLException; + +/** + * + * @author Danny + */ +public class Main { + public static void main(String[] args) throws SQLException{ + //new DAO().add("David", 64, "Goliaf"); + //new DAO().show(); + //new DAO().delete(3); + new DAO().check("Sinicin", "Rn5"); + //new DAO().show(); + } +} diff --git a/src/LectureDB/Password.java b/src/LectureDB/Password.java new file mode 100644 index 0000000..67a748e --- /dev/null +++ b/src/LectureDB/Password.java @@ -0,0 +1,41 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package LectureDB; + +/** + * + * @author Danny + */ +public class Password { + private int id; + private int loginId; + private String password; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getLoginId() { + return loginId; + } + + public void setLoginId(int loginId) { + this.loginId = loginId; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + +} diff --git a/src/LectureDB/User.java b/src/LectureDB/User.java new file mode 100644 index 0000000..a85b36c --- /dev/null +++ b/src/LectureDB/User.java @@ -0,0 +1,41 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package LectureDB; + +/** + * + * @author Danny + */ +public class User { + private int id; + private String Login; + private int Age; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getLogin() { + return Login; + } + + public void setLogin(String Login) { + this.Login = Login; + } + + public int getAge() { + return Age; + } + + public void setAge(int Age) { + this.Age = Age; + } + +} diff --git a/src/result/workFiles/FileReading.java b/src/result/workFiles/Reading.java similarity index 100% rename from src/result/workFiles/FileReading.java rename to src/result/workFiles/Reading.java From c9c72bf01988989d749210a765bea495af1567b8 Mon Sep 17 00:00:00 2001 From: SychDan Date: Thu, 23 Nov 2017 23:00:10 +0300 Subject: [PATCH 28/29] Annotation and Reflection --- src/other/A.java | 17 +++++++++++++++++ src/other/B.java | 34 ++++++++++++++++++++++++++++++++++ src/other/Ser.java | 22 ++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 src/other/A.java create mode 100644 src/other/B.java create mode 100644 src/other/Ser.java diff --git a/src/other/A.java b/src/other/A.java new file mode 100644 index 0000000..239b6bb --- /dev/null +++ b/src/other/A.java @@ -0,0 +1,17 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +/** + * + * @author Danny + */ +public class A { + String lol; + int num=13; + @Ser + String field = "Hello"; +} diff --git a/src/other/B.java b/src/other/B.java new file mode 100644 index 0000000..b6b3589 --- /dev/null +++ b/src/other/B.java @@ -0,0 +1,34 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; + +/** + * + * @author Danny + */ +public class B implements Serializable{ + public void serialization(Class A){ + Class cl=A.class; + Field[] field=cl.getDeclaredFields(); + for(Field f:field){ + Ser ser=f.getAnnotation(Ser.class); + if(ser==null){ + try(ObjectOutputStream ois=new ObjectOutputStream(new FileOutputStream("PathToFile"))){ + ois.writeObject(f); + } + catch(Exception ex){ + ex.printStackTrace(); + } + } + } + } +} diff --git a/src/other/Ser.java b/src/other/Ser.java new file mode 100644 index 0000000..393a64b --- /dev/null +++ b/src/other/Ser.java @@ -0,0 +1,22 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package other; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * + * @author Danny + */ +@Target(value=ElementType.FIELD) +@Retention(value= RetentionPolicy.RUNTIME) +public @interface Ser { + //String name(); +} + From 1376438cb1c43f2582b25d344c96f96de382afc2 Mon Sep 17 00:00:00 2001 From: SychDan Date: Sat, 23 Dec 2017 21:22:49 +0300 Subject: [PATCH 29/29] LogReg update --- .../preprocessing/CountVectorizer.java | 300 ++++++------------ .../preprocessing/LogisticRegression.java | 140 ++++---- .../preprocessing/MlModel.java | 2 +- src/result/other/Worker.java | 58 ++++ src/result/workFiles/Reading.java | 79 ++--- 5 files changed, 272 insertions(+), 307 deletions(-) create mode 100644 src/result/other/Worker.java diff --git a/src/result/machinelearning/preprocessing/CountVectorizer.java b/src/result/machinelearning/preprocessing/CountVectorizer.java index e45a073..f71194d 100644 --- a/src/result/machinelearning/preprocessing/CountVectorizer.java +++ b/src/result/machinelearning/preprocessing/CountVectorizer.java @@ -5,202 +5,112 @@ */ package result.machinelearning.preprocessing; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * - * @author User + * @author 1 */ - - public class CountVectorizer implements SequenceProcessor, Transformer{ -private Map matrix = new HashMap<>(); -private String[] stopWords; -final float minDf; -final float maxDf; -final boolean parralize; -private static List defaultStopWordsList = new ArrayList( -Arrays.asList(new String[]{ -"а","е","и","ж","м","о","на","не","ни","об","но","он","мне","мои","мож","она","они","оно", -"мной","много","многочисленное","многочисленная","многочисленные","многочисленный", -"мною","мой","мог","могут","можно","может","можно","мор","моя","моё","мочь","над","нее", -"оба","нам","нем","нами","ними","мимо","немного","одной","одного","менее","однажды","однако", -"меня","нему","меньше","ней","наверху","него","ниже","мало","надо","один","одиннадцать","одиннадцатый", -"назад","наиболее","недавно","миллионов","недалеко","между","низко","меля","нельзя","нибудь", -"непрерывно","наконец","никогда","никуда","нас","наш","нет","нею","неё","них","мира","наша", -"наше","наши","ничего","начала","нередко","несколько","обычно","опять","около","мы","ну","нх","от","отовсюду", -"особенно","нужно","очень","отсюда","в","во","вон","вниз","внизу","вокруг","вот","восемнадцать", -"восемнадцатый","восемь","восьмой","вверх","вам","вами","важное","важная","важные","важный","вдали","везде", -"ведь","вас","ваш","ваша","ваше","ваши","впрочем","весь","вдруг","вы","все","второй","всем","всеми","времени","время", -"всему","всего","всегда","всех","всею","всю","вся","всё","всюду","г","год","говорил","говорит","года","году","где", -"да","ее","за","из","ли","же","им","до","по","ими","под","иногда","довольно","именно","долго","позже", -"более","должно","пожалуйста","значит","иметь","больше","пока","ему","имя","пор","пора","потом","потому","после", -"почему","почти","посреди","ей","два","две","двенадцать","двенадцатый","двадцать","двадцатый", -"двух","его","дел","или","без","день","занят","занята","занято","заняты","действительно","давно", -"девятнадцать","девятнадцатый","девять","девятый","даже","алло","жизнь","далеко","близко","здесь","дальше","для", -"лет","зато","даром","первый","перед","затем","зачем","лишь","десять","десятый","ею","её","их","бы","еще","при", -"был","про","процентов","против","просто","бывает","бывь","если","люди","была","были","было","будем","будет","будете","будешь", -"прекрасно","буду","будь","будто","будут","ещё","пятнадцать","пятнадцатый","друго","другое","другой","другие","другая","других","есть","пять", -"быть","лучше","пятый","к","ком","конечно","кому","кого","когда","которой","которого","которая","которые","который","которых","кем", -"каждое","каждая","каждые","каждый","кажется","как","какой","какая","кто","кроме","куда","кругом","с","т","у","я", -"та","те","уж","со","то","том","снова","тому","совсем","того","тогда","тоже","собой","тобой","собою","тобою", -"сначала","только","уметь","тот","тою","хорошо","хотеть","хочешь","хоть","хотя","свое","свои","твой","своей","своего","своих", -"свою","твоя","твоё","раз","уже","сам","там","тем","чем","сама","сами","теми","само","рано","самом","самому", -"самой","самого","семнадцать","семнадцатый","самим","самими","самих","саму", -"семь","чему","раньше","сейчас","чего","сегодня","себе","тебе","сеаой","человек","разве","теперь","себя","тебя","седьмой","спасибо", -"слишком","так","такое","такой","такие","также","такая","сих","тех","чаще","четвертый","через","часто","шестой","шестнадцать","шестнадцатый", -"шесть","четыре","четырнадцать","четырнадцатый","сколько","сказал","сказала","сказать", -"ту","ты","три","эта","эти","что","это","чтоб","этом","этому","этой","этого","чтобы","этот","стал","туда", -"этим","этими","рядом","тринадцать","тринадцатый","этих","третий","тут","эту","суть","чуть","тысяч" -}) -); - -/** -* Заполняет матрицу -* @see CountVectorizer#matrix слова и возвращает список Мапов -* @param listOfTexts Список текстов -* @return Список Мапов -*/ -@Override -public List> fitAndTransform(List listOfTexts) { -List> listOfMaps = new ArrayList<>(); -for (String text : listOfTexts) { -List list = preprocess(text); -listOfMaps.add(countWordsAndEditMatrix(list)); -} -return listOfMaps; -} - -/** -* Заполняет матрицу -* @see CountVectorizer#matrix словами из списка текстов -* @param listOfTexts Список текстов -*/ -@Override -public void fit(List listOfTexts) { -for (String text : listOfTexts) { -List list = preprocess(text); -countWordsAndEditMatrix(list); -} -} - -/** -* Метод извлекающий слова из переданного в метод текста. -* Не учитываются слова поля из -* @see CountVectorizer#defaultStopWordsList -* Используется класс -* @see PorterStemmer для стемминга -* @param text Текст, из которого извлекаются слова -* @return Список слов -*/ -@Override -public List preprocess(String text) { -PorterStemmer stemmer = new PorterStemmer(); -text = text.toLowerCase().replaceAll("[^а-я -]","").replaceAll(" +-"," ").replaceAll("- +"," "); - -String[] array = text.split(" +"); -for (int i = 0; i list = new ArrayList(Arrays.asList(array)); -list.removeAll(defaultStopWordsList); -return list; -} - -/** -* Возвращает список Мапов из слов, взятых из переданного списка текстов -* @param listOfTexts Список текстов -* @return Список Мапов -*/ -@Override -public List> transform(List listOfTexts) { -List> listOfMaps = new ArrayList<>(); -for (String text : listOfTexts) { -List list = preprocess(text); -listOfMaps.add(countWords(list)); -} -return listOfMaps; -} - -/** -* Два конструктора -*/ -public CountVectorizer(float minDf, float maxDf, String[] stopWords, boolean parralize) { -this.minDf = minDf; -this.maxDf = maxDf; -this.stopWords = stopWords; -this.parralize = parralize; -} -public CountVectorizer(float minDf, float maxDf) { -this.minDf = minDf; -this.maxDf = maxDf; -parralize = false; -} -public CountVectorizer(String[] stopWords) { -this.stopWords = stopWords; -minDf = 1; -maxDf = 1; -parralize = false; -} -public CountVectorizer() { -minDf = 1; -maxDf = 1; -parralize = false; -} - -/** -* Геттеры для полей -* @see CountVectorizer#minDf и -* @see CountVectorizer#maxDf -*/ -public float getMinDf() { -return minDf; -} -public float getMaxDf() { -return maxDf; -} - -/** -* Считает, сколько раз встретилось одно слово в переданном списке слов -* @param words Список слов, в котором счиатем слова -* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово -*/ - -private Map countWords(List words) { -Map map = new HashMap(); -int value = 1; -for (String word : words) { -if (map.containsKey(word)) { -value += map.get(word); -} - -map.put(word, value); -} -return map; -} - -/** -* Делаем то же самое, что и в методе -* @see CountVectorizer#countWords(List), но еще и добавляем это в матрицу -* @see CountVectorizer#matrix -* @param words Список слов, в котором счиатем слова -* @return Map, в котором ключ - это слово, значение - сколько раз встретилось данное слово -*/ -private Map countWordsAndEditMatrix(List words) { -Map map = countWords(words); -int valueFromMatrix = 0; -for (Map.Entry pair : map.entrySet()) { -String key = pair.getKey(); -if (matrix.containsKey(key)) { -valueFromMatrix = matrix.get(key); -} -matrix.put(key, valueFromMatrix + pair.getValue()); -} -return map; -} - -} - +public class CountVectorizer { + private final Set setWordsFromAllTexts = new HashSet<>(); + private final List textClasses = new ArrayList<>(); + private final List listOfTexts = new ArrayList<>(); + private static List defaultStopWordsList = new ArrayList( + Arrays.asList(new String[]{ + "а","е","и","ж","м","о","на","не","ни","об","но","он","мне","мои","мож","она","они","оно", + "мной","много","многочисленное","многочисленная","многочисленные","многочисленный", + "мною","мой","мог","могут","можно","может","можно","мор","моя","моё","мочь","над","нее", + "оба","нам","нем","нами","ними","мимо","немного","одной","одного","менее","однажды","однако", + "меня","нему","меньше","ней","наверху","него","ниже","мало","надо","один","одиннадцать","одиннадцатый", + "назад","наиболее","недавно","миллионов","недалеко","между","низко","меля","нельзя","нибудь", + "непрерывно","наконец","никогда","никуда","нас","наш","нет","нею","неё","них","мира","наша", + "наше","наши","ничего","начала","нередко","несколько","обычно","опять","около","мы","ну","нх","от","отовсюду", + "особенно","нужно","очень","отсюда","в","во","вон","вниз","внизу","вокруг","вот","восемнадцать", + "восемнадцатый","восемь","восьмой","вверх","вам","вами","важное","важная","важные","важный","вдали","везде", + "ведь","вас","ваш","ваша","ваше","ваши","впрочем","весь","вдруг","вы","все","второй","всем","всеми","времени","время", + "всему","всего","всегда","всех","всею","всю","вся","всё","всюду","г","год","говорил","говорит","года","году","где", + "да","ее","за","из","ли","же","им","до","по","ими","под","иногда","довольно","именно","долго","позже", + "более","должно","пожалуйста","значит","иметь","больше","пока","ему","имя","пор","пора","потом","потому","после", + "почему","почти","посреди","ей","два","две","двенадцать","двенадцатый","двадцать","двадцатый", + "двух","его","дел","или","без","день","занят","занята","занято","заняты","действительно","давно", + "девятнадцать","девятнадцатый","девять","девятый","даже","алло","жизнь","далеко","близко","здесь","дальше","для", + "лет","зато","даром","первый","перед","затем","зачем","лишь","десять","десятый","ею","её","их","бы","еще","при", + "был","про","процентов","против","просто","бывает","бывь","если","люди","была","были","было","будем","будет","будете","будешь", + "прекрасно","буду","будь","будто","будут","ещё","пятнадцать","пятнадцатый","друго","другое","другой","другие","другая","других","есть","пять", + "быть","лучше","пятый","к","ком","конечно","кому","кого","когда","которой","которого","которая","которые","который","которых","кем", + "каждое","каждая","каждые","каждый","кажется","как","какой","какая","кто","кроме","куда","кругом","с","т","у","я", + "та","те","уж","со","то","том","снова","тому","совсем","того","тогда","тоже","собой","тобой","собою","тобою", + "сначала","только","уметь","тот","тою","хорошо","хотеть","хочешь","хоть","хотя","свое","свои","твой","своей","своего","своих", + "свою","твоя","твоё","раз","уже","сам","там","тем","чем","сама","сами","теми","само","рано","самом","самому", + "самой","самого","семнадцать","семнадцатый","самим","самими","самих","саму", + "семь","чему","раньше","сейчас","чего","сегодня","себе","тебе","сеаой","человек","разве","теперь","себя","тебя","седьмой","спасибо", + "слишком","так","такое","такой","такие","также","такая","сих","тех","чаще","четвертый","через","часто","шестой","шестнадцать","шестнадцатый", + "шесть","четыре","четырнадцать","четырнадцатый","сколько","сказал","сказала","сказать", + "ту","ты","три","эта","эти","что","это","чтоб","этом","этому","этой","этого","чтобы","этот","стал","туда", + "этим","этими","рядом","тринадцать","тринадцатый","этих","третий","тут","эту","суть","чуть","тысяч" + }) + ); + + + /** + * Метод извлекающий слова из переданного в метод текста. + * Не учитываются слова поля из + * @see CountVectorizer#defaultStopWordsList + * Используется класс + * @see PorterStemmer для стемминга + * @param text Текст, из которого извлекаются слова + * @return Список слов + */ + private static List preprocess(String text) { + text = text.toLowerCase().replaceAll("[^а-я -]","").replaceAll(" +-"," ").replaceAll("- +"," "); + String[] array = text.split(" +"); + for (int i = 0; i list = new ArrayList<>(Arrays.asList(array)); + list.removeAll(defaultStopWordsList); + return list; + } + + + public List> transform() { + List> listOfVectors = new ArrayList<>(); + for (String text : listOfTexts) { + listOfVectors.add(countWordsInText(preprocess(text))); + } + return listOfVectors; + } + + public CountVectorizer(Map mapOfTexts) { + listOfTexts.addAll(mapOfTexts.keySet()); + addWordsInSetFromTexts(mapOfTexts.keySet()); + textClasses.addAll(mapOfTexts.values()); + + } + + private List countWordsInText(List words) { + List vector = new ArrayList<>(); + for (String word : setWordsFromAllTexts) { + vector.add(Collections.frequency(words,word)); + } + return vector; + } + + private void addWordsInSetFromTexts(Set texts) { + for (String text : texts) { + setWordsFromAllTexts.addAll(preprocess(text)); + } + } + + public List getTextClasses() { + return textClasses; + } + + public List> appendTextsAndTransform(Map mapOfTexts) { + listOfTexts.addAll(mapOfTexts.keySet()); + addWordsInSetFromTexts(mapOfTexts.keySet()); + textClasses.addAll(mapOfTexts.values()); + return transform(); + } + +} \ No newline at end of file diff --git a/src/result/machinelearning/preprocessing/LogisticRegression.java b/src/result/machinelearning/preprocessing/LogisticRegression.java index 2bfaa84..2809431 100644 --- a/src/result/machinelearning/preprocessing/LogisticRegression.java +++ b/src/result/machinelearning/preprocessing/LogisticRegression.java @@ -7,20 +7,13 @@ import exceptions.EmptyArrayException; import exceptions.InconveninentShapeException; -import exceptions.ModelNotFittedException; -import java.io.Serializable; import other.MathService; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.ArrayList; + +import java.io.*; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import other.NewClass; /** * @@ -28,31 +21,25 @@ */ public class LogisticRegression implements MlModel, Serializable { + private static final long serialVersionUID = 5865555265285679275L; private final int ITERATES = 1000; private final double rate = 0.001; private double[] weights = null; /** - * Инициализация массива векторв - нужно добавить первый столбец с одними - * единицами - * - * @param X - координаты векторов + * Adding first column with 1 + * @param X * @return */ private List> init(List> X) { - int i, j; - List> xx = new ArrayList>(); - for (i = 0; i < X.size(); i++) { - xx.get(i).add(1); - for (j = 0; j < X.get(1).size(); j++) { - xx.get(i).add(X.get(i).get(j)); - } + for (int i = 0; i < X.size(); i++) { + X.get(i).add(0, 1); } - return xx; + return X; } /** - * Список Integer в массив double + * Change list of Integer to double array * * @param list * @return @@ -66,7 +53,7 @@ private double[] toIntArray(List list) { } /** - * Список boolean в массив double + * Change list of boolean to double array * * @param list * @return @@ -82,12 +69,11 @@ private double[] toBoolArray(List list) { } return intArray; } - /** - * Тренировка весов С каждой итерацией вероятность будет точнее и точнее + * Train * - * @param X полученные вектора из CountVectorizer - * @param y возможные варианты (1 или 0) + * @param X ïîëó÷åííûå âåêòîðà èç CountVectorizer + * @param y âîçìîæíûå âàðèàíòû (1 èëè 0) * @return * @throws InconveninentShapeException */ @@ -95,48 +81,68 @@ private double[] toBoolArray(List list) { public MlModel train(List> X, List y) throws InconveninentShapeException { double pr = 0; - double[] sumdelta; //сумма дельт в каждом столбце - int i, j; + double[] sumdelta; + int i, j, k; +// try { +// weights=readFromFile(); +// } catch (IOException ex) { +// Logger.getLogger(LogisticRegression.class.getName()).log(Level.SEVERE, null, ex); +// } catch (ClassNotFoundException ex) { +// Logger.getLogger(LogisticRegression.class.getName()).log(Level.SEVERE, null, ex); +// } weights = new double[X.get(1).size() + 1]; X = init(X); double delta[]; - sumdelta = new double[X.size()]; + sumdelta = new double[X.get(1).size()]; for (int u = 0; u < ITERATES; u++) { - delta = new double[X.size()]; + delta = new double[X.get(1).size()]; for (i = 0; i < X.size(); i++) { try { pr = MathService.sigmoid(MathService.doProduct(toIntArray(X.get(i)), weights)); } catch (EmptyArrayException ex) { Logger.getLogger(LogisticRegression.class.getName()).log(Level.SEVERE, null, ex); } - for (j = 0; j < X.get(i).size(); j++) { - delta[i] = pr - toBoolArray(y)[i] * X.get(i).get(j); + for (j = 0; j < X.get(1).size(); j++) { + delta[j] = (pr - toBoolArray(y)[i]) * X.get(i).get(j); + } - for (i = 0; i < X.size(); i++) { - sumdelta[i] = sumdelta[i] + delta[i]; + + for (k = 0; k < X.get(1).size(); k++) { + sumdelta[k] = sumdelta[k] + delta[k]; + } + } - for (i = 0; i < X.size(); i++) { + for (i = 0; i < X.get(1).size(); i++) { sumdelta[i] = sumdelta[i] / X.size(); + } - for (i = 0; i < X.size(); i++) { + for (i = 0; i < X.get(1).size(); i++) { weights[i] = weights[i] - rate * sumdelta[i]; + } + + } + + try { + saveMlModelToFile(); + } catch (IOException ex) { + Logger.getLogger(LogisticRegression.class.getName()).log(Level.SEVERE, null, ex); } return this; } /** - * Вспомогательный класс, который помогает вычислить сумму произведений - * координат вектора их весов + * Âñïîìîãàòåëüíûé êëàññ, êîòîðûé ïîìîãàåò âû÷èñëèòü ñóììó ïðîèçâåäåíèé + * êîîðäèíàò âåêòîðà èõ âåñîâ * - * @param X вектор + * @param X âåêòîð * @return */ - private double help(double[] X) { + private double help(List X) { double result = 0; - for (int i = 0; i < X.length; i++) { - result = result + X[i] * weights[i]; + for (int i = 0; i < X.size(); i++) { + result = result + X.get(i) * weights[i]; } return result; } @@ -145,42 +151,46 @@ private double help(double[] X) { * * @param X * @return - * @throws exceptions.ModelNotFittedException * @throws InconveninentShapeException */ @Override - public int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException { + public int[] predict(List> X) throws InconveninentShapeException { + //weights=new NewClass().nc(); double ver; - int[] probability = new int[X.length]; - ver = Math.exp(help(X)) / (1 + Math.exp(help(X))); - if (ver > 0.5) { - System.out.println("It is a dog"); - probability[0] = 1; - } else if (ver < 0.4) { - System.out.println("It is a cat"); - probability[0] = 0; - } else { - System.out.println("I don't know"); - probability[0] = -1; + int[] probability = new int[X.size()]; + for (int i = 0; i < X.size(); i++) { + ver = Math.exp(help(X.get(i))) / (1 + Math.exp(help(X.get(i)))); + if (ver > 0.44) { + System.out.println("Text № " + i + " is about dog " + ver); + probability[i] = 1; + } else if (ver < 0.44) { + System.out.println("Text № " + i + " is about cat " + ver); + probability[i] = 0; + } else { + System.out.println("I don't know"); + probability[i] = -1; + } } return probability; } @Override - public double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException { + public double[] predictProba(double[] X) throws InconveninentShapeException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + /** - * Сериализация + * Ñåðèàëèçàöèÿ + * * @param model * @throws FileNotFoundException - * @throws IOException + * @throws IOException */ - public void saveMlModelToFile(MlModel model) throws FileNotFoundException, IOException { - FileOutputStream file = new FileOutputStream("C:\\users\\user\\desktop\\work\\Save.dat"); + public void saveMlModelToFile() throws FileNotFoundException, IOException { + FileOutputStream file = new FileOutputStream("C:\\users\\user\\desktop\\work\\Saves.dat"); ObjectOutputStream os = new ObjectOutputStream(file); LogisticRegression lr = new LogisticRegression(); - os.writeObject(lr); + os.writeObject(weights); os.close(); } @@ -188,10 +198,6 @@ public double[] getWeights() { return weights; } - public void setWeights(double[] weights) { - this.weights = weights; - } - @Override public void saveToFile(String filename) throws IOException { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. diff --git a/src/result/machinelearning/preprocessing/MlModel.java b/src/result/machinelearning/preprocessing/MlModel.java index ea83614..a29fe5e 100644 --- a/src/result/machinelearning/preprocessing/MlModel.java +++ b/src/result/machinelearning/preprocessing/MlModel.java @@ -17,7 +17,7 @@ public interface MlModel { MlModel train(List> X, List y) throws InconveninentShapeException; - int[] predict(double[] X) throws ModelNotFittedException, InconveninentShapeException; + int[] predict(List> X) throws ModelNotFittedException, InconveninentShapeException; double[] predictProba(double[] X) throws ModelNotFittedException, InconveninentShapeException; diff --git a/src/result/other/Worker.java b/src/result/other/Worker.java new file mode 100644 index 0000000..de0fd82 --- /dev/null +++ b/src/result/other/Worker.java @@ -0,0 +1,58 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package result.other; + +import exceptions.InconveninentShapeException; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import result.machinelearning.preprocessing.CountVectorizer; +import result.machinelearning.preprocessing.LogisticRegression; +import result.workFiles.Reading; + +/** + * + * @author Danny + */ +public class Worker { + public static void main(String[] args) throws InconveninentShapeException { + Map map = new LinkedHashMap<>(); + LogisticRegression logisticRegression = new LogisticRegression(); + Reading reading = new Reading(); + Map res = reading.readFile(109, 60); + CountVectorizer countVectorizer = new CountVectorizer(res); + List> vectors = countVectorizer.transform(); + System.out.println("Array: "+vectors.get(0)); + logisticRegression.train(vectors, countVectorizer.getTextClasses()); + logisticRegression.predict(vectors); + String path = "C:/users/user/desktop/"; + File file =new File(path+"work.txt"); + java.io.FileReader fir = null; + StringBuffer sb = new StringBuffer(); + try (BufferedReader br = new BufferedReader(new FileReader(file))) { + String s; + while ((s = br.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + System.out.println(sb.toString()); + map.put(sb.toString(), false); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + CountVectorizer cv = new CountVectorizer(map); + List> vec = cv.transform(); + //logisticRegression.predict(vec); + } +} \ No newline at end of file diff --git a/src/result/workFiles/Reading.java b/src/result/workFiles/Reading.java index bec8a7f..23e5901 100644 --- a/src/result/workFiles/Reading.java +++ b/src/result/workFiles/Reading.java @@ -5,9 +5,9 @@ */ package result.workFiles; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; +import java.io.*; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; @@ -15,55 +15,46 @@ * * @author User */ -public class FileReading{ - Mapmap; +public class Reading{ + String path = "C:/users/user/desktop/texts/"; public Map readFile(int ZeroAmount, int OneAmount){ + + Map map = new LinkedHashMap<>(); + for(int i=1;i