|
|
|
"""Untitled19.ipynb |
|
|
|
Automatically generated by Colaboratory. |
|
|
|
Original file is located at |
|
https://colab.research.google.com/drive/123iPxfG1KBLCe4t3m41RIziyYLSOxg30 |
|
""" |
|
|
|
pip install gradio |
|
|
|
import gradio as gr |
|
import pandas as pd |
|
import numpy as np |
|
|
|
df=pd.read_csv('/content/final_processed.csv') |
|
df.tail(55) |
|
|
|
df.sample(1) |
|
|
|
def assign_weights(Name,col1,col2,col3,col4,col5,col6,col7,col8,col9,col10,col11,col12,col13,col14,col15): |
|
import gradio as gr |
|
import pandas as pd |
|
import numpy as np |
|
df=pd.read_csv('/content/final_processed.csv') |
|
df.drop(['Unnamed: 0'], axis=1,inplace=True) |
|
from sklearn import preprocessing |
|
label_encoder = preprocessing.LabelEncoder() |
|
|
|
|
|
y={'academic time':col2,'task dedication':col3,'physical activity':col4,'favourite sport':col5,'family time':col6,'poor sleep':col7,'fitness':col8, |
|
'loss of concentration':col9,'eating habits':col10,'free time':col11,'motivation':col12,'social media':col13,'social media on academics':col14,'performance':col15} |
|
df=df.append(y,ignore_index=True) |
|
|
|
|
|
df['academic time']= label_encoder.fit_transform(df['academic time']) |
|
df['task dedication']= label_encoder.fit_transform(df['task dedication']) |
|
df['physical activity']= label_encoder.fit_transform(df['physical activity']) |
|
df['favorite sport']= label_encoder.fit_transform(df['favorite sport']) |
|
df['family time']= label_encoder.fit_transform(df['family time']) |
|
df['poor sleep']= label_encoder.fit_transform(df['poor sleep']) |
|
df['fitness']= label_encoder.fit_transform(df['fitness']) |
|
df['loss of concentration']= label_encoder.fit_transform(df['loss of concentration']) |
|
df['eating habits']= label_encoder.fit_transform(df['eating habits']) |
|
df['free time']= label_encoder.fit_transform(df['free time']) |
|
df['motivation']= label_encoder.fit_transform(df['motivation']) |
|
df['social media']= label_encoder.fit_transform(df['social media']) |
|
df['socail media on academics']= label_encoder.fit_transform(df['socail media on academics']) |
|
df['performance']= label_encoder.fit_transform(df['performance']) |
|
|
|
df.loc[df['academic time'] == 4, 'weight_academic'] =0.45 |
|
df.loc[df['academic time'] == 1, 'weight_academic'] =0.15 |
|
df.loc[df['academic time'] == 0, 'weight_academic'] =0.05 |
|
df.loc[df['academic time'] == 2, 'weight_academic'] =0.35 |
|
df.loc[df['academic time'] == 3, 'weight_academic'] =0.00 |
|
|
|
df.loc[df['task dedication'] == 0, 'weight_task'] =0.00 |
|
df.loc[df['task dedication'] == 1, 'weight_task'] =0.05 |
|
df.loc[df['task dedication'] == 2, 'weight_task'] =0.20 |
|
df.loc[df['task dedication'] == 3, 'weight_task'] =0.25 |
|
df.loc[df['task dedication'] == 4, 'weight_task'] =0.50 |
|
|
|
df.loc[df['physical activity'] == 0, 'weight_physic'] =0.00 |
|
df.loc[df['physical activity'] == 1, 'weight_physic'] =1.00 |
|
|
|
df.loc[df['favorite sport'] == 0, 'weight_play'] =0.20 |
|
df.loc[df['favorite sport'] == 1, 'weight_play'] =0.20 |
|
df.loc[df['favorite sport'] == 2, 'weight_play'] =0.20 |
|
df.loc[df['favorite sport'] == 3, 'weight_play'] =0.20 |
|
df.loc[df['favorite sport'] == 4, 'weight_play'] =0.00 |
|
df.loc[df['favorite sport'] == 5, 'weight_play'] =0.20 |
|
|
|
df.loc[df['family time'] == 3, 'weight_familytime'] =0.40 |
|
df.loc[df['family time'] == 2, 'weight_familytime'] =0.10 |
|
df.loc[df['family time'] == 1, 'weight_familytime'] =0.00 |
|
df.loc[df['family time'] == 0, 'weight_familytime'] =0.40 |
|
df.loc[df['family time'] == 4, 'weight_familytime'] =0.10 |
|
|
|
df.loc[df['poor sleep'] == 4, 'weight_sleep'] =0.00 |
|
df.loc[df['poor sleep'] == 3, 'weight_sleep'] =0.05 |
|
df.loc[df['poor sleep'] == 0, 'weight_sleep'] =0.00 |
|
df.loc[df['poor sleep'] == 2, 'weight_sleep'] =0.40 |
|
df.loc[df['poor sleep'] == 1, 'weight_sleep'] =0.55 |
|
|
|
df.loc[df['loss of concentration'] == 4, 'weight_conc'] =0.20 |
|
df.loc[df['loss of concentration'] == 0, 'weight_conc'] =0.05 |
|
df.loc[df['loss of concentration'] == 1, 'weight_conc'] =0.00 |
|
df.loc[df['loss of concentration'] == 3, 'weight_conc'] =0.75 |
|
df.loc[df['loss of concentration'] == 2, 'weight_conc'] =0.05 |
|
|
|
df.loc[df['eating habits'] == 4, 'weight_eating'] =0.20 |
|
df.loc[df['eating habits'] == 0, 'weight_eating'] =0.05 |
|
df.loc[df['eating habits'] == 1, 'weight_eating'] =0.00 |
|
df.loc[df['eating habits'] == 3, 'weight_eating'] =0.75 |
|
df.loc[df['eating habits'] == 2, 'weight_eating'] =0.05 |
|
|
|
df.loc[df['fitness'] == 2, 'weight_fit'] =0.60 |
|
df.loc[df['fitness'] == 0, 'weight_fit'] =0.10 |
|
df.loc[df['fitness'] == 1, 'weight_fit'] =0.30 |
|
df.loc[df['fitness'] == 3, 'weight_fit'] =0.00 |
|
|
|
df.loc[df['free time'] == 3, 'weight_time'] =0.50 |
|
df.loc[df['free time'] == 2, 'weight_time'] =0.10 |
|
df.loc[df['free time'] == 1, 'weight_time'] =0.20 |
|
df.loc[df['free time'] == 0, 'weight_time'] =0.20 |
|
|
|
df.loc[df['motivation'] == 3, 'weight_motivation'] =0.30 |
|
df.loc[df['motivation'] == 2, 'weight_motivation'] =0.25 |
|
df.loc[df['motivation'] == 1, 'weight_motivation'] =0.25 |
|
df.loc[df['motivation'] == 0, 'weight_motivation'] =0.20 |
|
|
|
df.loc[df['social media'] == 3, 'weight_media'] =0.00 |
|
df.loc[df['social media'] == 2, 'weight_media'] =0.65 |
|
df.loc[df['social media'] == 1, 'weight_media'] =0.10 |
|
df.loc[df['social media'] == 0, 'weight_media'] =0.25 |
|
|
|
|
|
df.loc[df['socail media on academics'] == 0, 'weight_media_academics'] =0.00 |
|
df.loc[df['socail media on academics'] == 1, 'weight_media_academics'] =1.00 |
|
|
|
df.loc[df['performance'] == 4, 'weight_performance']=0.55 |
|
df.loc[df['performance'] == 3, 'weight_performance']=0.00 |
|
df.loc[df['performance'] == 2, 'weight_performance']=0.30 |
|
df.loc[df['performance'] == 1, 'weight_performance']=0.10 |
|
df.loc[df['performance'] == 0, 'weight_performance']=0.05 |
|
|
|
df['total']=df.iloc[:,14:].sum(axis=1) |
|
|
|
|
|
df.loc[(df['weight_academic']<0.35) | (df['weight_task']<0.25),'academic value']=0 |
|
df.loc[(df['weight_academic']>=0.35) & (df['weight_task']>=0.25),'academic value']=1 |
|
df.inplace=1 |
|
|
|
df.loc[(df['weight_academic']<0.35) | (df['weight_time']<0.20),'time value']=0 |
|
df.loc[(df['weight_academic']>=0.35) & (df['weight_time']>=0.20),'time value']=1 |
|
df.inplace=1 |
|
|
|
df.loc[((df['weight_academic']<=0.35) & (df['weight_conc']>=0.20)) | ((df['weight_academic']>=0.35) & (df['weight_conc']>=0.20)),'productive value']=1 |
|
df.loc[((df['weight_academic']>=0.35) & (df['weight_conc']<0.20)) | ((df['weight_academic']<0.35) & (df['weight_conc']<0.20)),'productive value']=0 |
|
df.inplace=1 |
|
|
|
df.loc[(df['weight_physic']==1) & (df['weight_play']==0.2) & (df['weight_fit']>=0.3) & (df['weight_eating']>=0.20),'fitness_value']=1 |
|
df.loc[(df['weight_physic']!=1) | (df['weight_play']!=0.2) | (df['weight_fit']<0.3) | (df['weight_eating']<0.20),'fitness_value']=0 |
|
df.inplace=1 |
|
|
|
|
|
df.loc[(df['weight_sleep']>=0.40) & (df['weight_conc']>=0.20) ,'sleep value']=1 |
|
df.loc[(df['weight_sleep']<0.40) | (df['weight_conc']<0.20),'sleep value']=0 |
|
df.inplace=1 |
|
|
|
df.loc[(df['weight_familytime']==0.40) & (df['weight_motivation']==0.25) ,'motivation value']=1 |
|
df.loc[(df['weight_familytime']!=0.40) | (df['weight_motivation']!=0.25),'motivation value']=0 |
|
df.inplace=1 |
|
|
|
df.loc[(df['weight_performance']>=0.30) ,'performance_value']=1 |
|
df.loc[(df['weight_performance']<0.30),'performance_value']=0 |
|
df.inplace=1 |
|
|
|
df.loc[(df['weight_media']>=0.25) & (df['weight_media_academics']==0.00) ,'media_value']=1 |
|
df.loc[(df['weight_media']<0.25) | (df['weight_media_academics']!=0.00),'media_value']=0 |
|
df.inplace=1 |
|
|
|
df.loc[df['total']>=4.0,'overall']=1 |
|
df.loc[df['total']<4.0,'overall']=0 |
|
df.inplace=1 |
|
|
|
|
|
X = df[['academic time', |
|
'task dedication', |
|
'physical activity', |
|
'favorite sport', |
|
'family time', |
|
'poor sleep', |
|
'fitness', |
|
'loss of concentration', |
|
'eating habits', |
|
'free time', |
|
'motivation', |
|
'social media', |
|
'socail media on academics', |
|
'performance', |
|
'weight_academic', |
|
'weight_task', |
|
'weight_physic', |
|
'weight_play', |
|
'weight_familytime', |
|
'weight_sleep', |
|
'weight_conc', |
|
'weight_eating', |
|
'weight_fit', |
|
'weight_time', |
|
'weight_motivation', |
|
'weight_media', |
|
'weight_media_academics', |
|
'weight_performance', |
|
'total' |
|
]] |
|
y1 = df['academic value'] |
|
y2=df['time value'] |
|
y3=df['productive value'] |
|
y4=df['fitness_value'] |
|
y5=df['sleep value'] |
|
y6=df['motivation value'] |
|
y7=df['performance_value'] |
|
y8=df['media_value'] |
|
y9=df['overall'] |
|
from sklearn.model_selection import train_test_split |
|
X_train,X_test,y1_train,y1_test = train_test_split(X,y1,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y2_train,y2_test = train_test_split(X,y2,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y3_train,y3_test = train_test_split(X,y3,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y4_train,y4_test = train_test_split(X,y4,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y5_train,y5_test = train_test_split(X,y5,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y6_train,y6_test = train_test_split(X,y6,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y7_train,y7_test = train_test_split(X,y7,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y8_train,y8_test = train_test_split(X,y8,test_size=0.3,random_state = 0,shuffle = True) |
|
X_train,X_test,y9_train,y9_test = train_test_split(X,y9,test_size=0.3,random_state = 0,shuffle = True) |
|
from sklearn.ensemble import RandomForestClassifier as rfc |
|
import xgboost as xgb |
|
rfc1 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc2 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc3 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc4 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc5 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc6 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc7 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc8 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc9 = xgb.XGBClassifier(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1, |
|
max_depth = 5, alpha = 10, n_estimators = 10) |
|
rfc1.fit(X_train,y1_train) |
|
rfc2.fit(X_train,y2_train) |
|
rfc3.fit(X_train,y3_train) |
|
rfc4.fit(X_train,y4_train) |
|
rfc5.fit(X_train,y5_train) |
|
rfc6.fit(X_train,y6_train) |
|
rfc7.fit(X_train,y7_train) |
|
rfc8.fit(X_train,y8_train) |
|
rfc9.fit(X_train,y9_train) |
|
import random |
|
|
|
z=df.tail(1) |
|
|
|
|
|
|
|
|
|
if z['academic value'].eq(1).all(): |
|
a=['You are in the right track just try to stick on to your schedule','HARRRRRDDDD WORK always payys off you seem to be going in the right track', |
|
'The way is classiscal!! a tip for you is to listen to some classical music before studying ','You are driven by your own intrest keep riding', |
|
'Your study time is great ,now its to take a short break', |
|
'WOWWW you are just a just synonym of hard work and dedication ' ] |
|
res1="feedback on youe study schedule --> " +random.choice(a) |
|
if z['academic value'].eq(0).all(): |
|
b=['If you know your “WHY”, finding your “HOW" will not be difficult.you just need to start working','Focusing is about saying no.just learn to say no to things which distracts you .u just need to put a little more focus on your studytime', |
|
'Be the early bird that gets the first worm.set your body clock and start working','listen to directions,follow through assignments,learn for yourself.you just need to enjoy the process', |
|
'measure for progress not the time you are working ,try to put in more studytime','postponment will postpone you,finish your daily tasks when you have the time', |
|
'you are just off track,there is still time and sure that you will reach great heights ','you surely have the talent its now in your hands to make wonders!!!! talent without hardwork?? what do you think ','enroll yourself to a personalized learning environament which gives you a controll and education experience '] |
|
res1="feedback on youe study schedule --> "+random.choice(b) |
|
|
|
|
|
if z['time value'].eq(1).all(): |
|
c=['there is a saying give me 6 hours to chop a tree and i will spend the 1st hr sharpening the axe, the fact here is you have sharpenend your axe','your timimg is great you are managing time well' |
|
'its seems you hsve been studying long take a quick break and come back ','you are enjoying your time keep putting the same efforts you put','keep managing the time like the way you are doing now,this attribute will take care of the rest' |
|
,'you seem to stay organized and on track with your procative planning and systematic scheduling '] |
|
res2="Feedback on how you manage time --> "+random.choice(c) |
|
if z['time value'].eq(0).all(): |
|
d=['you have to start spending time on academics and show some interest in succeeding,you are the pilot who should stop time from flying and bring it on your control','start working and stick to a time table and set your body clock','try to be more organized and start spending quality time towards studies' |
|
'start learning to manage time and priortize on your academics','spend more time on your weak areas ,try to strech out for long hours','the biggest obstracle stopping you from winning is time management,prepare a timetable and stick to it', |
|
'play while you play and work while you work dont try to mix up things','dont try to procastinate finish your day to day jobs when and where you get time'] |
|
res2="Feedback on how you manage time --> "+random.choice(d) |
|
|
|
if z['productive value'].eq(1).all(): |
|
e=['you are smart,productive and have a good way of preparation in your studies','Be more proactive and try to participate in class,you are effiecient and can reach heights with your effectiveness','you have the ability to study things smartly and quickly,pick areas which are more brain-storming', |
|
'you have the ability to intepret things and your mind is sharp and you are a good listener','you are the master-mind,you are the person who shouldnt miss out in enrolling to IIts,NITs or whatever','you are productive person if u feel you are not delivering your 100% its not because because you arent studying,its something else'] |
|
res3="Feedback on your productivity --> "+random.choice(e) |
|
if z['productive value'].eq(0).all(): |
|
f=['Try to stick on to an approach which is convinient to you ,have a clear mind before you start working','start solving more,puzzles and a daily sudoko is a good start, you just need to be on your toes and tune your mind to solve various activities ','think!think!think analyse where you lack and start building strategies to improve yourself' |
|
'class participation its high time you start taking decisions and choose to be proactive','connect everything with what you are learining so that it will stick in your mind and helps you to recollect when and where you require','enjoy the process of learning dont be monotonous and a bookworm tame your mind to face your challenges','actively consult your instructor to enrich yourself with lot ways to improve your productivity', |
|
'rather than a brute-force approach try to think more of an optimal solution to a problem','gather a lot of resoruces and try to sit in your desk ,take mobile breaks(short one), an online chess game might be an eye opener for your next session '] |
|
res3="Feedback on your productivity --> "+random.choice(f) |
|
|
|
if z['fitness_value'].eq(1).all(): |
|
g=['fitness is your key ,if your body is strong your mind is stronger. Maintaining a good fitness is really important for your health as well as it empowers your learining ',' I can see you have spent time in maintaing your body. Keep winning more golds ','you have choosen to step out of your comfort zone and by trying to put some gains,this will surely be a stepping stone in other important sectors','your fitness level is reasonably good indicating that you are sticking to a schedule kind of person which is really good', |
|
'you are in a good shape which is a key for self_confidence and gives you a lot of motivation','you are a sportive person ,this will really help you to socialize and gives you a lot of energy to start new things ','you are an open-minded person ,this is really the best character one could ask for,half the problems are over if one is listening and able to make good decisions '] |
|
res4="Feedback on your fitness --> "+random.choice(g) |
|
if z['fitness_value'].eq(0).all(): |
|
h=['A weak body is a liability, you guys being the future generation should definetly be fit and healthy to lead the society at its best','your body should always get the first priority and should be taken care properly', |
|
'Any physical activity will make you disipline and gives you self confidence. Join your school team today ','out of all a hungry stomach isnt fit for a brisk study session ,being physically fit lets you do more activity even improve your academics ', |
|
'engage yourself in any physical activity for 20 mins as it can improve your concentration and helps your focus in learning ','out of your busy schedule try devoting just 15 mins get down do some pushups or squats or a brisk jog will do good '] |
|
res4="Feedback on your fitness --> "+random.choice(h) |
|
|
|
if z['sleep value'].eq(1).all(): |
|
i=['Good that you have a proper sleep, just stick to it and try finishing all your work in the day time and get enough rest','Its pretty impressive that you are giving enough importance to your sleep, shows that you have good time management skills and a sweet dream','getting a good sleep even during your stressed timetables shows that you stay at the moment', |
|
'a good fitness routine followed by a good-sleep is a good sunday schedule and a good starter for a hectic next week which i hope you would have experienced many times','its good that you have a good sleep everynight this is big boost for a bright tomorrow'] |
|
res5="Feedback on your sleep time --> "+random.choice(i) |
|
if z['sleep value'].eq(0).all(): |
|
|
|
j=['The time we sleep is only when we rest our mind, eyes and the whole body which is really crucial for a stduent',' Try not using any devices an hour before you sleep, have a good sleep cycle for atleast 6 to 7 hrs a day','Get enough rest, dont stress your body too much.', |
|
'Prioritize your sleep, dont have caffinated drinks late in the evening and getting good sleep will make you feel fresh and enegrytic all day long ', |
|
'a 7 - hour refresh will set your body clock for the rest of your day so please ensure that you get adequate rest','if you are sleep deprieved make sure you exhaust all your energy during the day and make sure you get a pleasant and peaceful sleep', |
|
'tests prove that sleep deprivation is a result for low academic performance make sure you dont fall under that','Please ensure that the extra miles which you are putting doesnt affect your sleep'] |
|
|
|
res5="Feedback on your sleep time --> "+random.choice(j) |
|
|
|
if z['motivation value'].eq(1).all(): |
|
k=['you are fairly motivated ,Motivation drives everyone to work better to achive something,it lits a light inside you ','you should be really proud that you have good motivation at a really young age,use it in areas where you feel a bit off', |
|
'None of the greatest achievers couldnt have done it without motivation and self motivation is really powerfull tool to success ,you are one among them Keep going!', |
|
'a good level of motivation gives you high spirits and a good attitude,your attitude builds YOU'] |
|
|
|
res6="motivation factor --> "+random.choice(k) |
|
if z['motivation value'].eq(0).all(): |
|
|
|
l=['Nobody in the world is born with motivation,in this modern era you cant expect external motivation,you better be your own motivation','messi took eighteen years to be the G.O.A.T ignoring all demotivation and insults its finally your time', |
|
'change your scenery sitting in a desk all-day makes you dull ,to renew interest,a new setting can be just what some students need to stay motivated to learn', |
|
'lay-out clear objectives before you start learning so that there is no confussion','Make your goals high but attainable dont be afraid to push yourself to get more out of them ', |
|
'Spend some quality time with your family listen to their experiences and try to dollow their footsteps'] |
|
|
|
|
|
res6="motivation factor --> "+random.choice(l) |
|
|
|
if z['performance_value'].eq(1).all(): |
|
m=['Good job you!! Your hardwork and efforts paid off, you have nothing to worry about ,you are academically strong','To be honest that grades made me a little jealous. I can see the work you are putting towards academics', |
|
'Give a big hit on boards make your parents and teachers proud, trust me that is super satisfying','academic performance gives you a lot of boost to you take that put in all other aspects which will give you overall developement', |
|
'the most satisfying thing is scoring high its great that you are easily doing it','you are almost sorted out you now just have to take care of the bits and pieces'] |
|
|
|
res7="Feedback on your performance --> "+random.choice(m) |
|
|
|
if z['performance_value'].eq(0).all(): |
|
n=['Its never late to begin. Divide your work, note important things mentioned in class spend more time in studies','Dont be ashamed to ask doubts we dont mind others judging. So we start from physics today? jk', |
|
'Start studying with your friends, seek help from teachers,Remember the hardwork you put never fails you','analyse where you are making errors if you find that you are making mistakes while writing try practicing the sample papers it will help you to an extent' |
|
,'you are almost there!!take short notes of the theoritical concepts so that it will be easy for reference','dont worry about where you are standing at the moment ,back yourself ,start it from scratch'] |
|
|
|
res7="Feedback on your performance --> "+random.choice(n) |
|
|
|
if z['media_value'].eq(1).all(): |
|
o=[' In the world of people being addicted to social media today, its happy to see someone like you','Its good that you are not scrolling too much','Having a good social profile is important and you having a limit is really impressive' |
|
,'Having the self control on yourself is really great but ensure that dont overdo on anything else','you are self-conscious which is really a great character to acquire'] |
|
|
|
res8="Feedback on your social media time --> "+random.choice(o) |
|
|
|
if z['media_value'].eq(0).all(): |
|
p=['Its really common for this generation people to get addicted to social media. All you have to do is keep track of the time, dont over do stuffs and you dont have to post a story everyday.', |
|
'Nothing wrong becoming a social idle, but right now concentrate in your studies','socially active is essential but over - scrolling will trap you in the matrix which you are unaware of', |
|
'stay in your limits socially active for more than a hour during high school is ill advised','knowing that its impacting you and using social media again !! what is that??'] |
|
|
|
res8="Feedback on your social media time --> "+random.choice(p) |
|
|
|
|
|
if z['overall'].eq(1).all(): |
|
q=['OMG!! Im thinking of getting a piece of advise from you you are almost there good that you equally participate in everything','You are an explorer and can learn new things easily,you are about to win the race', |
|
'Your works are impressing everyone right from your teacher,friends and your parents, You are active,brisk and have good potential to improve your performance', |
|
'You are doing great ,you are ready for new challenges and failures doesnt bother you ','You are multi tasker and ensure that you dont sink with over-confidence','Dont put yourself in any kind of pressure, eventhough you feel stressed time will answer to it and you will pass with flying colours' |
|
'You are growing with confidence, take it to learn new things,choose your core and find your destiny'] |
|
|
|
res9=random.choice(q) |
|
|
|
if z['overall'].eq(0).all(): |
|
|
|
r=['Its all good everyone goes out of form,the comeback is always on start putting consistent efforts','Put in the time, hardwork and you can already see it coming,you are just a few steps dowm','When we hit out lowest point we are open to the greatest change you are going to bring the best out of it. And yes that was said by Avatar Roku' |
|
,'Choose the right person whom you feel will take you through all the obstracles you need make things more clear','The best view comes after the hardest climb you can climb the moutain ahead of you','You just need to reboot and have a good set-up ,stay optimistic and everything will take care of itself if you take one step at a time', |
|
'You are nearing the pinacle of your true potential,just few changes hear and there you will be on your prime'] |
|
|
|
res9=random.choice(r) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "hi " + str (Name) + " this is a predictive model there may be some incorrect guesses so just take the points which you feel may work in your case \nalso if u feel the feeadbacks are harsh please flag your opinion \ntake your time to read this and hope u like it 😊\n\n\n"+ res1+" ,\n " + res2 +" ,\n " + res3 +" ,\n " + res4 +" ,\n " + res5 +" ,\n " + res6 +" ,\n " + res7 +" ,\n " + res8 +" ,\n\n\n " + res9 |
|
|
|
list(df.columns) |
|
|
|
df.isna().sum() |
|
|
|
demo = gr.Interface( |
|
assign_weights, |
|
[ |
|
"text", |
|
gr.Dropdown(['Science','Commerce'], label="Choose your stream"), |
|
gr.Radio(["<5", "5 - 12", "13 - 20", "20 - 30",">30"],label='On an average, how many hours a week do you spend on academics?'), |
|
gr.Radio(["0 - 20%", "20 - 40%", "40 - 60%", "60 - 80%","80 -100%"],label='How willing are you to work on a particular task ?'), |
|
gr.Radio(["Yes", "No", ],label='Do you take up any physical activity at regular intervals(at least 3 hours a week) ?'), |
|
gr.Radio(["Football", "Cricket", "Basketball", "Tennis" , "Chess" ,"Other","Not interested in sports"],label='Choose your favourite sport you follow or play'), |
|
gr.Radio(["Never", "Occasionally", "Sometimes", "Often" , "Always"],label='How often do you spend time with your friends and family?'), |
|
gr.Radio(["Always", "Very often", "Sometimes", "Rarely" ,"Never"],label='Has poor sleep troubled you in the last month?'), |
|
gr.Radio(["Perfect", "Good", "Average", "Poor"],label='What is your current level of fitness?'), |
|
gr.Radio(["Never", "Once in a while", "About half the time", "Most of the time","Always"],label='Do you feel kinda losing concentration during classes and other activities'), |
|
gr.Radio(["Never", "Once in a while", "About half the time", "Most of the time","Always"],label='is there a change in your eating habits(either under eating or overeating'), |
|
gr.Radio(["< 2", "2 - 5", "5 - 8", "> 8"],label='How many hours of free time do you have after school?'), |
|
gr.Radio(["Asking a lot of questions to the teacher", "Completing various assignments", "Sports and other extracurricular activities", "Other"],label='What motivates you to learn more?'), |
|
gr.Radio(["<30 mins", "30 - 60", "60 - 120", ">120 mins"],label='How long you spend your time on social media on a daily basis? '), |
|
gr.Radio(["Yes", "No"],label='Do you feel that spending time on social media has been a reason for the deterioration in your academic performance?'), |
|
gr.Radio(["<30%", "30% - 50%", "50% - 70%", "70% - 90%",">90%"],label='How much you score in your academics'), |
|
], |
|
"text", |
|
|
|
title="Performance predictor and feedback generator", |
|
description="Here's a sample performance calculator. Enjoy!", |
|
|
|
) |
|
demo.launch(share=True, debug=True) |
|
|
|
|