Commit 80037b9b authored by NaduniRanasinghe's avatar NaduniRanasinghe

Added files to component 1

parent 8f0a430d
Pipeline #1795 failed with stages
# A-LA-Performance-Predictor
import numpy as np
from flask import Flask, request, jsonify ,render_template,g
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
import warnings
warnings.filterwarnings("ignore")
import pickle
import pandas as pd
from flask import Flask, jsonify, request
from pandas.tseries.offsets import DateOffset
import csv
app = Flask(__name__,static_url_path='',
static_folder='static',
template_folder='templates')
model = pickle.load(open('elearn.pkl','rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['POST'])
def predict():
Log = request.form["file"]
data = LoadPastDataset(Log)
data1 = pd.read_csv(r'{0}'.format(Log),sep=",",usecols=(0,1,2,3))
pred = model.predict(data)
print(pred)
data1['Predicitons'] = pred
Pass = data1.loc[data1.Predicitons==0].drop(['Predicitons'], axis=1)
Pass['Result'] = 'Pass'
Fail = data1.loc[data1.Predicitons==1].drop(['Predicitons'], axis=1)
Fail['Result'] = 'Fail'
With = data1.loc[data1.Predicitons==2]
Disc = data1.loc[data1.Predicitons==3]
print(Pass)
return render_template('index.html',tables=[Pass.to_html(classes='Pass'), Fail.to_html(classes='Fail')],titles = ['na'], P=len(Pass), F=len(Fail),
T=len(data1),W=len(With),D=len(Disc),G =len(Disc) + len(Pass), logName=Log)
from sklearn.preprocessing import StandardScaler
def LoadPastDataset(log):
data = pd.read_csv(r'{0}'.format(log),sep=",",usecols=(0,1,2,3))
X = data.iloc[:,0:4].values
scaler = StandardScaler()
X_train = scaler.fit_transform(X)
return X_train
if __name__ == '__main__':
app.run(debug=True)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
absl-py==0.9.0
appdirs==1.4.4
astor==0.8.1
attrs==19.3.0
backcall==0.1.0
bleach==3.1.5
blis==0.4.1
boto==2.49.0
boto3==1.14.56
botocore==1.17.56
cachetools==4.1.0
catalogue==1.0.0
certifi==2020.4.5.1
cffi==1.14.2
chardet==3.0.4
click==7.1.2
colorama==0.4.3
cryptography==3.1
cycler==0.10.0
cymem==2.0.3
Cython==0.29.14
decorator==4.4.2
defusedxml==0.6.0
deployml==0.0.1
distlib==0.3.1
docutils==0.15.2
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
entrypoints==0.3
filelock==3.0.12
files==1.1.1
firebase==3.0.1
Flask==1.1.2
flask-paginate==0.7.0
gast==0.2.2
gcloud==0.18.3
gensim==3.8.3
google-auth==1.4.2
google-auth-oauthlib==0.4.1
google-pasta==0.2.0
googleapis-common-protos==1.52.0
grpcio==1.28.1
h5py==2.10.0
httplib2==0.18.1
idna==2.9
imbalanced-learn==0.6.2
imblearn==0.0
importlib-metadata==1.6.0
importlib-resources==3.0.0
ipykernel==5.2.1
ipython==7.14.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
itsdangerous==1.1.0
jedi==0.17.0
Jinja2==2.11.2
jmespath==0.10.0
joblib==0.14.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.3
jupyter-console==6.1.0
jupyter-core==4.6.3
jwcrypto==0.8
Keras==2.3.1
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.2.0
Markdown==3.2.1
MarkupSafe==1.1.1
matplotlib==3.2.1
mistune==0.8.4
murmurhash==1.0.2
Naked==0.1.31
nbconvert==5.6.1
nbformat==5.0.6
nltk==3.5
notebook==6.0.3
numpy==1.18.3
oauth2client==4.1.3
oauthlib==3.1.0
opt-einsum==3.2.1
packaging==20.3
pandas==0.24.2
pandocfilters==1.4.2
parso==0.7.0
patsy==0.5.1
pickleshare==0.7.5
plac==1.1.3
preshed==3.0.2
prometheus-client==0.7.1
prompt-toolkit==3.0.5
protobuf==3.11.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
pycryptodome==3.9.8
Pygments==2.6.1
pyparsing==2.4.7
PyPDF2==1.26.0
pyrsistent==0.16.0
python-dateutil==2.8.1
python-jwt==3.3.0
pytz==2020.1
pywin32==227
pywinpty==0.5.7
PyYAML==5.3.1
pyzmq==19.0.0
qtconsole==4.7.3
QtPy==1.9.0
regex==2020.7.14
requests==2.23.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
rsa==4.0
s3transfer==0.3.3
scikit-learn==0.22.2.post1
scipy==1.4.1
Send2Trash==1.5.0
shellescape==3.8.1
six==1.12.0
sklearn==0.0
smart-open==2.1.1
spacy==2.3.2
srsly==1.0.2
sseclient==0.0.26
statsmodels==0.11.1
tensorboard==2.0.2
tensorflow==2.0.1
tensorflow-estimator==2.0.1
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
thinc==7.4.1
tornado==6.0.4
tqdm==4.48.2
traitlets==4.3.3
urllib3==1.25.9
virtualenv==20.0.31
wasabi==0.8.0
wcwidth==0.1.9
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
zipp==3.1.0
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
line-height: 1.15;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
footer,
header,
nav,
section {
display: block;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
figcaption,
figure,
main {
display: block;
}
figure {
margin: 1em 40px;
}
hr {
-webkit-box-sizing: content-box;
box-sizing: content-box;
height: 0;
overflow: visible;
}
pre {
font-family: monospace, monospace;
font-size: 1em;
}
a {
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
a:active,
a:hover {
outline-width: 0;
}
abbr[title] {
border-bottom: none;
text-decoration: underline;
text-decoration: underline dotted;
}
b,
strong {
font-weight: inherit;
}
b,
strong {
font-weight: bolder;
}
code,
kbd,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
dfn {
font-style: italic;
}
mark {
background-color: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
audio,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
img {
border-style: none;
}
svg:not(:root) {
overflow: hidden;
}
button,
input,
optgroup,
select,
textarea {
font-family: sans-serif;
font-size: 100%;
line-height: 1.15;
margin: 0;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,