@sid100158 wrote:
I am currently trying to solve one classification problem in which I am trying to replace the level of the Dependent variable(Loan_Status) plyr packages in R, but my level is not changing.
'data.frame': 614 obs. of 11 variables: ** $ Loan_Status : Factor w/ 2 levels "N","Y": 2 1 2 2 2 2 2 1 2 1 ...** $ Credit_History : int 1 1 1 1 1 1 1 0 1 1 ... $ Property_Area : Factor w/ 3 levels "Rural","Semiurban",..: 3 1 3 3 3 3 3 2 3 2 ... $ CoapplicantIncome: num 0 1508 0 2358 0 ... $ ApplicantIncome : num 5849 4583 3000 2583 6000 ... $ LoanAmount : num 142 128 66 120 141 ... $ Married : Factor w/ 2 levels "No","Yes": 1 2 2 2 1 2 2 2 2 2 ... $ Education : Factor w/ 2 levels "Graduate","Not Graduate": 1 1 1 2 1 1 2 1 1 1 ... $ Dependents : Factor w/ 4 levels "0","1","2","3+": 1 2 1 1 1 3 1 4 3 2 ... $ Gender : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 2 2 2 2 2 ... $ Self_Employed : Factor w/ 2 levels "No","Yes": 1 1 2 1 1 2 1 1 1 1 ... library(plyr) train_final$Loan_Status<-as.numeric(revalue(train_final$Loan_Status,c("N"=0,"Y"=1))) str(train_final) 'data.frame': 614 obs. of 11 variables: $ Loan_Status : num 2 1 2 2 2 2 2 1 2 1 ... $ Credit_History : int 1 1 1 1 1 1 1 0 1 1 ... $ Property_Area : Factor w/ 3 levels "Rural","Semiurban",..: 3 1 3 3 3 3 3 2 3 2 ... $ CoapplicantIncome: num 0 1508 0 2358 0 ... $ ApplicantIncome : num 5849 4583 3000 2583 6000 ... $ LoanAmount : num 142 128 66 120 141 ... $ Married : Factor w/ 2 levels "No","Yes": 1 2 2 2 1 2 2 2 2 2 ... $ Education : Factor w/ 2 levels "Graduate","Not Graduate": 1 1 1 2 1 1 2 1 1 1 ... $ Dependents : Factor w/ 4 levels "0","1","2","3+": 1 2 1 1 1 3 1 4 3 2 ... $ Gender : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 2 2 2 2 2 ... $ Self_Employed : Factor w/ 2 levels "No","Yes": 1 1 2 1 1 2 1 1 1 1 ...
Posts: 3
Participants: 3