Showing posts with label Predict. Show all posts
Showing posts with label Predict. Show all posts

December 30, 2012

Predict and model estimation

Short summary

For study and to estimate a good model we need a scientific approach in segment values to construct the model and values to tes the model.
For certain method as neural network , we need to add some validation values to stop and find the stability of the engine.

Our exercise is to try to extract from the existing data , a stable model to predict the value of the violent crimes for 100k habitant .The typology of the violent crimes is large each county communities and countries have their proper approach. We can include murders, sexual acts, ...
More approach is considered on my study by regression , SVM and neural network.


The values segmentation

The data are cut as this:

  • 1094 values for the model estimation
  • 401 values for the validation of the model
  • 101 values to verify and test the precision of the model


The first strategies

The data are really hard to be separated , it s why in ours strategies the classification could be short.

The first analysis should permit to estimate models in a classical manner.
A first good point to compare with strategy of data reduction.
A second analysis should cut the data in more than 2 classes and models. Yes , to have a more accuracy estimation we can cut our model and use a SVM for automatic classification on new values.
A third approach is to remove unnecessary data as extrema or non connected individuals or variables.
The last study should mix these strategies.    

November 19, 2012

Predict - Likelihood


I introduce a semi parametric estimation . This method is really important. It s a statistical approach that not permit to have model but an estimation of this model. 
We know two things in our analysis: 
  • the first is the probability of the interconnection of Y (in our case the violent crimes ) and X (all our variables).
  • the second is the probability to know of all of our variables  

The conditionnal probability of knowing the violent crimes (Y) giving our 99 variables(X) is: 
The result estimation is


RMSE= 0.13475


Predict - Full Linear regression

The first approach is purely linear. Based on the linear regression, we can identify some regressive values.
The first result is correct for this estimation.


99 regressive values
Variable Regressive value
'population' 0.0037
'householdsize' 0.0043
'racepctblack' 0.2753
'racePctWhite' -0.0102
'racePctAsian' -0.0033
'racePctHisp' 0.0135
'agePct12t21' 0.0023
'agePct12t29' -0.007
'agePct16t24' -0.0033
'agePct65up' 0.0142
'numbUrban' 0.0036
'pctUrban' 0.0344
'medIncome' 0.0026
'pctWWage' -0.0061
'pctWFarmSelf' 0.0072
'pctWInvInc' -0.0124
'pctWSocSec' 0.0127
'pctWPubAsst' 0.0369
'pctWRetire' -0.0105
'medFamInc' 0.0002
'perCapInc' 0.0027
'whitePerCap' 0.0032
'blackPerCap' -0.0021
'indianPerCap' -0.0028
'AsianPerCap' 0.0155
'HispPerCap' 0.006
'NumUnderPov' 0.005
'PctPopUnderPov' 0
'PctLess9thGrade' -0.0025
'PctNotHSGrad' 0.0076
'PctBSorMore' -0.0049
'PctUnemployed' 0.0003
'PctEmploy' 0.0028
'PctEmplManu' -0.0042
'PctEmplProfServ' -0.0013
'PctOccupManu' 0.0058
'PctOccupMgmtProf' -0.0025
'MalePctDivorce' 0.123
'MalePctNevMarr' 0.0136
'FemalePctDiv' 0.0191
'TotalPctDiv' 0.0462
'PersPerFam' 0.008
'PctFam2Par' -0.0207
'PctKids2Par' -0.0355
'PctYoungKids2Par' -0.0448
'PctTeen2Par' -0.0131
'PctWorkMomYoungKids' -0.0078
'PctWorkMom' -0.0277
'NumIlleg' 0.0053
'PctIlleg' 0.1186
'NumImmig' -0.0012
'PctImmigRecent' -0.0027
'PctImmigRec5' 0.0004
'PctImmigRec8' -0.0005
'PctImmigRec10' 0.0006
'PctRecentImmig' 0.0054
'PctRecImmig5' 0.0111
'PctRecImmig8' 0.0123
'PctRecImmig10' 0.0205
'PctSpeakEnglOnly' 0.0031
'PctNotSpeakEnglWell' 0.0038
'PctLargHouseFam' 0.0082
'PctLargHouseOccup' 0.0046
'PersPerOccupHous' 0.0083
'PersPerOwnOccHous' -0.0001
'PersPerRentOccHous' 0.0136
'PctPersOwnOccup' -0.0031
'PctPersDenseHous' 0.0809
'PctHousLess3BR' 0.0713
'MedNumBR' -0.0067
'HousVacant' 0.1062
'PctHousOccup' -0.0285
'PctHousOwnOcc' 0.0015
'PctVacantBoarded' 0.0292
'PctVacMore6Mos' -0.0105
'MedYrHousBuilt' 0.0024
'PctHousNoPhone' 0.0181
'PctWOFullPlumb' -0.0097
'OwnOccLowQuart' 0.0001
'OwnOccMedVal' 0.0034
'OwnOccHiQuart' 0.0033
'RentLowQ' -0.0072
'RentMedian' 0.0033
'RentHighQ' 0.0072
'MedRent' 0.0077
'MedRentPctHousInc' 0.0389
'MedOwnCostPctInc' 0.0086
'MedOwnCostPctIncNoMtg' -0.0336
'NumInShelters' 0.0126
'NumStreet' 0.0821
'PctForeignBorn' 0.0174
'PctBornSameState' -0.0033
'PctSameHouse85' 0.0018
'PctSameCity85' 0.0357
'PctSameState85' 0.005
'LandArea' 0.0105
'PopDens' 0.0146
'PctUsePubTrans' -0.0064
'LemasPctOfficDrugUn' 0.0094

RMSE=0.13499