sql-serversql-server-2012ssmsssms-2012dmx-ssas

DMX processing Mining Structure Error


I have a problem while processing mining structure...

This is my Mining Structure

CREATE MINING
STRUCTURE [QUESTION1] (
    [ownerReviewID] LONG KEY,
    [makeName] TEXT DISCRETE,
    [modelName] TEXT DISCRETE,
    [price] LONG CONTINUOUS,
    [priceDisc] LONG DISCRETIZED(AUTOMATIC),
    [seriesYear] LONG CONTINUOUS,
    [seriesYearDisc] LONG DISCRETIZED(AUTOMATIC),
    [ownerName] TEXT DISCRETE,
    [ownedSinceNew] BOOLEAN DISCRETE,
    [ownedPeriod] LONG DISCRETE,
                   [feature_ratings] TABLE (
                                [transID] LONG KEY,
                                [ownerReviewID]
LONG DISCRETE,
                                [feature] TEXT DISCRETE,
                                [rating] LONG CONTINUOUS,
                                [ratingDisc] LONG DISCRETIZED(AUTOMATIC)
                           )

) WITH HOLDOUT
(30 PERCENT OR 10000 CASES);

I've created a Mining Model with Naive Bayes:

ALTER MINING STRUCTURE [QUESTION1]

ADD MINING MODEL [PredictReBuy-NBayes]
( 
 [ownerReviewID],
 [makeName],
 [modelName],
 [priceDisc] AS [price],
 [seriesYearDisc] AS
[seriesYear],
 [ownerName],
 [ownedSinceNew],

    feature_ratings(
         transID,
         feature,
         [ratingDisc] AS
[rating]      PREDICT     )
) 
USING Microsoft_Naive_Bayes

So far, the 2 codes above work fine, all executed.

The error shown at the bottom comes up when I try to execute the processing code. This is my processing code:

 INSERT INTO MINING STRUCTURE [QUESTION1]

(
   [ownerReviewID],[makeName],[modelName],[price],[seriesYear],[ownerName],[ownedSinceNew],[ownedPeriod],  feature_ratings(SKIP, [transID])
)
SHAPE {
  OPENQUERY([Car Rating],'SELECT ownerReviewID, makeName, modelName, price, seriesYear, ownerName, ownedSinceNew, ownedPeriod FROM dbo.owner_reviews ORDER BY ownerReviewID')}
APPEND
( 
  {OPENQUERY([Car Rating],'SELECT transID, ownerReviewID, feature, rating FROM 
    dbo.feature_ratings ORDER BY transID')
}
RELATE ownerReviewID to ownerReviewID 
) AS [feature_ratings]

I'm currently receiving this error which I dont understand how to solve... any ideas? Thanks!!

Executing the query ...Error (Data mining): The count of the specified columns does not match the count of  

the mining model columns or the input rowset columns.Execution complete

Solution

  • I redid the code.. turns out the error was what it says... it doesnt match the columns.