diff --git a/homework_04_logistic_regression/README.md b/homework_04_logistic_regression/README.md index 4af1c6c..fef499b 100644 --- a/homework_04_logistic_regression/README.md +++ b/homework_04_logistic_regression/README.md @@ -26,6 +26,6 @@ for i in range(64): ``` 要求: -1. 自己编程实现Logistic Regression的多分了。 +1. 自己编程实现Logistic Regression的多分类。 2. 对比自己实现与sklearn的方法的精度。 3. 如何将分类错误的样本可视化出来? \ No newline at end of file diff --git a/homework_05_nn/README.md b/homework_05_nn/README.md new file mode 100644 index 0000000..1f3e6a3 --- /dev/null +++ b/homework_05_nn/README.md @@ -0,0 +1,45 @@ +# Neural Networks + +自己编程实现两层或多层全连接神经网络,可以使用`moons` 或者`circles`数据集来测试、验证算法。 + + + +dataset_moons: + +![dataset_moons](images/dataset_moon.png) + + + +dataset_circles: + +![dataset_circles](images/dataset_circle.png) + +加载数据的方式是: +```python +# moon dataset +% matplotlib inline +import numpy as np +from sklearn import datasets +import matplotlib.pyplot as plt + +# generate sample data +np.random.seed(0) +X, y = datasets.make_moons(200, noise=0.20) + +# plot data +plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Spectral) +plt.show() +``` + +dataset_circles的数据文件是`dataset_circles.csv` + + + +要求: + +1. 自己编程实现多层全连接神经网络的多分类。 +2. 先用函数的方式实现网络的正向计算和反向误差传播,权值更新。 +3. 构思并实现基于类的神经网络程序。 +4. 学习`softmax`和`cross entropy`的方法,并实现类别所属概率的输出。 +5. 对比自己实现与sklearn的方法的精度。 +6. 如何将分类错误的样本可视化出来? \ No newline at end of file diff --git a/homework_05_nn/dataset_circles.csv b/homework_05_nn/dataset_circles.csv new file mode 100644 index 0000000..c0a2404 --- /dev/null +++ b/homework_05_nn/dataset_circles.csv @@ -0,0 +1,400 @@ +9.862597006109558251e+00,4.388945920860357397e+00,0.000000000000000000e+00 +2.877170945049199346e+00,1.202827750793628248e+01,0.000000000000000000e+00 +3.337256239136289437e+00,-5.220370923066885105e+00,0.000000000000000000e+00 +6.493095562032711321e+00,-1.113144595320488328e+01,0.000000000000000000e+00 +9.160816030038004598e+00,-1.009779300537452151e+01,0.000000000000000000e+00 +1.041802753742201126e+01,1.894574992636611332e+00,0.000000000000000000e+00 +-9.011386818141570387e+00,7.113786261861553051e+00,0.000000000000000000e+00 +8.634194767050646035e+00,6.044937306977867797e-01,0.000000000000000000e+00 +-8.310295927199726762e+00,-1.184857079692059001e+00,0.000000000000000000e+00 +1.317546095251883154e+00,-1.129096844315353998e+01,0.000000000000000000e+00 +9.529257864350787699e+00,1.736339478767750633e+00,0.000000000000000000e+00 +-9.437763538148617570e+00,-2.872208646559228029e+00,0.000000000000000000e+00 +5.815080874493489205e+00,-8.314022581206840457e+00,0.000000000000000000e+00 +-1.288892096908664797e+01,-1.122402541491438477e+00,0.000000000000000000e+00 +-7.491945439414098296e+00,-1.046310837836343666e+01,0.000000000000000000e+00 +6.971623436910721061e+00,-3.713812314908092826e+00,0.000000000000000000e+00 +-3.647715279401396060e+00,-8.566426635858620742e+00,0.000000000000000000e+00 +-5.963933774842476332e+00,-5.215555684133276415e+00,0.000000000000000000e+00 +5.649964657621771913e+00,-5.369954314422594521e+00,0.000000000000000000e+00 +1.172710561955023145e+01,-2.754936843545676695e+00,0.000000000000000000e+00 +1.672264154472602238e+00,-1.071807032527019565e+01,0.000000000000000000e+00 +-3.443717408141795389e+00,1.250380032886874737e+01,0.000000000000000000e+00 +5.863452362896988568e+00,-8.186611721106453743e+00,0.000000000000000000e+00 +4.991164283632463672e+00,1.139369901458018042e+01,0.000000000000000000e+00 +8.838997710199558711e+00,6.044714573548058967e-01,0.000000000000000000e+00 +1.639030475559324795e+00,7.915238715166661443e+00,0.000000000000000000e+00 +3.758705824661268569e+00,-8.090773260493815400e+00,0.000000000000000000e+00 +-9.394967210155567017e+00,-5.137130325801137154e+00,0.000000000000000000e+00 +-6.288288633339392142e+00,1.433786837462863506e+00,0.000000000000000000e+00 +-9.604286351326987159e+00,-8.457016591349884038e+00,0.000000000000000000e+00 +4.404554230019639860e+00,7.498658012125457795e+00,0.000000000000000000e+00 +1.251066075969001723e+01,2.403854004526353894e+00,0.000000000000000000e+00 +-6.625366638525115981e+00,-4.034266053666308416e+00,0.000000000000000000e+00 +5.745785337741070364e+00,-4.064766044917044852e+00,0.000000000000000000e+00 +-7.111819117251069855e+00,2.937469414945817370e+00,0.000000000000000000e+00 +1.188200659083437927e+01,-3.459560370844172006e+00,0.000000000000000000e+00 +3.763980582232898886e+00,6.079997397875869680e+00,0.000000000000000000e+00 +-2.444132686299686608e+00,8.655025186859889530e+00,0.000000000000000000e+00 +3.827248176924319178e+00,7.780625034062842005e+00,0.000000000000000000e+00 +-2.518060036469188523e-01,1.345001652707794726e+01,0.000000000000000000e+00 +-1.062124752956786367e+01,3.788639253029340459e+00,0.000000000000000000e+00 +6.914686308755981337e+00,2.517928331085216964e+00,0.000000000000000000e+00 +4.819454929706679991e+00,4.305957988922500590e+00,0.000000000000000000e+00 +9.308607156157549412e+00,1.018017507427041402e+01,0.000000000000000000e+00 +-2.644229094526551638e+00,1.308185169274385018e+01,0.000000000000000000e+00 +-8.110820419917877944e-01,1.373132883726502484e+01,0.000000000000000000e+00 +-7.336981746187526632e+00,2.633628829714826036e+00,0.000000000000000000e+00 +-7.304144561890504761e+00,-4.985228209873077354e+00,0.000000000000000000e+00 +-3.942089524730379768e+00,7.429147677138015382e+00,0.000000000000000000e+00 +-1.563940960823078541e+00,-1.226771652324130102e+01,0.000000000000000000e+00 +7.752633583239491699e+00,1.606933591460645960e+00,0.000000000000000000e+00 +-4.644020567309505410e+00,-1.260416337454934776e+01,0.000000000000000000e+00 +9.559905872637479263e+00,-2.069167693554651688e+00,0.000000000000000000e+00 +6.510524870183760804e+00,1.055846542430648682e+01,0.000000000000000000e+00 +7.709822285798955122e+00,2.414004778121223715e+00,0.000000000000000000e+00 +-7.112111243945566486e+00,-9.955758248422416301e+00,0.000000000000000000e+00 +2.826837256620440275e-01,9.890510484957566462e+00,0.000000000000000000e+00 +3.043287967173990527e+00,-8.571990423685743821e+00,0.000000000000000000e+00 +9.569832822923251214e+00,-3.349889908766237046e+00,0.000000000000000000e+00 +2.825239466651834896e-01,8.493236936762546208e+00,0.000000000000000000e+00 +-3.456625845444592837e+00,-1.112489309506036506e+01,0.000000000000000000e+00 +4.009169731782363577e+00,1.000783306149301488e+01,0.000000000000000000e+00 +4.688796243646584649e+00,1.281843321647803968e+01,0.000000000000000000e+00 +-1.998966439837163600e+00,1.351012796539344230e+01,0.000000000000000000e+00 +-5.633144883347592113e+00,-2.976004791943957617e+00,0.000000000000000000e+00 +-1.071777719431886666e+01,8.746724717809167160e+00,0.000000000000000000e+00 +6.933072615037868758e+00,-2.014502580037639490e+00,0.000000000000000000e+00 +-3.996300934160016194e+00,-7.669085547264026914e+00,0.000000000000000000e+00 +6.057410272621098102e+00,-2.652565982981485160e-01,0.000000000000000000e+00 +-1.211110506752794613e+01,3.213092951287801480e+00,0.000000000000000000e+00 +-2.660457520427601530e+00,9.541749783643794558e+00,0.000000000000000000e+00 +5.677396269346377089e+00,-8.181021821215502143e+00,0.000000000000000000e+00 +8.025138318366114021e+00,-1.384302439837393317e+00,0.000000000000000000e+00 +7.007870666149849104e-01,-8.332889101745662330e+00,0.000000000000000000e+00 +-2.561600053427863344e+00,-9.743204526040658564e+00,0.000000000000000000e+00 +-7.680125944110861802e+00,7.501834896431613053e+00,0.000000000000000000e+00 +-5.990419838503080463e+00,-1.634517124985244374e+00,0.000000000000000000e+00 +-3.408750904602412479e+00,-1.011555207509729293e+01,0.000000000000000000e+00 +-7.466990342399484781e+00,4.972154832211821862e+00,0.000000000000000000e+00 +-1.385863376104194344e+01,-1.569697443999104047e+00,0.000000000000000000e+00 +1.016630480502666245e+01,-5.786895095791383170e+00,0.000000000000000000e+00 +2.138339060813499781e+00,9.235897157296232507e+00,0.000000000000000000e+00 +9.784654375427050965e+00,3.223452669892223899e+00,0.000000000000000000e+00 +-7.160947322329206166e+00,4.315264819978651897e-03,0.000000000000000000e+00 +1.069526264501631019e+01,2.146676049265247688e+00,0.000000000000000000e+00 +1.352531737671455403e+01,5.341317125800683074e-01,0.000000000000000000e+00 +-8.204380562754867157e+00,2.958040506654077695e-01,0.000000000000000000e+00 +-7.700927136434255083e+00,3.450173937237375643e+00,0.000000000000000000e+00 +-6.162063854688403453e+00,-1.039351804719752614e+01,0.000000000000000000e+00 +-7.622924349294661006e+00,-8.395757258940216516e+00,0.000000000000000000e+00 +-4.781299924855306749e+00,-4.300113418931317710e+00,0.000000000000000000e+00 +1.273936254270339319e+01,4.444056568979243949e+00,0.000000000000000000e+00 +-6.212029468907783070e+00,6.412488301479442043e-01,0.000000000000000000e+00 +-8.598454550560376219e+00,-9.505732040174901698e+00,0.000000000000000000e+00 +-6.551844072080291070e+00,-2.597153824509962572e+00,0.000000000000000000e+00 +5.406244662529976486e-01,-1.180744558537000977e+01,0.000000000000000000e+00 +-1.223328107698617728e+01,2.534270081704574018e+00,0.000000000000000000e+00 +-1.234205194892152413e+01,1.643521855276022237e+00,0.000000000000000000e+00 +-9.493836137915996787e+00,9.746672478642727455e+00,0.000000000000000000e+00 +-8.420488306810536727e+00,9.741715891244462355e+00,0.000000000000000000e+00 +3.814812252424179650e+00,-1.095530939520013547e+01,0.000000000000000000e+00 +7.408768607650642934e+00,-1.598252129266272581e+00,0.000000000000000000e+00 +-8.954549145432116219e+00,-8.716215395331682103e+00,0.000000000000000000e+00 +6.750393096483064959e+00,-8.732504927011085272e+00,0.000000000000000000e+00 +-4.786803561513118588e+00,-8.222241820233284315e+00,0.000000000000000000e+00 +-7.346628433171869865e+00,-5.200293638609803537e+00,0.000000000000000000e+00 +1.416856726047263759e+00,1.122018551024202893e+01,0.000000000000000000e+00 +7.209540291555192049e+00,3.896096344772451925e+00,0.000000000000000000e+00 +-4.818795573205335359e+00,1.275527076454161524e+01,0.000000000000000000e+00 +-3.600791011231857741e+00,-5.685619246095143353e+00,0.000000000000000000e+00 +-1.303337576890614358e+01,1.454981134345443294e-01,0.000000000000000000e+00 +-5.668879881725418457e+00,4.265559882994224949e+00,0.000000000000000000e+00 +-1.336677225502713995e+01,-3.333565427677156023e+00,0.000000000000000000e+00 +6.380063124213702253e+00,-8.694515196234624099e+00,0.000000000000000000e+00 +7.958495857862243561e+00,5.662910911325223395e+00,0.000000000000000000e+00 +4.971861734308737013e+00,-7.650823140952451418e+00,0.000000000000000000e+00 +7.413214733587544458e+00,3.314437518815265271e+00,0.000000000000000000e+00 +-8.665573289299810966e+00,2.579632707896181820e+00,0.000000000000000000e+00 +9.929397321851664016e-01,1.355034933325041813e+01,0.000000000000000000e+00 +5.360547077905177815e+00,-6.588248171721820867e+00,0.000000000000000000e+00 +5.084186669565729844e+00,3.833783430598022512e+00,0.000000000000000000e+00 +1.002670917279956520e+01,7.517106438066921470e+00,0.000000000000000000e+00 +-4.992627975094395154e+00,-4.021636687013394607e+00,0.000000000000000000e+00 +-1.072877553404850737e+01,3.393035849131368575e+00,0.000000000000000000e+00 +-3.801811713125446524e+00,6.401279054144701774e+00,0.000000000000000000e+00 +1.050052476588508199e+01,-2.890999409234909390e+00,0.000000000000000000e+00 +1.004219115274414342e+01,-4.302461600016681542e-01,0.000000000000000000e+00 +8.126291864264146625e+00,-2.062137138477090570e+00,0.000000000000000000e+00 +8.532036146140371535e-01,-1.077703138089397683e+01,0.000000000000000000e+00 +-7.709349249077324551e+00,-8.402083930252045363e+00,0.000000000000000000e+00 +-3.158019423283696003e+00,-8.622525955647978080e+00,0.000000000000000000e+00 +4.368821578430113206e+00,-9.280167433647054764e+00,0.000000000000000000e+00 +-4.339665761257628596e+00,-9.873795252064214267e+00,0.000000000000000000e+00 +-3.975662970089751114e-01,8.778761114131237164e+00,0.000000000000000000e+00 +-1.005816644696833784e+01,2.676157423149173376e+00,0.000000000000000000e+00 +7.976759622447467279e+00,1.488112982960128061e+00,0.000000000000000000e+00 +-1.115846173131786756e+01,2.347405448698627328e+00,0.000000000000000000e+00 +1.828795701256797024e+00,7.084758587571729826e+00,0.000000000000000000e+00 +-8.182845482922107561e-01,-8.837635696617843095e+00,0.000000000000000000e+00 +-1.216592766927463565e+01,4.182020621616657330e+00,0.000000000000000000e+00 +7.545136762876549774e+00,9.945150848296330892e+00,0.000000000000000000e+00 +1.296725766555409187e+01,2.779679035545373100e+00,0.000000000000000000e+00 +-7.649802069554393569e+00,-7.912731844844135054e+00,0.000000000000000000e+00 +1.450029305422914083e+00,6.154506368128457972e+00,0.000000000000000000e+00 +1.126182752393684439e+01,3.820055905771543081e+00,0.000000000000000000e+00 +4.114692346497415443e+00,-1.153298607052224334e+01,0.000000000000000000e+00 +-2.985702422723075955e+00,-1.147272148740606212e+01,0.000000000000000000e+00 +-8.817811375181157985e+00,-3.921949061901613298e+00,0.000000000000000000e+00 +-6.137022608944259439e+00,-3.670673919963554521e+00,0.000000000000000000e+00 +4.848399268197606027e+00,-8.253359306310066756e+00,0.000000000000000000e+00 +3.710181045897119834e+00,-5.714956939008809300e+00,0.000000000000000000e+00 +4.404261556429599267e+00,-5.179156225369094813e+00,0.000000000000000000e+00 +8.480423471650485823e+00,5.505935081293400479e+00,0.000000000000000000e+00 +2.676682092765721332e+00,6.755568695663916934e+00,0.000000000000000000e+00 +1.349602128878756702e+01,-2.760280205910110141e+00,0.000000000000000000e+00 +-6.354333628858702454e+00,1.566935815149126388e+00,0.000000000000000000e+00 +9.652499414980560744e+00,-6.998124216434617573e+00,0.000000000000000000e+00 +9.109090814919925450e+00,-2.885739466264036324e+00,0.000000000000000000e+00 +9.424729913805274251e+00,-7.615755732057966298e+00,0.000000000000000000e+00 +-2.298718457690322570e+00,-9.940854626658103044e+00,0.000000000000000000e+00 +6.943235844908800303e+00,6.566408021322475363e+00,0.000000000000000000e+00 +-1.179297227185062624e+01,3.148610988692310375e+00,0.000000000000000000e+00 +5.675240778019130516e+00,-1.061068463254039251e+01,0.000000000000000000e+00 +-9.296491368779978615e+00,-6.171290820394590426e+00,0.000000000000000000e+00 +3.039700743392670379e+00,8.477483981078608011e+00,0.000000000000000000e+00 +-8.279794421336692523e+00,-2.803017026074221985e+00,0.000000000000000000e+00 +3.278886571257194849e+00,5.347735189350168561e+00,0.000000000000000000e+00 +1.863827422845622195e+00,-1.290070719733525451e+01,0.000000000000000000e+00 +-1.072330165521738898e+01,-3.802489649366284086e-01,0.000000000000000000e+00 +-1.073258780920207656e+00,-6.213274218993801057e+00,0.000000000000000000e+00 +-3.426478986566940055e+00,9.716814665952153263e+00,0.000000000000000000e+00 +7.202327952088109164e+00,5.121600172933984396e+00,0.000000000000000000e+00 +1.047836588896138110e+01,-6.382333863074792113e+00,0.000000000000000000e+00 +5.811234604184800645e+00,-8.319298986500051285e+00,0.000000000000000000e+00 +6.397475790321884404e+00,9.488321600312806581e+00,0.000000000000000000e+00 +1.195201120691531926e+01,-5.297988414364907861e+00,0.000000000000000000e+00 +7.727243630985335621e+00,7.010923292377260196e+00,0.000000000000000000e+00 +5.752351514067115090e+00,6.369432858600823977e+00,0.000000000000000000e+00 +1.044615088095522815e+01,6.462810993168848661e+00,0.000000000000000000e+00 +-1.303394241626110395e+00,1.196422018477452553e+01,0.000000000000000000e+00 +-8.135030836916312680e+00,1.024645229885290831e+00,0.000000000000000000e+00 +1.839659788413228469e-01,-8.364308881586348221e+00,0.000000000000000000e+00 +-5.300267485194837924e+00,1.161095589778359027e+01,0.000000000000000000e+00 +-7.885508602691148283e+00,7.688147706153779737e+00,0.000000000000000000e+00 +9.408419234037580736e+00,1.319904500240061340e+00,0.000000000000000000e+00 +-8.887580366717934055e+00,6.848370446358720720e+00,0.000000000000000000e+00 +1.484191788366077569e+00,-6.441161925269415001e+00,0.000000000000000000e+00 +-1.230709578968634865e+01,-2.439418675346519461e+00,0.000000000000000000e+00 +-4.264629326115078278e+00,9.834984899885139242e+00,0.000000000000000000e+00 +1.346987501589731018e+01,-2.903988687159458237e+00,0.000000000000000000e+00 +3.227677578327154517e+00,-9.940449883403619680e+00,0.000000000000000000e+00 +6.497666163166413433e+00,1.081058228256788922e+01,0.000000000000000000e+00 +-9.859128189279788401e+00,9.895946349967440270e+00,0.000000000000000000e+00 +7.301566174542353238e+00,-8.244922402723963373e+00,0.000000000000000000e+00 +-7.580699915211076778e+00,-1.591836124550713549e+00,0.000000000000000000e+00 +-9.505532154825969471e+00,-7.032476220821989088e+00,0.000000000000000000e+00 +1.340531295051455984e+01,-1.594081706516784713e+00,0.000000000000000000e+00 +1.179244973371897842e+01,5.709177596323251613e+00,0.000000000000000000e+00 +-6.487131766302675295e+00,2.093036300507789688e-02,0.000000000000000000e+00 +3.427985069410309116e+00,-1.187787974618283648e+01,0.000000000000000000e+00 +-1.408581976741892205e+01,1.625550970238727899e+01,1.000000000000000000e+00 +-1.881043151933305424e+01,-2.621960441323269109e+00,1.000000000000000000e+00 +-2.322581527025400305e+01,-2.667811322111456995e+00,1.000000000000000000e+00 +-1.773818831811092167e+01,1.385242284258890422e+01,1.000000000000000000e+00 +1.387531676297662742e+01,-1.674031384786129451e+01,1.000000000000000000e+00 +1.524986377891802292e+01,-1.478608052582741550e+01,1.000000000000000000e+00 +2.084600916661210945e+01,-7.837637204688920889e+00,1.000000000000000000e+00 +-3.335846368905910797e+00,-1.661355464770509371e+01,1.000000000000000000e+00 +-1.531546407337876659e+01,1.389103285498575069e+01,1.000000000000000000e+00 +-5.862798124093491658e+00,-1.895705090151678007e+01,1.000000000000000000e+00 +1.830567439264983065e+01,1.515095846689039405e+01,1.000000000000000000e+00 +-7.641068875385179204e+00,1.491360609394572379e+01,1.000000000000000000e+00 +-1.906664659447316978e+01,1.428824374903993499e+00,1.000000000000000000e+00 +-7.634730107177073677e+00,2.021852265839935114e+01,1.000000000000000000e+00 +-8.946142480307802458e+00,1.834914057483182859e+01,1.000000000000000000e+00 +-1.841892096560701120e+01,3.968763401385180689e+00,1.000000000000000000e+00 +-1.190606992324205393e+01,-1.480237550559005122e+01,1.000000000000000000e+00 +-1.768958485332136732e+01,1.038413696695125665e+01,1.000000000000000000e+00 +-8.501571361773706315e+00,-1.717272805437283267e+01,1.000000000000000000e+00 +-5.775465720724419327e+00,2.002395286480275516e+01,1.000000000000000000e+00 +2.134699125170529044e+01,-7.251398575296883031e+00,1.000000000000000000e+00 +1.781413832072523107e+01,7.056121174639669036e+00,1.000000000000000000e+00 +-1.649961768692056197e+01,-1.152300038742184007e+01,1.000000000000000000e+00 +-2.199533523781454036e+01,-5.240369637901090449e+00,1.000000000000000000e+00 +-2.022220219640516348e+01,5.295586840647683147e+00,1.000000000000000000e+00 +7.274107302903876082e-01,2.027846444687708782e+01,1.000000000000000000e+00 +-1.819994910579366376e+01,-1.401824275971767175e+00,1.000000000000000000e+00 +-1.485594191132518915e+01,6.027297875184268960e+00,1.000000000000000000e+00 +6.578620336695827575e+00,1.883714939585484771e+01,1.000000000000000000e+00 +-1.627021459970769612e+01,-4.918490433325404254e+00,1.000000000000000000e+00 +6.466932279519650884e+00,2.083347368624722407e+01,1.000000000000000000e+00 +2.114204413327044207e+01,6.294073669553609918e+00,1.000000000000000000e+00 +-1.524418191809297873e+01,-1.508795587492252821e+01,1.000000000000000000e+00 +2.187864861441643072e+01,-7.572218157049059428e+00,1.000000000000000000e+00 +-7.366372618457587285e-01,1.632196831778809454e+01,1.000000000000000000e+00 +1.891861621373580959e+01,-9.648249362280228780e+00,1.000000000000000000e+00 +-1.313160444416345385e+01,1.632701131849736598e+01,1.000000000000000000e+00 +-1.934693546659212160e+01,-1.326870036449994394e+01,1.000000000000000000e+00 +2.147968744797048402e+01,6.687445991361102848e+00,1.000000000000000000e+00 +1.575066236102569661e+01,9.629654206912119818e+00,1.000000000000000000e+00 +6.786805557994117777e+00,1.506120831288941808e+01,1.000000000000000000e+00 +1.330151895443178311e+01,1.137041975833180629e+01,1.000000000000000000e+00 +2.195150842243708489e+00,-1.760728806651117750e+01,1.000000000000000000e+00 +2.200035505632448007e+01,-7.998043075783540345e+00,1.000000000000000000e+00 +-1.082657318041693628e+00,2.030545540994938847e+01,1.000000000000000000e+00 +-1.775421853022066188e+01,-8.550442106904826645e+00,1.000000000000000000e+00 +1.659819141816188548e+01,-1.298883742117128470e+01,1.000000000000000000e+00 +-1.855075329425867636e+01,-8.270103260125782896e+00,1.000000000000000000e+00 +1.476912249740130001e+01,-1.043225192715721761e+01,1.000000000000000000e+00 +2.164518554409495721e+01,3.836524661536647063e+00,1.000000000000000000e+00 +-8.078122985740316508e+00,-1.381988479693678151e+01,1.000000000000000000e+00 +1.783941024006371734e+01,-1.387961998757027970e+01,1.000000000000000000e+00 +2.005823843660326133e+01,-7.994747011677134640e-01,1.000000000000000000e+00 +9.751475655640280404e-01,-1.681306880565960427e+01,1.000000000000000000e+00 +1.482893081542048463e+01,6.627858565599247243e+00,1.000000000000000000e+00 +-1.488228819116111268e+01,-9.884994691517903220e+00,1.000000000000000000e+00 +1.858342179644801462e+01,-1.320545419153004296e+01,1.000000000000000000e+00 +4.031313603555224390e+00,2.069737823722174141e+01,1.000000000000000000e+00 +-1.871196510041764682e+01,6.679055498330213059e-01,1.000000000000000000e+00 +-8.187043865690890598e+00,-1.692392184362027052e+01,1.000000000000000000e+00 +1.847298008645853074e+01,-1.092935052323345646e+00,1.000000000000000000e+00 +-1.217784293794317962e+00,-1.958808310337123615e+01,1.000000000000000000e+00 +1.177626505768050968e+01,-1.879290668870535796e+01,1.000000000000000000e+00 +7.707126339575352425e+00,-1.829951136840453429e+01,1.000000000000000000e+00 +1.505558382543773455e+01,8.480463032162875336e+00,1.000000000000000000e+00 +-2.119393794989089130e+01,-9.816193422288213455e+00,1.000000000000000000e+00 +4.384412174196432588e+00,-1.705187614748492564e+01,1.000000000000000000e+00 +1.904163303190937739e+01,1.025881051909351527e+00,1.000000000000000000e+00 +1.201792025011094012e+01,1.740326982067275097e+01,1.000000000000000000e+00 +6.457082462408918033e+00,-1.559966047720136650e+01,1.000000000000000000e+00 +2.105947251379482665e+01,-4.066524050310797556e+00,1.000000000000000000e+00 +1.787357580991723438e+01,-2.135419503673841923e+00,1.000000000000000000e+00 +1.955848548793692743e+01,7.401194442349940950e+00,1.000000000000000000e+00 +-3.079446174618643006e+00,1.913038719229226814e+01,1.000000000000000000e+00 +-9.217172216359992731e+00,1.527217041406997211e+01,1.000000000000000000e+00 +8.224705590183873483e+00,2.017261461282702584e+01,1.000000000000000000e+00 +-1.749777942338765868e+01,-1.151539351924551902e+01,1.000000000000000000e+00 +1.034680190611704020e+01,-1.963754488396148545e+01,1.000000000000000000e+00 +1.763095589337911662e+01,1.672278254557209687e+00,1.000000000000000000e+00 +6.598337664677481840e+00,-1.977406797872303201e+01,1.000000000000000000e+00 +1.042042874765041738e+01,-1.275830591034056560e+01,1.000000000000000000e+00 +7.112518493809214526e+00,-1.462910665470060678e+01,1.000000000000000000e+00 +-1.513599595923272645e+01,1.521037463861764927e+01,1.000000000000000000e+00 +1.900245304385011735e+01,-2.367845735173759625e+00,1.000000000000000000e+00 +3.696622127364966315e-01,-2.208322951401586565e+01,1.000000000000000000e+00 +-1.674446563614008809e+01,4.548141850778240958e+00,1.000000000000000000e+00 +-1.560169366657280854e+01,8.564550568764795813e+00,1.000000000000000000e+00 +-1.358193781909342590e+01,-1.097790552661601460e+01,1.000000000000000000e+00 +-2.240185634211720611e+01,-5.603200611514385088e+00,1.000000000000000000e+00 +1.954452574678360932e+01,1.336835013392262539e+01,1.000000000000000000e+00 +-2.858794153315326270e+00,-2.302730339878763388e+01,1.000000000000000000e+00 +-2.455911165895627413e+00,-1.989143206333796599e+01,1.000000000000000000e+00 +1.584364903763910171e+01,9.646518995433194021e+00,1.000000000000000000e+00 +2.050691415187010591e+01,9.107882609707594890e-01,1.000000000000000000e+00 +-1.798215621574233225e+01,-3.840035114518217885e+00,1.000000000000000000e+00 +-5.218030398042513340e+00,-1.852003062825603408e+01,1.000000000000000000e+00 +-1.626195615182393794e+01,7.999579969871203566e+00,1.000000000000000000e+00 +-3.885580139627898166e+00,-2.126363182176448419e+01,1.000000000000000000e+00 +1.622631703332194064e+01,-9.112886568774294815e+00,1.000000000000000000e+00 +3.289233406699478834e+00,-1.578293616309770719e+01,1.000000000000000000e+00 +-1.570206197463574149e+01,-8.112347071513182684e+00,1.000000000000000000e+00 +-2.110023557641758885e+01,-3.414887568059537859e+00,1.000000000000000000e+00 +-1.171737626436313207e+01,1.684019628289640735e+01,1.000000000000000000e+00 +-8.229232676902782373e+00,2.025828909402180145e+01,1.000000000000000000e+00 +-4.411049605760258174e+00,2.281047539610623431e+01,1.000000000000000000e+00 +-1.361908495722199852e+01,-1.162599818090166970e+01,1.000000000000000000e+00 +9.069239175919369345e+00,1.525657976920708592e+01,1.000000000000000000e+00 +1.371782330866971433e+00,2.222735932935401237e+01,1.000000000000000000e+00 +-1.631174401698077858e+01,1.912446542368404945e+00,1.000000000000000000e+00 +1.586417992501583818e+01,1.720846638598678169e+01,1.000000000000000000e+00 +-6.100250645849026654e+00,2.043729798858883839e+01,1.000000000000000000e+00 +-1.514274173120179756e-01,2.396069878730597935e+01,1.000000000000000000e+00 +-1.866751544404865371e+01,2.590085678608596620e+00,1.000000000000000000e+00 +1.722152128357636514e+01,1.532105592989684695e+01,1.000000000000000000e+00 +1.632359579219197698e+01,3.070645410049057666e-01,1.000000000000000000e+00 +-8.919678180244551058e+00,-1.406553559794046571e+01,1.000000000000000000e+00 +1.798477547300765522e+01,-5.923235847477148042e+00,1.000000000000000000e+00 +2.199583586046353645e+01,-6.432991015706561733e+00,1.000000000000000000e+00 +-1.210606087628472949e+01,2.056880706205652487e+01,1.000000000000000000e+00 +-1.567761440016490049e+01,-3.755054263113921653e+00,1.000000000000000000e+00 +-1.181109540423527449e+01,1.897725652574823130e+01,1.000000000000000000e+00 +1.526917652603902731e+01,-7.398945499213142263e+00,1.000000000000000000e+00 +1.830250107970536533e+01,6.669530402613020215e+00,1.000000000000000000e+00 +1.603129138567219059e+01,-6.510980790719353983e+00,1.000000000000000000e+00 +-1.087233064207762645e+01,-1.800804546254688887e+01,1.000000000000000000e+00 +9.696425322760605425e+00,-1.842533650807427037e+01,1.000000000000000000e+00 +-1.097641534077534509e+01,-1.950583983611138450e+01,1.000000000000000000e+00 +8.940813979789155042e+00,-1.605524738886916225e+01,1.000000000000000000e+00 +6.324123844534630834e+00,2.030224064707331166e+01,1.000000000000000000e+00 +-5.771326940266628291e+00,-2.149899821913217934e+01,1.000000000000000000e+00 +-1.640349684038727318e+01,8.764427348820412078e+00,1.000000000000000000e+00 +-1.196200090186676768e+01,1.233173970011232612e+01,1.000000000000000000e+00 +6.672753526427372961e+00,-1.613010582011700222e+01,1.000000000000000000e+00 +-8.470705943984732755e+00,1.372223920783005191e+01,1.000000000000000000e+00 +3.136527504609972095e+00,-1.574731525821545297e+01,1.000000000000000000e+00 +8.779430717828166308e+00,-2.220454785260612240e+01,1.000000000000000000e+00 +-1.975899624168256485e+00,1.647258011430297842e+01,1.000000000000000000e+00 +1.230965878216300702e+01,1.843755303784963573e+01,1.000000000000000000e+00 +1.198961865782439773e+01,1.906339524862348256e+01,1.000000000000000000e+00 +-4.369594976406253051e-01,-2.136814521627741215e+01,1.000000000000000000e+00 +-1.153596650343871488e+01,-1.746458284267908212e+01,1.000000000000000000e+00 +-1.056519752895748177e+01,-1.354953930252310634e+01,1.000000000000000000e+00 +-1.592817793746197097e+01,6.187303876972833905e+00,1.000000000000000000e+00 +1.093463168032933197e+01,2.132341045954430214e+01,1.000000000000000000e+00 +-8.235602869193467512e+00,-1.865641389752591550e+01,1.000000000000000000e+00 +-1.454006125251376780e+01,-1.123985805024244300e+01,1.000000000000000000e+00 +-2.565505190490253273e+00,-2.340626388938940394e+01,1.000000000000000000e+00 +1.665974385519901801e+01,-1.374618648548013411e+00,1.000000000000000000e+00 +-1.335309305414386571e+01,-1.796550630458822440e+01,1.000000000000000000e+00 +-4.722899374382690141e+00,-1.892603425152083219e+01,1.000000000000000000e+00 +-1.489728628889070983e+01,-1.687008779615263876e+01,1.000000000000000000e+00 +-1.980491475369140275e+01,6.117387954710057585e+00,1.000000000000000000e+00 +1.854552807015078386e+01,5.656321833644797792e+00,1.000000000000000000e+00 +-3.308639090088201229e-01,-1.940405230026158279e+01,1.000000000000000000e+00 +-2.159815288257910382e+01,4.646469071929907990e+00,1.000000000000000000e+00 +-2.943940135645302991e+00,1.736966318086229322e+01,1.000000000000000000e+00 +-2.142856753274137915e+01,-9.898798358668107866e+00,1.000000000000000000e+00 +9.776476702853923229e+00,1.634405660464478061e+01,1.000000000000000000e+00 +-1.177230338354111261e+01,2.016922706826369449e+01,1.000000000000000000e+00 +1.906215669925919087e+01,-2.941195507582941918e-02,1.000000000000000000e+00 +1.748929608461976670e+01,9.131879119712111859e+00,1.000000000000000000e+00 +7.300506941667010530e+00,1.469949163685404514e+01,1.000000000000000000e+00 +8.473729594218674777e+00,1.914678500486009227e+01,1.000000000000000000e+00 +-1.499523124705943644e+01,-1.030882184404770996e+01,1.000000000000000000e+00 +-1.629646418763191207e+01,1.348569901444114372e+00,1.000000000000000000e+00 +2.035982484527372804e+01,9.022390579586556214e+00,1.000000000000000000e+00 +2.137410489751234266e+01,7.494069355040792857e+00,1.000000000000000000e+00 +1.597308023387855869e+01,6.080482802867658521e+00,1.000000000000000000e+00 +1.443262597851837548e+01,-1.896843317146863228e+01,1.000000000000000000e+00 +-4.315842059365481376e+00,1.705446539686293761e+01,1.000000000000000000e+00 +1.319916894392426521e+01,1.805744511264430585e+01,1.000000000000000000e+00 +-1.759058978629317949e+01,-1.548474985972600138e+01,1.000000000000000000e+00 +2.082462611587753898e+01,6.607463476821727077e+00,1.000000000000000000e+00 +-3.363806796273415944e+00,2.343131705141279042e+01,1.000000000000000000e+00 +5.954366534199434291e+00,-2.066555709222398107e+01,1.000000000000000000e+00 +-2.102278354426128715e+01,8.011343166285978867e+00,1.000000000000000000e+00 +7.718584304440787136e+00,-1.437599354633448456e+01,1.000000000000000000e+00 +1.385456135098922203e+01,1.074151357564068121e+01,1.000000000000000000e+00 +1.994484467906970337e+01,1.235510224107671640e+01,1.000000000000000000e+00 +-1.484191764160719273e+01,-1.012110610923690146e+01,1.000000000000000000e+00 +3.244618917909689593e+00,2.051327067488236722e+01,1.000000000000000000e+00 +-1.938406729755708113e+01,-8.688565304893570485e+00,1.000000000000000000e+00 +1.478513249063537671e+01,-8.772792061643697181e+00,1.000000000000000000e+00 +1.567437276707519622e+01,-8.946857092930706301e+00,1.000000000000000000e+00 +1.282292163424287956e+01,2.002178021613681835e+01,1.000000000000000000e+00 +-1.309994103974544366e+01,-1.530540351584944325e+01,1.000000000000000000e+00 +2.065284590031502532e+01,8.986394708865578451e+00,1.000000000000000000e+00 +-3.799884320062938858e+00,2.100214796945848050e+01,1.000000000000000000e+00 +4.185996418896004712e-01,-1.932272879562866308e+01,1.000000000000000000e+00 +-8.014643663295325515e-01,-2.145741140803774627e+01,1.000000000000000000e+00 +3.867347210815940350e+00,2.090780355591596518e+01,1.000000000000000000e+00 +1.799263625130667421e+01,9.927385959331937570e+00,1.000000000000000000e+00 +3.886771499111138173e+00,1.791094324980342378e+01,1.000000000000000000e+00 +-9.773760806932845213e+00,1.303976848378022702e+01,1.000000000000000000e+00 +3.595550202052158473e-01,1.684261645691217524e+01,1.000000000000000000e+00 +-2.032489831597553831e+01,1.152621995555932521e+01,1.000000000000000000e+00 +-2.195941645981185886e+01,-8.896624415963758636e+00,1.000000000000000000e+00 +-3.549846791126267220e+00,-1.636916020825658791e+01,1.000000000000000000e+00 +-6.539620984264148396e-01,-2.384220191946839407e+01,1.000000000000000000e+00 +-2.261051931966515216e+00,-1.609144845481474206e+01,1.000000000000000000e+00 diff --git a/homework_05_nn/images/dataset_circle.png b/homework_05_nn/images/dataset_circle.png new file mode 100644 index 0000000..457ee9f Binary files /dev/null and b/homework_05_nn/images/dataset_circle.png differ diff --git a/homework_05_nn/images/dataset_moon.png b/homework_05_nn/images/dataset_moon.png new file mode 100644 index 0000000..fd0ad3c Binary files /dev/null and b/homework_05_nn/images/dataset_moon.png differ diff --git a/report_01_交通事故理赔审核预测/README.md b/report_01_交通事故理赔审核预测/README.md index 4253063..1254963 100644 --- a/report_01_交通事故理赔审核预测/README.md +++ b/report_01_交通事故理赔审核预测/README.md @@ -1,4 +1,4 @@ -# Exercise - 交通事故理赔审核预测 +# Report 1 - 交通事故理赔审核预测 ## 内容: * 任务类型:二元分类 @@ -8,16 +8,20 @@ * 数据介绍:训练集中共有200000条样本,预测集中有80000条样本。 ![data_description](images/data_description.png) -* 评价方法:Precision-Recall AUC +* 评价方法:Precision-Recall, AUC + ## 要求: + 1. 编写程序,初步完成分类 -2. 在竞赛网站上注册,提交结果 +2. 在[竞赛网站](http://sofasofa.io/competition.php?id=2)上注册,提交结果 3. 分析结果的效果,综合考虑各种方法,改进方法,并提交结果 4. 按照`report_template.ipynb`撰写自己的报告 + ## References + * [这个数据的链接](http://sofasofa.io/competition.php?id=2) diff --git a/report_02_Titanic/README.md b/report_02_Titanic/README.md index a78ef3b..9d9abc9 100644 --- a/report_02_Titanic/README.md +++ b/report_02_Titanic/README.md @@ -1,18 +1,24 @@ -# Titanic +# Report 2 - Titanic -## Competition Description -The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew. This sensational tragedy shocked the international community and led to better safety regulations for ships. +## Task Description +The sinking of the [RMS Titanic](https://en.wikipedia.org/wiki/RMS_Titanic) is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew. This sensational tragedy shocked the international community and led to better safety regulations for ships. One of the reasons that the shipwreck led to such loss of life was that there were not enough lifeboats for the passengers and crew. Although there was some element of luck involved in surviving the sinking, some groups of people were more likely to survive than others, such as women, children, and the upper-class. -In this challenge, we ask you to complete the analysis of what sorts of people were likely to survive. In particular, we ask you to apply the tools of machine learning to predict which passengers survived the tragedy. +In this challenge, we ask you to complete **the analysis of what sorts of people were likely to survive**. In particular, we ask you to apply the tools of machine learning to predict which passengers survived the tragedy. + + ## Practice Skills + * Binary classification * Python & SKLearn + + ## Data -The data ziped into 'data.zip', please first extract it. There are two groups: + +The data ziped into `data.zip`, please first extract it. There are two groups: * training set (train.csv) * test set (test.csv) @@ -23,17 +29,36 @@ The test set should be used to see how well your model performs on unseen data. We also include `gender_submission.csv`, a set of predictions that assume all and only female passengers survive, as an example of what a submission file should look like. + + ### Data description + ![data description1](images/data_description1.png) ![data description2](images/data_description2.png) + ### Variable Notes -pclass: A proxy for socio-economic status (SES) + +`pclass`: A proxy for socio-economic status (SES) + * 1st = Upper * 2nd = Middle * 3rd = Lower + +## Requirements + +* Design the classification model, implement the code +* Think methods to resolve the problem of missing data of some column +* How to convert the `pclass`, `embarked` fields to vector field +* Submit your result to [the website](https://www.kaggle.com/c/titanic) +* Finish the report by using the template `report_template.ipynb` +* Submit code, report through `git` + + + ## Links + * [Titanic: Machine Learning from Disaster](https://www.kaggle.com/c/titanic) diff --git a/report_03_Fashion/README.md b/report_03_Fashion/README.md index cbfd712..e4539dc 100644 --- a/report_03_Fashion/README.md +++ b/report_03_Fashion/README.md @@ -3,22 +3,29 @@ ## 内容: * 任务类型:多分类 -* 背景介绍:在交通摩擦(事故)发生后,理赔员会前往现场勘察、采集信息,这些信息往往影响着车主是否能够得到保险公司的理赔。训练集数据包括理赔人员在现场对该事故方采集的36条信息,信息已经被编码,以及该事故方最终是否获得理赔。我们的任务是根据这36条信息预测该事故方没有被理赔的概率。 +* 背景介绍:FashionMNIST 是一个替代 [MNIST 手写数字集](https://link.zhihu.com/?target=http%3A//yann.lecun.com/exdb/mnist/)的图像数据集。 它是由 Zalando(一家德国的时尚科技公司)旗下的研究部门提供。其涵盖了来自 10 种类别的共 7 万个不同商品的正面图片。 + + FashionMNIST 的大小、格式和训练集/测试集划分与原始的 MNIST 完全一致。60000/10000 的训练测试数据划分,28x28 的灰度图片。你可以直接用它来测试你的机器学习和深度学习算法性能,**且不需要改动任何的代码**。 + + 这个数据集的样子大致如下(每个类别占三行): + + ![fashion-mnist.jpg](images/fashion-mnist.jpg) -* 数据介绍:训练集中共有200000条样本,预测集中有80000条样本。 -![data_description](images/data_description.png) -* 评价方法:Precision-Recall AUC ## 要求: + 1. 构建深度神经网络,完成多分类 2. 编写爬虫程序,到taobao等网站抓取一些衣服、鞋子的图片,并利用训练好的模型进行分类 -3. 评估自己抓取图像的分类精度 -4. 分析结果的效果,综合考虑各种方法,改进方法,并提交结果 -5. 按照`report_template.ipynb`撰写自己的报告 +3. 对于未属于训练数据集中的商品类别,考虑使用何种方法能够判断出类别为`不支持的类别` +4. 评估自己抓取图像的分类精度 +5. 分析结果的效果,综合考虑各种方法,改进方法,并提交结果 +6. 按照`report_template.ipynb`撰写自己的报告 + ## References -* [这个数据的链接](http://sofasofa.io/competition.php?id=2) + +* [这个数据的链接](https://github.com/zalandoresearch/fashion-mnist) diff --git a/report_03_Fashion/images/fashion-mnist.jpg b/report_03_Fashion/images/fashion-mnist.jpg new file mode 100644 index 0000000..b65ac68 Binary files /dev/null and b/report_03_Fashion/images/fashion-mnist.jpg differ