Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Would Appreciate Some Help with Bagging

Reply
Occasional Contributor
Posts: 6

Would Appreciate Some Help with Bagging

Hi All,

I am struggling on something at the moment and am hoping that there is someone out there that can help.

In EM, I am using Bagging With Replacement.

I have 'created 100 samples' and modelled a logistic regression to each and obtained Bagged Estimates via the Ensemble node.

There is only one target and only one input so for the 100 models, the parameters are the same in each model, the estimates are different.

I am really happy with the results.

I now wish to document the level of vairation that was found in each of the 100 samples.

My problem is that I have no idea how to 'get' the 100 samples.

They are not present in any of the libraries.

I looked at the log but could not find anything there that could help.

I found a macro 'dmbag.sas' in my program root directory but that does not seem to give me what I am after.

To be honest I am not sure what the purpose of the macro is.

For example, I inserted the following:

%DMBAG(_TRA=TEST2,_TRAIN=TEST1,_SEED= 12345, _FREQ=,_SUMFREQ=14844, _SIZE=14844,_LOOP= 100)

My sample is unweighted (no freq field) and I have 14,844 records in my sample.

The output was a dataset of 9,333 records.

A new field was created, _resamp_.

The Proc Freq for _resamp_ is

1 5365
2 2784
3 900
4 218
5 57
6 9

I am not sure if this macro does what I want it to do, it says it "PURPOSE: SELECT A BOOTSTRAP SAMPLE"

So, is there a way that I can create the 100 samples??

I am in dire need of those samples.


I would be really grateful for any help here.
SAS Employee
Posts: 35

Re: Would Appreciate Some Help with Bagging

Posted in reply to CaptGrumpy
%DMBAG is not the only code that runs during that process. I believe the easiest way to get your results is to run the process again but use a code node just after the regression node. You will be able to analyze your scored sample and then save intermediate files to any directory you choose. I hope that makes sense.

Also, I am glad to read that you are happy with the results.
Ask a Question
Discussion stats
  • 1 reply
  • 198 views
  • 0 likes
  • 2 in conversation