From 37045c1f0e0399c582371ca15a0ecf5113a3df3b Mon Sep 17 00:00:00 2001 From: prasad Date: Mon, 20 Jan 2020 00:14:13 +0530 Subject: [PATCH] django web app implementation started and ml model integrated --- db.sqlite3 | 0 manage.py | 21 +++ templates/home.html | 1 + templates/predict.html | 5 + titanic.pkl | Bin 0 -> 789 bytes titanicsurvival/__init__.py | 0 .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 173 bytes .../__pycache__/settings.cpython-37.pyc | Bin 0 -> 2370 bytes .../__pycache__/urls.cpython-37.pyc | Bin 0 -> 1071 bytes .../__pycache__/wsgi.cpython-37.pyc | Bin 0 -> 592 bytes titanicsurvival/asgi.py | 16 +++ titanicsurvival/settings.py | 121 ++++++++++++++++++ titanicsurvival/urls.py | 24 ++++ titanicsurvival/wsgi.py | 16 +++ titanicsurvivalapp/__init__.py | 0 .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 176 bytes .../__pycache__/admin.cpython-37.pyc | Bin 0 -> 217 bytes .../__pycache__/forms.cpython-37.pyc | Bin 0 -> 641 bytes .../__pycache__/models.cpython-37.pyc | Bin 0 -> 214 bytes .../__pycache__/views.cpython-37.pyc | Bin 0 -> 950 bytes titanicsurvivalapp/admin.py | 3 + titanicsurvivalapp/apps.py | 5 + titanicsurvivalapp/forms.py | 17 +++ titanicsurvivalapp/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 187 bytes titanicsurvivalapp/models.py | 3 + titanicsurvivalapp/tests.py | 3 + titanicsurvivalapp/views.py | 23 ++++ 28 files changed, 258 insertions(+) create mode 100644 db.sqlite3 create mode 100644 manage.py create mode 100644 templates/home.html create mode 100644 templates/predict.html create mode 100644 titanic.pkl create mode 100644 titanicsurvival/__init__.py create mode 100644 titanicsurvival/__pycache__/__init__.cpython-37.pyc create mode 100644 titanicsurvival/__pycache__/settings.cpython-37.pyc create mode 100644 titanicsurvival/__pycache__/urls.cpython-37.pyc create mode 100644 titanicsurvival/__pycache__/wsgi.cpython-37.pyc create mode 100644 titanicsurvival/asgi.py create mode 100644 titanicsurvival/settings.py create mode 100644 titanicsurvival/urls.py create mode 100644 titanicsurvival/wsgi.py create mode 100644 titanicsurvivalapp/__init__.py create mode 100644 titanicsurvivalapp/__pycache__/__init__.cpython-37.pyc create mode 100644 titanicsurvivalapp/__pycache__/admin.cpython-37.pyc create mode 100644 titanicsurvivalapp/__pycache__/forms.cpython-37.pyc create mode 100644 titanicsurvivalapp/__pycache__/models.cpython-37.pyc create mode 100644 titanicsurvivalapp/__pycache__/views.cpython-37.pyc create mode 100644 titanicsurvivalapp/admin.py create mode 100644 titanicsurvivalapp/apps.py create mode 100644 titanicsurvivalapp/forms.py create mode 100644 titanicsurvivalapp/migrations/__init__.py create mode 100644 titanicsurvivalapp/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 titanicsurvivalapp/models.py create mode 100644 titanicsurvivalapp/tests.py create mode 100644 titanicsurvivalapp/views.py diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..9b70063 --- /dev/null +++ b/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'titanicsurvival.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..81dd245 --- /dev/null +++ b/templates/home.html @@ -0,0 +1 @@ +

Titanic Survival Prediction algorithm

