Showing posts with label exprgt. Show all posts
Showing posts with label exprgt. Show all posts

Wednesday, March 21, 2012

DMX Query examples

Can you give an example on how exactly to write each of the following? (I am clearly not a programmer :))

TopCount ( <table expr>,<rank expr>,<n-items>) =

TopPercent ( <table expr>,<rank expr>,<percent>) =

PredictTimeSeries ( <table expr>,<n1>,<n2>) =

PredictAssociation ( <table expr>,<n>) =

Thanks,

Carrie

SELECT TopCount(PredictHistogram(MyAttribute),$Probability,3), // returns top 3 values by probability
TopPercent(PredictHistogram(MyAttribute),$Support,0.20) // returns top values that contain at least 20% of the total support
FROM MyModel
PREDICTION JOIN
...

SELECT PredictTimeSeries(MyNestedTableTimeSeriesColumn, 2, 5) // predicts steps 2-5 in the series
FROM MyTimeSeriesModel

SELECT PredictAssociation(MyNestedTable, 5) // returns top 5 associated items
FROM My Model
PREDICTION JOIN
...

|||

So I did.....

select TopCount(PredictHistogram(Returnwithplay),$Support,.20)

From [REC FT All Cube DT]

PREDICTION JOIN

And received the following ( I think the query completed with errors):

Executing the query ...

Parser: The end of the input was reached.

Execution complete

|||And I tried

select PredictTimeSeries([Slot Theo Win],2,5) FROM [Player Market]

and received the following error:

Executing the query ...

Error (Data mining): The specified DMX column was not found in the context at line 1, column 26.

Execution complete

My time series is set up as the following.......

Player Market:

Date Dim Predict

Day Key

Rated Slot Theo Predict Only

Rated Table Theo Predict Only

Player Market Dim Key

|||

PredictTimeSeries only works on models using the Microsoft_Time_Series algorithm. Also, it doesn't seem that you have a column called "Slot Theo Win" in your data set.

It seems you would need a model somewhat like

CREATE MINING MODEL [Player Market]
(
DateDim DATE KEY TIME,
PlayerMarketDim TEXT KEY,
RatedSlotTheo DOUBLE CONTINUOUS PREDICT_ONLY,
RatedSlotTheo DOUBLE CONTINUOUS PREDICT_ONLY
) USING Microsoft_Time_Series

sql