cod-13 commited on
Commit
b62cc69
1 Parent(s): 9d9ce73

Upload 5 files

Browse files
Files changed (5) hide show
  1. apk.py +27 -0
  2. model.pkl +3 -0
  3. request.py +6 -0
  4. requirements.txt +125 -0
  5. templates/index.html +35 -0
apk.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ from flask import Flask, request, jsonify, render_template
3
+ import pickle
4
+
5
+ app = Flask(__name__)
6
+ model = pickle.load(open('model.pkl', 'rb'))
7
+
8
+ @app.route('/')
9
+ def home():
10
+ return render_template('index.html')
11
+
12
+ @app.route('/predict',methods=['POST'])
13
+ def predict():
14
+ '''
15
+ For rendering results on HTML GUI
16
+ '''
17
+ int_features = [int(x) for x in request.form.values()]
18
+ final_features = [np.array(int_features)]
19
+ prediction = model.predict(final_features)
20
+
21
+ output = round(prediction[0], 2)
22
+
23
+ return render_template('index.html', prediction_text='Employee Salary should be $ {}'.format(output))
24
+
25
+
26
+ if __name__ == "__main__":
27
+ app.run(debug=True)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d4fc0a54a5e4a44a6e91da98abd889eb38337f105368de72cc44795b1fcb3b6
3
+ size 582
request.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ url = 'http://localhost:5000/predict_api'
4
+ r = requests.post(url,json={'experience':2, 'test_score':9, 'interview_score':6})
5
+
6
+ print(r.json())
requirements.txt ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ anyio @ file:///C:/ci/anyio_1644481856696/work/dist
2
+ appdirs==1.4.4
3
+ argon2-cffi @ file:///opt/conda/conda-bld/argon2-cffi_1645000214183/work
4
+ argon2-cffi-bindings @ file:///C:/ci/argon2-cffi-bindings_1644569876605/work
5
+ asttokens @ file:///opt/conda/conda-bld/asttokens_1646925590279/work
6
+ attrs @ file:///C:/b/abs_09s3y775ra/croot/attrs_1668696195628/work
7
+ Babel @ file:///C:/b/abs_a2shv_3tqi/croot/babel_1671782804377/work
8
+ backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
9
+ beautifulsoup4 @ file:///C:/ci/beautifulsoup4_1650293028159/work
10
+ bleach @ file:///opt/conda/conda-bld/bleach_1641577558959/work
11
+ blinker==1.6.2
12
+ Bottleneck @ file:///C:/Windows/Temp/abs_3198ca53-903d-42fd-87b4-03e6d03a8381yfwsuve8/croots/recipe/bottleneck_1657175565403/work
13
+ brotlipy==0.7.0
14
+ certifi @ file:///C:/b/abs_85o_6fm0se/croot/certifi_1671487778835/work/certifi
15
+ cffi @ file:///C:/b/abs_49n3v2hyhr/croot/cffi_1670423218144/work
16
+ charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work
17
+ click==8.1.3
18
+ colorama @ file:///C:/b/abs_a9ozq0l032/croot/colorama_1672387194846/work
19
+ comm @ file:///C:/b/abs_1419earm7u/croot/comm_1671231131638/work
20
+ contourpy @ file:///C:/b/abs_d5rpy288vc/croots/recipe/contourpy_1663827418189/work
21
+ cryptography @ file:///C:/b/abs_8ecplyc3n2/croot/cryptography_1677533105000/work
22
+ cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
23
+ debugpy @ file:///C:/ci_310/debugpy_1642079916595/work
24
+ decorator @ file:///opt/conda/conda-bld/decorator_1643638310831/work
25
+ defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
26
+ entrypoints @ file:///C:/ci/entrypoints_1649926676279/work
27
+ executing @ file:///opt/conda/conda-bld/executing_1646925071911/work
28
+ fastjsonschema @ file:///C:/Users/BUILDE~1/AppData/Local/Temp/abs_ebruxzvd08/croots/recipe/python-fastjsonschema_1661376484940/work
29
+ Flask==2.3.2
30
+ flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
31
+ fonttools==4.25.0
32
+ gunicorn==20.1.0
33
+ idna @ file:///C:/b/abs_bdhbebrioa/croot/idna_1666125572046/work
34
+ ipykernel @ file:///C:/b/abs_b4f07tbsyd/croot/ipykernel_1672767104060/work
35
+ ipython @ file:///C:/b/abs_d3h279dv3h/croot/ipython_1676582236558/work
36
+ ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work
37
+ ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1634143127070/work
38
+ itsdangerous==2.1.2
39
+ jedi @ file:///C:/ci/jedi_1644315428305/work
40
+ Jinja2 @ file:///C:/b/abs_7cdis66kl9/croot/jinja2_1666908141852/work
41
+ joblib @ file:///C:/b/abs_e60_bwl1v6/croot/joblib_1666298845728/work
42
+ json5 @ file:///tmp/build/80754af9/json5_1624432770122/work
43
+ jsonschema @ file:///C:/b/abs_6ccs97j_l8/croot/jsonschema_1676558690963/work
44
+ jupyter @ file:///C:/Windows/TEMP/abs_56xfdi__li/croots/recipe/jupyter_1659349053177/work
45
+ jupyter-console @ file:///C:/b/abs_68ttzd5p9c/croot/jupyter_console_1677674667636/work
46
+ jupyter-server @ file:///C:/b/abs_1cfi3__jl8/croot/jupyter_server_1671707636383/work
47
+ jupyter_client @ file:///C:/b/abs_d8fk_kz9zk/croot/jupyter_client_1676330195659/work
48
+ jupyter_core @ file:///C:/b/abs_bd7elvu3w2/croot/jupyter_core_1676538600510/work
49
+ jupyterlab @ file:///C:/b/abs_513jt6yy74/croot/jupyterlab_1675354138043/work
50
+ jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work
51
+ jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work
52
+ jupyterlab_server @ file:///C:/b/abs_d1z_g1swc8/croot/jupyterlab_server_1677153204814/work
53
+ kiwisolver @ file:///C:/b/abs_88mdhvtahm/croot/kiwisolver_1672387921783/work
54
+ lxml @ file:///C:/ci/lxml_1657527492694/work
55
+ MarkupSafe @ file:///C:/ci/markupsafe_1654508036328/work
56
+ matplotlib @ file:///C:/b/abs_999d_v8_lh/croot/matplotlib-suite_1678723900840/work
57
+ matplotlib-inline @ file:///C:/ci/matplotlib-inline_1661934094726/work
58
+ mistune @ file:///C:/ci_310/mistune_1642084168466/work
59
+ mkl-fft==1.3.1
60
+ mkl-random @ file:///C:/ci_310/mkl_random_1643050563308/work
61
+ mkl-service==2.4.0
62
+ munkres==1.1.4
63
+ nbclassic @ file:///C:/b/abs_d0_ze5q0j2/croot/nbclassic_1676902914817/work
64
+ nbclient @ file:///C:/ci/nbclient_1650308592199/work
65
+ nbconvert @ file:///C:/b/abs_4av3q4okro/croot/nbconvert_1668450658054/work
66
+ nbformat @ file:///C:/b/abs_85_3g7dkt4/croot/nbformat_1670352343720/work
67
+ nest-asyncio @ file:///C:/b/abs_3a_4jsjlqu/croot/nest-asyncio_1672387322800/work
68
+ notebook @ file:///C:/b/abs_ca13hqvuzw/croot/notebook_1668179888546/work
69
+ notebook_shim @ file:///C:/b/abs_ebfczttg6x/croot/notebook-shim_1668160590914/work
70
+ numexpr @ file:///C:/b/abs_a7kbak88hk/croot/numexpr_1668713882979/work
71
+ numpy @ file:///C:/b/abs_datssh7cer/croot/numpy_and_numpy_base_1672336199388/work
72
+ packaging @ file:///C:/b/abs_ed_kb9w6g4/croot/packaging_1678965418855/work
73
+ pandas @ file:///C:/b/abs_b9kefbuby2/croot/pandas_1677835593760/work
74
+ pandocfilters @ file:///opt/conda/conda-bld/pandocfilters_1643405455980/work
75
+ parso @ file:///opt/conda/conda-bld/parso_1641458642106/work
76
+ pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work
77
+ Pillow==9.4.0
78
+ platformdirs @ file:///C:/b/abs_73cc5cz_1u/croots/recipe/platformdirs_1662711386458/work
79
+ ply==3.11
80
+ pooch @ file:///tmp/build/80754af9/pooch_1623324770023/work
81
+ prometheus-client @ file:///C:/Windows/TEMP/abs_ab9nx8qb08/croots/recipe/prometheus_client_1659455104602/work
82
+ prompt-toolkit @ file:///C:/b/abs_6coz5_9f2s/croot/prompt-toolkit_1672387908312/work
83
+ psutil @ file:///C:/Windows/Temp/abs_b2c2fd7f-9fd5-4756-95ea-8aed74d0039flsd9qufz/croots/recipe/psutil_1656431277748/work
84
+ pure-eval @ file:///opt/conda/conda-bld/pure_eval_1646925070566/work
85
+ pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
86
+ Pygments @ file:///opt/conda/conda-bld/pygments_1644249106324/work
87
+ pyOpenSSL @ file:///C:/b/abs_552w85x1jz/croot/pyopenssl_1677607703691/work
88
+ pyparsing @ file:///C:/Users/BUILDE~1/AppData/Local/Temp/abs_7f_7lba6rl/croots/recipe/pyparsing_1661452540662/work
89
+ PyQt5==5.15.7
90
+ PyQt5-sip @ file:///C:/Windows/Temp/abs_d7gmd2jg8i/croots/recipe/pyqt-split_1659273064801/work/pyqt_sip
91
+ pyrsistent @ file:///C:/ci_310/pyrsistent_1642117077485/work
92
+ PySocks @ file:///C:/ci_310/pysocks_1642089375450/work
93
+ python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
94
+ pytz @ file:///C:/b/abs_22fofvpn1x/croot/pytz_1671698059864/work
95
+ pywin32==305.1
96
+ pywinpty @ file:///C:/b/abs_73vshmevwq/croot/pywinpty_1677609966356/work/target/wheels/pywinpty-2.0.10-cp310-none-win_amd64.whl
97
+ pyzmq @ file:///C:/ci/pyzmq_1657616000714/work
98
+ qtconsole==5.4.0
99
+ QtPy @ file:///C:/ci/qtpy_1662015130233/work
100
+ requests @ file:///C:/b/abs_80_edxtvhu/croot/requests_1678709752318/work
101
+ scikit-learn @ file:///C:/b/abs_7ck_bnw91r/croot/scikit-learn_1676911676133/work
102
+ scipy==1.10.0
103
+ seaborn @ file:///C:/b/abs_68ltdkoyoo/croot/seaborn_1673479199997/work
104
+ Send2Trash @ file:///tmp/build/80754af9/send2trash_1632406701022/work
105
+ sip @ file:///C:/Windows/Temp/abs_b8fxd17m2u/croots/recipe/sip_1659012372737/work
106
+ six @ file:///tmp/build/80754af9/six_1644875935023/work
107
+ sniffio @ file:///C:/ci_310/sniffio_1642092172680/work
108
+ soupsieve @ file:///C:/b/abs_fasraqxhlv/croot/soupsieve_1666296394662/work
109
+ stack-data @ file:///opt/conda/conda-bld/stack_data_1646927590127/work
110
+ terminado @ file:///C:/b/abs_25nakickad/croot/terminado_1671751845491/work
111
+ threadpoolctl @ file:///Users/ktietz/demo/mc3/conda-bld/threadpoolctl_1629802263681/work
112
+ tinycss2 @ file:///C:/b/abs_52w5vfuaax/croot/tinycss2_1668168823131/work
113
+ toml @ file:///tmp/build/80754af9/toml_1616166611790/work
114
+ tomli @ file:///C:/Windows/TEMP/abs_ac109f85-a7b3-4b4d-bcfd-52622eceddf0hy332ojo/croots/recipe/tomli_1657175513137/work
115
+ tornado @ file:///C:/ci/tornado_1662476985533/work
116
+ traitlets @ file:///C:/b/abs_e5m_xjjl94/croot/traitlets_1671143896266/work
117
+ typing_extensions @ file:///C:/b/abs_89eui86zuq/croot/typing_extensions_1669923792806/work
118
+ urllib3 @ file:///C:/b/abs_9bcwxczrvm/croot/urllib3_1673575521331/work
119
+ wcwidth @ file:///Users/ktietz/demo/mc3/conda-bld/wcwidth_1629357192024/work
120
+ webencodings==0.5.1
121
+ websocket-client @ file:///C:/ci_310/websocket-client_1642093970919/work
122
+ Werkzeug==2.3.4
123
+ widgetsnbextension @ file:///C:/ci/widgetsnbextension_1645009839917/work
124
+ win-inet-pton @ file:///C:/ci_310/win_inet_pton_1642658466512/work
125
+ wincertstore==0.2
templates/index.html ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html >
3
+ <!--From https://codepen.io/frytyler/pen/EGdtg-->
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <title>ML API</title>
7
+ <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
8
+ <link href='https://fonts.googleapis.com/css?family=Arimo' rel='stylesheet' type='text/css'>
9
+ <link href='https://fonts.googleapis.com/css?family=Hind:300' rel='stylesheet' type='text/css'>
10
+ <link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
11
+
12
+ </head>
13
+
14
+ <body>
15
+ <div class="login">
16
+ <h1>Predict Salary Analysis</h1>
17
+
18
+ <!-- Main Input For Receiving Query to our ML -->
19
+ <form action="{{ url_for('predict')}}"method="post">
20
+ <input type="text" name="experience" placeholder="Experience" required="required" />
21
+ <input type="text" name="test_score" placeholder="Test Score" required="required" />
22
+ <input type="text" name="interview_score" placeholder="Interview Score" required="required" />
23
+
24
+ <button type="submit" class="btn btn-primary btn-block btn-large">Predict</button>
25
+ </form>
26
+
27
+ <br>
28
+ <br>
29
+ {{ prediction_text }}
30
+
31
+ </div>
32
+
33
+
34
+ </body>
35
+ </html>