Recovering Marginal Statistics

Discussion in 'microsoft.public.sqlserver.datamining' started by anonymous_user, Mar 27, 2007.

  1. I'm getting an unspecified error while using GetAttributeStats in a plugin custom algorithm.

    I have used GetTotalCasesCount in the same context and it worked fine.

    Have I to provide some input for the DM_ATTRIBUTE_STAT array pointer?

    Can someone provide more details about the GetAttributeStats parameters?
     
    anonymous_user, Mar 27, 2007
    #1
    1. Advertisements

  2. Here are the steps to call GetAttributeStats (error checking removed for
    clarity):

    IDMAttributeSet* pASet;
    IDMMarginalStats* pMStat;
    IDMMemoryAllocator* pMemAllocator; // use the
    IDMContextServices->GetVectorAlloc to get this

    DM_ATTRIBUTE_STAT rAttrStat;
    ULONG ulStates;

    // Get number of attribute states from the attribute set
    pASet->GetAttributeStateCount(iAtt, &ulStates );

    // Allocate room for the state statistics inside the attribute stat
    object
    pMemAllocator->Alloc( ulStates*sizeof(DM_STATE_STAT),
    (byte**)&rAttrStat.rgStateStats );
    // memset the memory to 0
    memset( rAttrStat.rgStateStats, 0, ulStates*sizeof(DM_STATE_STAT));

    // now get attribute statistics
    pMStat->GetAttributeStats(in_pContext, i, &rAttrStat);


    Hope this helps

    --
    --
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please do not send email directly to this alias. It is for newsgroup
    purposes only.

    thanks,
    bogdan
     
    Bogdan Crivat [MSFT], Mar 27, 2007
    #2
    1. Advertisements

  3. Dear Bogdan,

    Your comments were very useful.

    Thanks a lot!

    Claudio L Curotto
     
    anonymous_user, Mar 29, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.