היי, יש לי כמה מודלים שבניתי ב R ואני רוצה לדעת איך להשתמש בהם.
אני רוצה לקבל נתונים דרך קובץ ROLLOUT.CSV , להריץ את המודל שבניתי ושההחלטה לגבי המשתנה התלוי BUYER_FLAG תודפס לקובץ טקסט
דוגמא 1 (רגרסיה לוגיסטית)
mdl <- glm(formula = BUYER_FLAG ~ . , family= "binomial", data = ds_tr (
y_hat = predict(mdl, data = ds_tr , type = 'response('
אני מניחה שהקריאה של הנתונים תהיה באופן הבא:
ds = read.csv(file_path, na.strings="")
ואז את ds אני אתן בתור newdata
y_hat = predict(mdl, newdata = ds, type = 'response')
y = (ds_te$BUYER_FLAG == 1)
cutoff= (y_hat > 0.5)
איך אני שופכת את התוצאות לקובץ טקסט? תודה!
write.csv או write.table יעשו את העבודה
--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This email has been sent from a virus-free computer protected by Avast. www.avast.com |