Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- .gitattributes +1 -0
- Student-Employability-Datasets281%29.xlsx +3 -0
- app.py +36 -0
- requirements.txt +5 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Student-Employability-Datasets281%29.xlsx filter=lfs diff=lfs merge=lfs -text
|
Student-Employability-Datasets281%29.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b180ff29985362e242ff68e68b6046f6dc78a7e2cc85eae587ba43ff8bba44d
|
| 3 |
+
size 138468
|
app.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
+
from sklearn.linear_model import Perceptron
|
| 4 |
+
import pandas as pd
|
| 5 |
+
|
| 6 |
+
file_path = "Student-Employability-Datasets (1).xlsx"
|
| 7 |
+
df = pd.read_excel(file_path, sheet_name='Data')
|
| 8 |
+
|
| 9 |
+
X = df.iloc[:, 1:-2].values
|
| 10 |
+
y = (df['CLASS'] == 'Employable').astype(int)
|
| 11 |
+
|
| 12 |
+
model = Perceptron()
|
| 13 |
+
model.fit(X, y)
|
| 14 |
+
|
| 15 |
+
def evaluate_employment(name, *ratings):
|
| 16 |
+
input_data = np.array(ratings).reshape(1, -1)
|
| 17 |
+
prediction = model.predict(input_data)[0]
|
| 18 |
+
|
| 19 |
+
if prediction == 1:
|
| 20 |
+
return f"{name}, Congrats! 🎉 You are employable."
|
| 21 |
+
else:
|
| 22 |
+
return f"{name}, Try to upgrade yourself! 📚"
|
| 23 |
+
|
| 24 |
+
def app():
|
| 25 |
+
with gr.Blocks() as demo:
|
| 26 |
+
name = gr.Textbox(label="Enter your name")
|
| 27 |
+
sliders = [gr.Slider(1, 5, step=1, label=col) for col in df.columns[1:-2]]
|
| 28 |
+
button = gr.Button("Get Yourself Evaluated")
|
| 29 |
+
output = gr.Textbox(label="Result")
|
| 30 |
+
|
| 31 |
+
button.click(evaluate_employment, inputs=[name] + sliders, outputs=output)
|
| 32 |
+
|
| 33 |
+
return demo
|
| 34 |
+
|
| 35 |
+
app().launch(share=True)
|
| 36 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
numpy
|
| 3 |
+
pandas
|
| 4 |
+
scikit-learn
|
| 5 |
+
openpyxl
|