import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report,confusion_matrix, accuracy_score
#from sklearn.metrics import roc_curve, auc, roc_auc_score, classification_report, confusion_matrix, accuracy_score
# 2. Load the dataset into python environment
df = pd.read_csv(r"C:\Users\HAPPY\OneDrive\Desktop\group 6.csv")
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 148 entries, 0 to 147 Data columns (total 31 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Name 148 non-null object 1 Mobile 2:- 148 non-null object 2 Age group 148 non-null object 3 Gender 148 non-null int64 4 Location 148 non-null int64 5 Education level 148 non-null int64 6 Level of Employment 148 non-null int64 7 Occupation 148 non-null int64 8 5GBenefits_Understanding 148 non-null int64 9 Impact_education 148 non-null int64 10 Impact_Enterpreneurship 148 non-null int64 11 Impact_Safety&Wellbeing 148 non-null int64 12 Internet_Accessibility 148 non-null int64 13 Usage_Onlinelearning 148 non-null int64 14 Leveraging5g_Womenempowered 148 non-null int64 15 Enhanced access to education 148 non-null int64 16 Improved economic opportunities 148 non-null int64 17 Increasedparticipation_civiclife 148 non-null int64 18 Improvedeconomic_participation&enterpreneurship 148 non-null int64 19 Enhancedsafety&security 148 non-null int64 20 Improved health care & telemedicine 148 non-null int64 21 Barriers_Technology Access 148 non-null int64 22 Barriers_5Gaccess 148 non-null int64 23 Barriers_Digitalliteracy 148 non-null int64 24 Barriers_Discrimination&Violence 148 non-null int64 25 Barriers_Dataprivacy&Datasecurity_Concerns 148 non-null int64 26 Criticalbarrier_Womenempowerment 148 non-null int64 27 Addressing_Gendergap 148 non-null int64 28 Yourview_Overcomebarriers 148 non-null int64 29 Future_5GImpact 148 non-null int64 30 Recommendations 148 non-null int64 dtypes: int64(28), object(3) memory usage: 36.0+ KB
df.describe()
Gender | Location | Education level | Level of Employment | Occupation | 5GBenefits_Understanding | Impact_education | Impact_Enterpreneurship | Impact_Safety&Wellbeing | Internet_Accessibility | ... | Barriers_Technology Access | Barriers_5Gaccess | Barriers_Digitalliteracy | Barriers_Discrimination&Violence | Barriers_Dataprivacy&Datasecurity_Concerns | Criticalbarrier_Womenempowerment | Addressing_Gendergap | Yourview_Overcomebarriers | Future_5GImpact | Recommendations | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | ... | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 | 148.000000 |
mean | 1.540541 | 1.148649 | 3.472973 | 2.500000 | 1.844595 | 1.081081 | 1.689189 | 1.290541 | 1.324324 | 1.216216 | ... | 1.756757 | 1.885135 | 1.972973 | 2.054054 | 1.824324 | 1.804054 | 1.506757 | 1.655405 | 1.540541 | 1.337838 |
std | 0.513470 | 0.471859 | 0.611076 | 0.922139 | 0.878409 | 0.273886 | 0.823559 | 0.702313 | 0.721075 | 0.600912 | ... | 0.854135 | 0.907442 | 0.961475 | 1.067668 | 0.945568 | 0.846431 | 0.812292 | 0.994631 | 0.759326 | 0.733587 |
min | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | ... | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
25% | 1.000000 | 1.000000 | 3.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | ... | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
50% | 2.000000 | 1.000000 | 3.000000 | 3.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | ... | 1.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
75% | 2.000000 | 1.000000 | 4.000000 | 3.000000 | 3.000000 | 1.000000 | 2.000000 | 1.000000 | 1.000000 | 1.000000 | ... | 3.000000 | 3.000000 | 3.000000 | 3.000000 | 3.000000 | 2.000000 | 2.000000 | 3.000000 | 2.000000 | 1.000000 |
max | 3.000000 | 3.000000 | 5.000000 | 4.000000 | 3.000000 | 2.000000 | 5.000000 | 3.000000 | 3.000000 | 3.000000 | ... | 3.000000 | 5.000000 | 5.000000 | 5.000000 | 4.000000 | 4.000000 | 3.000000 | 4.000000 | 5.000000 | 3.000000 |
8 rows × 28 columns
df.corr()
Gender | Location | Education level | Level of Employment | Occupation | 5GBenefits_Understanding | Impact_education | Impact_Enterpreneurship | Impact_Safety&Wellbeing | Internet_Accessibility | ... | Barriers_Technology Access | Barriers_5Gaccess | Barriers_Digitalliteracy | Barriers_Discrimination&Violence | Barriers_Dataprivacy&Datasecurity_Concerns | Criticalbarrier_Womenempowerment | Addressing_Gendergap | Yourview_Overcomebarriers | Future_5GImpact | Recommendations | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gender | 1.000000 | -1.092737e-01 | -0.039846 | -5.746869e-02 | 0.112099 | 0.073212 | -0.018261 | 0.014276 | 0.092860 | 0.103682 | ... | 0.162237 | 0.061162 | -0.080442 | -0.140522 | -0.055287 | 0.057532 | 0.186904 | 0.087480 | -4.244044e-03 | -0.054668 |
Location | -0.109274 | 1.000000e+00 | -0.033157 | 1.497073e-16 | -0.058774 | 0.011381 | -0.107872 | -0.131211 | -0.062682 | -0.018156 | ... | 0.022809 | -0.055176 | -0.021073 | -0.029561 | -0.047801 | -0.062836 | -0.109128 | -0.122029 | 5.901165e-02 | -0.067456 |
Education level | -0.039846 | -3.315708e-02 | 1.000000 | -7.243395e-02 | -0.001541 | 0.013182 | -0.084392 | -0.100461 | -0.041726 | -0.039555 | ... | 0.026419 | 0.135444 | -0.024409 | 0.054388 | 0.038820 | -0.056341 | -0.075006 | 0.012554 | -2.694424e-02 | -0.070544 |
Level of Employment | -0.057469 | 1.497073e-16 | -0.072434 | 1.000000e+00 | -0.062987 | -0.026935 | 0.017915 | -0.078780 | -0.071615 | -0.012277 | ... | -0.086369 | 0.012194 | -0.015345 | -0.041457 | 0.085820 | -0.265824 | -0.059032 | -0.025959 | -8.521090e-17 | 0.150843 |
Occupation | 0.112099 | -5.877427e-02 | -0.001541 | -6.298695e-02 | 1.000000 | -0.088648 | -0.020205 | 0.084714 | -0.059506 | -0.026124 | ... | 0.121546 | -0.014012 | 0.003048 | -0.019996 | -0.008522 | 0.031961 | 0.111122 | 0.101799 | -9.757952e-02 | -0.012982 |
5GBenefits_Understanding | 0.073212 | 1.138119e-02 | 0.013182 | -2.693493e-02 | -0.088648 | 1.000000 | 0.353757 | 0.301086 | 0.279287 | 0.182090 | ... | 0.172119 | 0.119841 | 0.111710 | 0.077964 | 0.029107 | 0.186375 | 0.089253 | -0.046569 | 8.221761e-02 | 0.133602 |
Impact_education | -0.018261 | -1.078719e-01 | -0.084392 | 1.791519e-02 | -0.020205 | 0.353757 | 1.000000 | 0.557075 | 0.503106 | 0.315415 | ... | 0.230269 | 0.325113 | 0.367328 | 0.313229 | 0.374925 | 0.146250 | 0.247215 | 0.042758 | 3.683907e-01 | 0.343885 |
Impact_Enterpreneurship | 0.014276 | -1.312106e-01 | -0.100461 | -7.878019e-02 | 0.084714 | 0.301086 | 0.557075 | 1.000000 | 0.417148 | 0.349828 | ... | 0.300059 | 0.127441 | 0.162822 | 0.242009 | 0.169576 | 0.199411 | 0.372157 | 0.173516 | 1.117035e-01 | 0.349545 |
Impact_Safety&Wellbeing | 0.092860 | -6.268249e-02 | -0.041726 | -7.161503e-02 | -0.059506 | 0.279287 | 0.503106 | 0.417148 | 1.000000 | 0.496450 | ... | 0.195233 | 0.182078 | 0.140287 | 0.074272 | 0.153973 | 0.071393 | 0.274975 | 0.071523 | 1.621883e-01 | 0.177263 |
Internet_Accessibility | 0.103682 | -1.815579e-02 | -0.039555 | -1.227652e-02 | -0.026124 | 0.182090 | 0.315415 | 0.349828 | 0.496450 | 1.000000 | ... | 0.195943 | 0.095757 | 0.069054 | 0.140707 | 0.067304 | 0.016989 | 0.401150 | 0.011689 | 2.937438e-01 | 0.249830 |
Usage_Onlinelearning | 0.005448 | -3.476308e-02 | 0.009780 | 5.102071e-03 | -0.050593 | 0.295276 | 0.589035 | 0.295391 | 0.370323 | 0.311909 | ... | 0.189664 | 0.384439 | 0.343856 | 0.323709 | 0.337134 | 0.172086 | 0.266042 | 0.106174 | 4.250150e-01 | 0.311832 |
Leveraging5g_Womenempowered | 0.008232 | -1.081091e-01 | 0.007155 | 4.093647e-02 | 0.065457 | 0.011175 | 0.224758 | 0.209499 | 0.136639 | 0.139222 | ... | 0.222856 | 0.068021 | 0.099897 | 0.153439 | 0.081386 | 0.107534 | 0.204460 | 0.099425 | 1.263003e-01 | 0.138679 |
Enhanced access to education | -0.077752 | -1.569350e-02 | 0.115035 | 1.421028e-01 | -0.103789 | 0.172411 | 0.328259 | 0.166487 | 0.228907 | 0.306471 | ... | -0.044982 | 0.262494 | 0.275480 | 0.344377 | 0.245952 | 0.075505 | 0.165349 | 0.023792 | 3.762381e-01 | 0.298882 |
Improved economic opportunities | -0.069022 | 6.226734e-02 | -0.014406 | 6.880759e-02 | -0.008264 | 0.204534 | 0.393271 | 0.211537 | 0.240358 | 0.257981 | ... | 0.021148 | 0.274586 | 0.276812 | 0.341367 | 0.277237 | 0.088266 | 0.186274 | -0.047988 | 4.992588e-01 | 0.233609 |
Increasedparticipation_civiclife | 0.029932 | 9.369747e-03 | 0.055469 | -5.533357e-17 | -0.121755 | 0.169112 | 0.449668 | 0.221531 | 0.300147 | 0.235790 | ... | 0.092679 | 0.345459 | 0.294514 | 0.337786 | 0.352460 | 0.122375 | 0.135813 | -0.041276 | 4.203314e-01 | 0.202903 |
Improvedeconomic_participation&enterpreneurship | 0.059663 | 7.631861e-02 | 0.017762 | -2.849168e-02 | 0.050755 | 0.196300 | 0.445521 | 0.238685 | 0.319064 | 0.342688 | ... | 0.083611 | 0.227657 | 0.194764 | 0.317150 | 0.223466 | 0.020913 | 0.210365 | -0.025956 | 4.753266e-01 | 0.206454 |
Enhancedsafety&security | -0.000850 | 5.362501e-02 | 0.048904 | -4.376201e-02 | -0.169608 | 0.262028 | 0.461398 | 0.148774 | 0.207825 | 0.260273 | ... | -0.034732 | 0.217787 | 0.266123 | 0.284193 | 0.277982 | 0.062881 | 0.092646 | -0.028730 | 5.521369e-01 | 0.277429 |
Improved health care & telemedicine | 0.062503 | 4.108265e-02 | 0.073668 | -1.343297e-17 | 0.047447 | 0.117964 | 0.343137 | 0.210235 | 0.201330 | 0.315786 | ... | 0.101122 | 0.221814 | 0.104842 | 0.356071 | 0.279955 | 0.096062 | 0.150481 | 0.070272 | 4.201022e-01 | 0.161781 |
Barriers_Technology Access | 0.162237 | 2.280931e-02 | 0.026419 | -8.636942e-02 | 0.121546 | 0.172119 | 0.230269 | 0.300059 | 0.195233 | 0.195943 | ... | 1.000000 | 0.323556 | 0.257015 | 0.290524 | 0.216265 | 0.150043 | 0.247508 | 0.357089 | 1.621519e-01 | 0.305753 |
Barriers_5Gaccess | 0.061162 | -5.517631e-02 | 0.135444 | 1.219435e-02 | -0.014012 | 0.119841 | 0.325113 | 0.127441 | 0.182078 | 0.095757 | ... | 0.323556 | 1.000000 | 0.542205 | 0.399654 | 0.333089 | 0.236199 | 0.181024 | 0.166885 | 2.684303e-01 | 0.150662 |
Barriers_Digitalliteracy | -0.080442 | -2.107335e-02 | -0.024409 | -1.534540e-02 | 0.003048 | 0.111710 | 0.367328 | 0.162822 | 0.140287 | 0.069054 | ... | 0.257015 | 0.542205 | 1.000000 | 0.471940 | 0.488593 | 0.152269 | 0.165731 | 0.125351 | 2.996824e-01 | 0.312022 |
Barriers_Discrimination&Violence | -0.140522 | -2.956086e-02 | 0.054388 | -4.145732e-02 | -0.019996 | 0.077964 | 0.313229 | 0.242009 | 0.074272 | 0.140707 | ... | 0.290524 | 0.399654 | 0.471940 | 1.000000 | 0.541800 | 0.222572 | 0.093703 | 0.043284 | 3.748772e-01 | 0.245776 |
Barriers_Dataprivacy&Datasecurity_Concerns | -0.055287 | -4.780065e-02 | 0.038820 | 8.581958e-02 | -0.008522 | 0.029107 | 0.374925 | 0.169576 | 0.153973 | 0.067304 | ... | 0.216265 | 0.333089 | 0.488593 | 0.541800 | 1.000000 | 0.169188 | 0.081267 | 0.079858 | 3.036998e-01 | 0.292091 |
Criticalbarrier_Womenempowerment | 0.057532 | -6.283611e-02 | -0.056341 | -2.658241e-01 | 0.031961 | 0.186375 | 0.146250 | 0.199411 | 0.071393 | 0.016989 | ... | 0.150043 | 0.236199 | 0.152269 | 0.222572 | 0.169188 | 1.000000 | 0.165192 | 0.250545 | 2.832017e-02 | 0.052558 |
Addressing_Gendergap | 0.186904 | -1.091284e-01 | -0.075006 | -5.903202e-02 | 0.111122 | 0.089253 | 0.247215 | 0.372157 | 0.274975 | 0.401150 | ... | 0.247508 | 0.181024 | 0.165731 | 0.093703 | 0.081267 | 0.165192 | 1.000000 | 0.091311 | 1.374173e-01 | 0.292962 |
Yourview_Overcomebarriers | 0.087480 | -1.220294e-01 | 0.012554 | -2.595927e-02 | 0.101799 | -0.046569 | 0.042758 | 0.173516 | 0.071523 | 0.011689 | ... | 0.357089 | 0.166885 | 0.125351 | 0.043284 | 0.079858 | 0.250545 | 0.091311 | 1.000000 | -7.595304e-02 | 0.216577 |
Future_5GImpact | -0.004244 | 5.901165e-02 | -0.026944 | -8.521090e-17 | -0.097580 | 0.082218 | 0.368391 | 0.111704 | 0.162188 | 0.293744 | ... | 0.162152 | 0.268430 | 0.299682 | 0.374877 | 0.303700 | 0.028320 | 0.137417 | -0.075953 | 1.000000e+00 | 0.353831 |
Recommendations | -0.054668 | -6.745595e-02 | -0.070544 | 1.508432e-01 | -0.012982 | 0.133602 | 0.343885 | 0.349545 | 0.177263 | 0.249830 | ... | 0.305753 | 0.150662 | 0.312022 | 0.245776 | 0.292091 | 0.052558 | 0.292962 | 0.216577 | 3.538306e-01 | 1.000000 |
28 rows × 28 columns
df.skew()
Gender -0.011386 Location 3.210881 Education level -0.348940 Level of Employment -0.316596 Occupation 0.309666 5GBenefits_Understanding 3.100975 Impact_education 1.079114 Impact_Enterpreneurship 2.033905 Impact_Safety&Wellbeing 1.850042 Internet_Accessibility 2.544745 Usage_Onlinelearning 1.523094 Leveraging5g_Womenempowered 0.496473 Enhanced access to education 1.566017 Improved economic opportunities 1.210598 Increasedparticipation_civiclife 0.819735 Improvedeconomic_participation&enterpreneurship 1.326348 Enhancedsafety&security 1.090124 Improved health care & telemedicine 1.244709 Barriers_Technology Access 0.491229 Barriers_5Gaccess 0.783844 Barriers_Digitalliteracy 0.752738 Barriers_Discrimination&Violence 0.775139 Barriers_Dataprivacy&Datasecurity_Concerns 0.750993 Criticalbarrier_Womenempowerment 0.728036 Addressing_Gendergap 1.135891 Yourview_Overcomebarriers 0.948872 Future_5GImpact 1.373195 Recommendations 1.783735 dtype: float64
np.mean(df.Impact_education)
1.6891891891891893
np.median(df.Impact_education)
1.0
std_deviation=np.std(df.Impact_education)
print(std_deviation)
0.8207721426519031
plt.figure(figsize=(30,25))
sns.heatmap(df.corr(),annot=True)
<Axes: >
df1=df[["Gender","Education level","Occupation"]]
sns.pairplot(df1)
<seaborn.axisgrid.PairGrid at 0x1de145f18d0>