خرید بک لینک

Vote count: 0

my current dataset includes around 28,000 observations and 35 features. My X matrix includes the first 34 features, my y Matrix includes the last feature or 35th feature (I've labled it HighLowMobility in the code below) I've constructed a neural network to classify high vs low, however the accuracy of my algorithm is 12% due to missing data points. I'm ruing into the issue that some of my features are missing a lot of data points. One way I went around it is by filling in the mean for the missing values. This increased the accuracy of the algorithm to 56%

#loading the data into data frame
X = pd.read_csv('raw_data_for_edits.csv')
#Impute the missing values with mean values,.
X = X.fillna(X.mean())
#Dropping the categorical values
X = X.drop(['county_name','statename','stateabbrv'],axis=1)
#Collect the output in y variable
y = X['HighLowMobility']

I can't copy and paste my entire data set because its too large, however I paste the first 12 rows and 15 features:

 birthcohort    countyfipscode  county_name cty_pop2000 statename   state_id    stateabbrv  perm_res_p25_kr24   perm_res_p75_kr24   perm_res_p25_c1823  perm_res_p75_c1823  perm_res_p25_c19    perm_res_p75_c19    perm_res_p25_kr26   perm_res_p75_kr26
1980    1001    Autauga 43671   Alabama 1   AL  45.29939    60.7061             20.79255    66.0626 40.33072    61.38815
1981    1001    Autauga 43671   Alabama 1   AL  42.61835    63.21074    29.72325    75.26598    18.54342    54.94438    39.72811    65.40214
1982    1001    Autauga 43671   Alabama 1   AL  48.26985    62.34378    38.06422    72.25443    21.53552    59.08011    44.65976    63.69386
1983    1001    Autauga 43671   Alabama 1   AL  42.63371    56.42043    38.25876    80.4664 15.57722    57.13945    40.6005 61.02879
1984    1001    Autauga 43671   Alabama 1   AL  44.01634    62.27992    38.12383    73.74701    23.0881 55.17943    43.34503    62.40761
1985    1001    Autauga 43671   Alabama 1   AL  45.71784    61.31874    40.93386    83.06611    25.66557    72.2912 42.42057    62.00612
1986    1001    Autauga 43671   Alabama 1   AL  47.92037    59.65535    47.48409    72.49103    28.89066    63.85233    42.06915    59.60703
1987    1001    Autauga 43671   Alabama 1   AL  48.31079    54.04203    53.19901    84.53795    35.28359    71.83407        
1988    1001    Autauga 43671   Alabama 1   AL  47.98552    59.42001    52.89273    85.28442    30.55523    67.43595        
1980    1003    Baldwin 140415  Alabama 1   AL  42.46106    51.41415            19.86316    58.6601 41.89684    55.88935
1981    1003    Baldwin 140415  Alabama 1   AL  43.00288    55.10138    35.59233    76.98567    11.48056    40.79744    42.46521    57.31494

Notice how the feature "perm_res_p25_c1823" is missing values. This becomes problematic as far as the accuracy of my algorithm. Therefore, what should I do as far as missing values and how would I code it?

asked 52 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 9 ارديبهشت 1395 ساعت: 2:47

صفحه بندی