How to understand weight variable here?what is it for?redm_flag=0 means negative samples.
proc surveyselect data=lg.develop_original(where=( redm_flag =0)) noprint
method=srs rate=0.1 out=lg.develop_sury ;
run;
data lg.develop_final;
set lg.develop_ original(where=( redm_flag =1)) lg.develop_sury;
if redm_flag=1 then weight=1;
else weight=10;
run;
proc freq data= lg.develop_final;
weight weight;
table redm_flag/missing;
run;
The first proceu\dure extracts 1/10th of the observations where redm_flag=0. Each observation gets a weight of 10 to indicate that it represents 10 observations.
The DATA step merges that sample with all observations where redm_flag=1. Those observations get a weight of 1 to indicate that they represent 1 obs.
The PROC FREQ step estimates the proportions from the weighted sample.
The first proceu\dure extracts 1/10th of the observations where redm_flag=0. Each observation gets a weight of 10 to indicate that it represents 10 observations.
The DATA step merges that sample with all observations where redm_flag=1. Those observations get a weight of 1 to indicate that they represent 1 obs.
The PROC FREQ step estimates the proportions from the weighted sample.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.