\ No newline at end of file diff --git a/templates/predict.html b/templates/predict.html new file mode 100644 index 0000000..3d9428d --- /dev/null +++ b/templates/predict.html @@ -0,0 +1,5 @@ +
+ {% csrf_token %} + {{form.as_p}} + +
diff --git a/titanic.pkl b/titanic.pkl new file mode 100644 index 0000000000000000000000000000000000000000..91c3b0f268578a3b04e2c1c376a5e3f0c0e04306 GIT binary patch literal 789 zcmZ{iPe>F|9LHz>XzRG9W~*u1|7@*oGE1|PouL(k1{Rsq6pO=~+0mKYo!Q^Kx55%d zQLA_eBM_=<;h}Dwq)QYX3Jp>z3JNwVknqr<4sC?Z%&-=~0RkM=`=r+Cj4)CfR_d7tR9cL$(09*>`1x62)Pia=0~1;#oeeZ^;!QK*}Q zjRMrW0!j*DtYQfo{v#k+s$v?LSXqV8&{)En!~(@_vWER zD=F&zu%)EfDnOg9sQoLqRi2JD*y3(EH*gBt33SMAKZ&LiB*8YVQFC$IHJi0VfSoRj z_fNtujh>EivE~QY^ASH+tZ83*69?nPESH1F{&jFYNva zNinkqkswk5A9TQs0Efzb?RK!GW(}X`oJLXIz`g`kf=B%-aUl9Jh=2h`Aj1KOi&=m~3PUi1CZpdI z6Ht^`oR|`ml9ia3o?o6{lwDkqn4B6@l39|NmzkWJR|aDimll;}mL=w3@Z;k%^D;}~ Y!Z$6V4TZFg91;o))1fG~2p;@3k({)e3>sN`aW2t^(VY^a z|Dx|al*j%{n!fd^PkrxGSF)XW9A=v8tn=O8?r-<@etTLkmrEIZ{{D6GolwqX{!Aw0 zr-*}B__9B+gN%^@0kV!@2t?S={+65QMKbeANScvPr3I3Q+^4Kj1ksp<8KczC7#AQ9 z1t`KSl;8qf>=%rSP=-0U1ef6o%)?cblwrY`gKMPN7hndi!wt9zx8QbPqypUeDE0;8 z65KT|!x!-7iJyC)vLJoTQo*`}=-r_Stp7FI0&>QrAc-8Y3 zpO9s1_3`sn>%q$5Q#;@*k4($wuD`hN9k_b5Fx;AK`yLNyPfpVqU7ePOd@s5)B}`0+ z$NBL9o!^*RWP~wH?AZku7py*7+@7}JcocSW0L+-5I(%y|h?YnCE(LJNkrfb`5jzYh zKbE!8pn0+uJ(-3d1td?{YeU(D)zVofc-pS-$<_4lKU7(;D_61GqU2~o_1RP`7N&DD z4h83!NouELoG_f;#5j4A#?4_uC#;@+W)lvz5B4ql01HC?`E_8qq&-NO&nD~^rm`-F zfy1K82yIL>xrZ>sgK<^JwX^{BF%OOTlo%hliS=S*aDKp|N7Eo@bz~sDupfPU4$XkP z$J*i1cO%^s@+Nux404k1Xl+XQB$uBt7_TjfabaDlzExW_L#)*|wYaEsI%Ya5v^#pe z-O{4zn@T=neJUemG3V)l#swg|R_O2(&O`4si|oBaIa!NJC>)KKvT5O7L1$cE{fL7>|fZAsfW{9^OG9%a3t5LCn*FIKHW$9L2FipI% zO*78=EEWeA-^1+Fz(c~v1*^wWNzpWud&V@4;<}=#$$7@&zE3@)tgFpVL(x?&6_zx$ zx~b~sTlJTCrlziUH{!C=XtcN0n)#-!=~_HjZ)rM;P=L(P;!?9-t2NYZWmAnWZnoRH z+1+eZ+pX8}>WiI(DQu?`Sj>W*;h7+r4lqkL*%{pi#5)`h$KT>J^YQmj9vsKTA6*|phrGOi zuGkiKVz!vOE6nA^oR}5!S>d$h#nW+C$mc|yi$XR#mZD7|884Lbxulhfh%jvVe*q=F BCIbKf literal 0 HcmV?d00001 diff --git a/titanicsurvival/__pycache__/urls.cpython-37.pyc b/titanicsurvival/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8236e500c98066ad88a7a8ab44a5ab2f209ba81f GIT binary patch literal 1071 zcma)5&2G~`5VjNNr*2v#o?s71iKSrkbBh206%~~bLWN2wib%KKO|rqeYwfPnmMd3y z0-k_Z@|6>>z=;{hmZBo0uI2U2cs%oc-;Q4%9E2XMUq9}B`qqXgI?d{V@f>dZ5jN&c zJ?67k=F8T!<)hus+A^31l^tXq*`0QMj|Z&7TkGDs|Fs2nmv`5DtjGG_+u-ei7qUI{ zmhI_23*URuKD}yro)eBLk=nv+#D-?%?DP#e(rO`=g`rMp6^0*HoSYXX%c*nRD0@ya zVI48LaNObtmN-o|f?wL09BV_QHk=5x&_-4zNS<+OIkB8iLIP{$Ty7^x!gOk5wx(*S zbEDThb#ba?!d3D(evmkw1F!^>6KHRf@YNNSP|Hrj<3go~Zriph`YA#-iq zgph^NlE~{h&GS0AlmDpBuP6h79ft5JkX?<2!*R`Pr6nH|MJ0baM0*&8M;W#D{sjP)iV@>W9=)ILt<$lS&u@ zP~dnlmyaT{sHL22<=P%cjDj~H>)dfA%B|5}WO|u^fK8_%2CBNlC<=eWXnT=gb|{lV zff1nM7^w95(yii2>6HQMjR~lJ*~<-QB6V-0LD`$nVS?uK>0u2TxH=;)49vAx?(Z-$ z@QZon-5bLWr(pto5m@1P86aoVg@EZ-1$HLlr)Tcq3*7#k9!+LvmK!^JXQ-uYw(WGO t&1aj_l+WruTx}Y&`M>`0v1goLm;EPFvm)cqu!9}I7Wf0a+5`X4{|jWNPn7@w literal 0 HcmV?d00001 diff --git a/titanicsurvival/__pycache__/wsgi.cpython-37.pyc b/titanicsurvival/__pycache__/wsgi.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9afa8a749413c9f4f56bcfd2319b6776d4a9fb3d GIT binary patch literal 592 zcmZWm!EO^V5cN7~6D<^RKov(HxI}{8O57@hD71}&AVs7VQWUW<>&eE!Yp*=chW5$_ z@C$H4{E{z7aN-v@;Z2BC!AKs@cr@=l&ph4Ri%GB_pYFZ=8WHldNw(Gw!INtE^c-?vgkjI0hdogMiGe-f3VfjRhukATHMhW^@3T$YxT(eTD$>+_?%5(^Qxo6S3gBFk4Nz zDO1qt!{i{Ho0T)EfJ&Lm60}QKSjaT~6~;n_y~y7wz-7%_c1?!gKYo5R?4M<$lk@Yz zus_OPo*iGjIJvs}&lC~_=cF#M*YTY!3sSPoQ-l8YMo^N6elW zV8)lq`5V`mzY*Ikb?tt?es(yyK(IJ@WjS&&*?_K$eUBB-Ve(f^0NsY$_57DN8j|YL VcOPw*@wgjkuyJkLr8ns<`Ume)zg`kf^YpQaUl9Jh=2h`Aj1KOi&=m~3PUi1CZpdI z6Ht^`oR|`ml9ia3o?o6{lwDkqn4B6@l39|NmzkWJR|aDimll;}mL=w(^AigSV&da7 c^D;}~ literal 0 HcmV?d00001 diff --git a/titanicsurvivalapp/__pycache__/admin.cpython-37.pyc b/titanicsurvivalapp/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a060d22154c21c86eef4496e377f6db0bff691e GIT binary patch literal 217 zcmZ?b<>g`kf^YpQaZW(`F^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!3wQ*(xTqIJKxaCZH&> zI58y#qM9L|*JGslX#1kNbDk1_!F)|Pw!gZuD z$2Ao*v}0h1!s|dJh~~GRz0t!}ge6j}N!W zp;q_!Xqz0FJM0-RM6`rP){q6p_bB*#1RrpS*uce58Bj=@mFI0$f;BNxGHMe1on)zt zi$co=io(r{qG{Dodpj+Pi$T_tN6b!(()Z({6=(&<1Q_g+#kn-g3ToxJC%V1GSYkX9 z4?7G1y#jL^n;z>P5Ka+HuHY9jk1)}w{(f4#%s*N%Ha|7eN|md%)T{QgHD7HfOUV1G zml`L~o1JL~v#B<+{vXS(%g5_`-d!1n75r9giYg9x$XQAs(3FmzlZ?A)sx%G7{Y{Ln X``#w&F~+<2)wH75_|S;;Ye?BYu$HLJ literal 0 HcmV?d00001 diff --git a/titanicsurvivalapp/__pycache__/models.cpython-37.pyc b/titanicsurvivalapp/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..130b5c95ee9b13a792e4aae3e5bff81ba264319d GIT binary patch literal 214 zcmZ?b<>g`kf^YpQaW+8uF^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##?N;`6;P6#eSMhw>VR>67$mY^-_|GK$=%F6tMs)F!3wg*(xTqIJKxaCZH&>I58y# zqP9H0D7&~IF*!A+B(o$jFEcqcuMEa4E-fm{EKAHm=O-2v#6T?7E2zB1VFP5B=A_y& K0`2+?#0&tW)jTl( literal 0 HcmV?d00001 diff --git a/titanicsurvivalapp/__pycache__/views.cpython-37.pyc b/titanicsurvivalapp/__pycache__/views.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..286e2334bd76475ab9a9d8310825bf04710d80ec GIT binary patch literal 950 zcmZ8gzi$&U6t;c7A4wA^2$0wqSdJkB6G8|Ig(9S?R7&Y!MMUQ8Uaq-c*uE61WC|<) zLo@O(d1dOx1QHX^mlPp@dj*Bkk-lDm+1R{|E_R1YZyfL?|MdLqUcp?p#7Pim?rpEQM4Dmv|lH2Z=*& zP_O`O7fkPiGw1>vBCsG!vce1OD!8wwG{p;Iyi+MWV&($c)*!qTdir6sjsotND3J;e)Y z{aR(Ev0<&G$P%L*+cCAFk{=tX4eM`O9v796x$S0U-I%d}d`q4GhSWBs{65}&JbI_4 z(xXGgH5Vgs%FDDmtJGB2JdvZ#cVs!cg1S+&Y{v8dV_w&zStif)p#E&BJ5K}^bbCYa zHok`MfT^3X_E$OAwGY-R#{kUHDcqDPQTGg9q6Mf3IuPN_afX-PaJ^4q|JY!7*IRv{9zVaQsZDEf@NL8yOSThe+LW&M~`oHyrALyAGz^I>KEX z03BU;BADCVIAYst;s<(CDU&otuPcU-!GfBXf@|fdw7%-AF|5R)1x{@|}0=hT3 QeCqy@R)QW>gNH`pACI!>d;kCd literal 0 HcmV?d00001 diff --git a/titanicsurvivalapp/admin.py b/titanicsurvivalapp/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/titanicsurvivalapp/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/titanicsurvivalapp/apps.py b/titanicsurvivalapp/apps.py new file mode 100644 index 0000000..d90b3fa --- /dev/null +++ b/titanicsurvivalapp/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class TitanicsurvivalappConfig(AppConfig): + name = 'titanicsurvivalapp' diff --git a/titanicsurvivalapp/forms.py b/titanicsurvivalapp/forms.py new file mode 100644 index 0000000..519c245 --- /dev/null +++ b/titanicsurvivalapp/forms.py @@ -0,0 +1,17 @@ +from django import forms + + +class InputForm(forms.Form): + P_class = ( + ('1', '1st Class'), + ('2', '2nd Class'), + ('3', '3rd Class') + ) + gender = ( + ('0', 'Female'), + ('1', 'Male') + ) + name = forms.CharField(required=True) + passenger_class = forms.ChoiceField(choices=P_class, required=True) + age = forms.IntegerField(required=True) + gender = forms.ChoiceField(choices=gender) \ No newline at end of file diff --git a/titanicsurvivalapp/migrations/__init__.py b/titanicsurvivalapp/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/titanicsurvivalapp/migrations/__pycache__/__init__.cpython-37.pyc b/titanicsurvivalapp/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6760a1fb1397514d1ca60761f4c5e21f8ddc66a GIT binary patch literal 187 zcmZ?b<>g`kf^YpQaUl9Jh=2h`Aj1KOi&=m~3PUi1CZpdI z6Ht^`oR|`ml9ia3o?o6{lwDkqn4B6@l39|NmzkWJR|aDimll;}mL=w(^AigSVsbOn nixNvR^Ye;h;^Q;(GE3s)^$IF)aoFVMr