none
Why I always fail to manually train a model? RRS feed

  • Question

  • Dear all,

    Why I always fail to manually train a model in Management Studio?

    ZhaoHui Tang recommends me to untrain the model first.  So I untrained it like this.

    DELETE FROM Decision_Tree.CONTENT

    Then I train it like this.

    INSERT INTO Decision_Tree
      (Age, Bike_buyer, Customer_Id, Gender)
    OPENQUERY ([AdventureWorksDW], 'SELECT Age, Bike_buyer, Customer_Id, Gender FROM Training_table');

    The error message is

    Error (Data mining): The mining structure , Decision_Tree is already trained and does not
    support incremental updates. Before using the INSERT INTO statement, use DELETE FROM <object>.

    Why is that so?  I already untrained the model.  The model has been made and processed
    outside Management Studio, i.e., in the Visual Studio.

    Thank you,

    Bernaridho

    Saturday, August 12, 2006 10:55 AM

Answers

  • When you create a model, you have a model and a structure.  When you train a model, it's containing structure is also trained (populated with cases).  You first need to do a delete from the structure before doing INSERT INTO with a query.  If the structure has the same name as the model, you can use

    DELETE FROM MINING STRUCTURE Decision_Tree

    If you do what you did, e.g. DELETE FROM MINING MODEL Decision_Tree.CONTENT and then issued a command INSERT INTO MINING MODEL Decision_Tree - with no query, it would retrain the model based on the same cases.  Not entirely useful, but you can use the ALTER MINING STRUCTURE command to add additional models to the same structure and train them using INSERT INTO with no cases, once the mining structure has been trained.

    Saturday, August 12, 2006 10:45 PM

All replies

  • When you create a model, you have a model and a structure.  When you train a model, it's containing structure is also trained (populated with cases).  You first need to do a delete from the structure before doing INSERT INTO with a query.  If the structure has the same name as the model, you can use

    DELETE FROM MINING STRUCTURE Decision_Tree

    If you do what you did, e.g. DELETE FROM MINING MODEL Decision_Tree.CONTENT and then issued a command INSERT INTO MINING MODEL Decision_Tree - with no query, it would retrain the model based on the same cases.  Not entirely useful, but you can use the ALTER MINING STRUCTURE command to add additional models to the same structure and train them using INSERT INTO with no cases, once the mining structure has been trained.

    Saturday, August 12, 2006 10:45 PM
  • Dear all (and especially Jamie)

    Thank you for the reply.  I've tried your suggestions.

    I call the operations like this (as suggested)

    DELETE FROM MINING STRUCTURE [Mail Targets Train30 Pct]
    DELETE FROM MINING MODEL Decide_predict__bike_buyers

    I trained the model like this, and it was successful.

    INSERT INTO Decide_predict__bike_buyers
      (Age, [Bike buyer], [Customer Id], Gender)
    OPENQUERY (Mine, 'SELECT Age, [Bike_buyer], [Customer_Id], Gender FROM Mail_Targets_Train30Pct')

    First, I got this error.

    Error (Data mining): Processing the 'Decide_predict__bike_buyers' mining model failed because either the training data is empty or there were no significant attributes found.

    But after inserting data to the training table, I can train the model.

    Big thanks to Jamie

    Bernaridho

    -- This is the reply to the original question of unable to manually train a model --

    Posts 151

    Answer Re: Why I always fail to manually train a model?
    Answer Was this post helpful ?     Reply Quote
       
    When you create a model, you have a model and a structure.  When you train a model, it's containing structure is also trained (populated with cases).  You first need to do a delete from the structure before doing INSERT INTO with a query.  If the structure has the same name as the model, you can use

    DELETE FROM MINING STRUCTURE Decision_Tree

    If you do what you did, e.g. DELETE FROM MINING MODEL Decision_Tree.CONTENT and then issued a command INSERT INTO MINING MODEL Decision_Tree - with no query, it would retrain the model based on the same cases.  Not entirely useful, but you can use the ALTER MINING STRUCTURE command to add additional models to the same structure and train them using INSERT INTO with no cases, once the mining structure has been trained.
    Thursday, August 17, 2006 4:31 AM