Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

singleton query agains OLAP based model?

 
   Database Forums (Home) -> Datamining RSS
Next:  How to do updates upon the query results  
Author Message
Jeje

External


Since: Apr 17, 2006
Posts: 184



(Msg. 1) Posted: Mon Jan 21, 2008 8:12 pm
Post subject: singleton query agains OLAP based model?
Archived from groups: microsoft>public>sqlserver>datamining (more info?)

Hi,

I have created a decision tree DM model from a cube.
now I try the singleton query, but how to create the query????

the only samples I found works against an RDBMS model.
so I'm not sure how to write my query:

SELECT
flattened
[Test Dec Tree].[Performance Levels]
,PredictProbability([?????]) <-- error here
From
[Test Dec Tree]
NATURAL PREDICTION JOIN
(SELECT 'Male' AS [Gender],
'Asian' AS [Race Group]
) AS t

I have tried a lot of different syntaxes in the predictprobabilty function
without success.

because it's OLAP based, I only have "existing" and "missing" in my model
result, while the samples found are differents.

can you point me on a sample anywhere?

thanks.
Jerome.

 >> Stay informed about: singleton query agains OLAP based model? 
Back to top
Login to vote
Dejan Sarka

External


Since: Mar 18, 2004
Posts: 317



(Msg. 2) Posted: Wed Jan 23, 2008 5:08 am
Post subject: Re: singleton query agains OLAP based model? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jeje,

I created a DT model on Adventure Works DW demo cube. I used Number Of Cars
Owned as predictable, Education, Gender and Marital Status as input column.
I checked the content of the predictable column - when it was read from the
cube, it was Continuous; I changed it to Discrete. Deployed the model, and
here is a query that works:

SELECT [Number of Cars Owned],
PredictProbability([Number of Cars Owned], 2)
AS TwoCarsProb
FROM [CubeDT]
NATURAL PREDICTION JOIN
(SELECT 'High School' AS Education,
'Single' AS [Marital Status],
'M' AS [Gender]) AS t

What kind of error do you get? Can you test the way I did?

--
Dejan Sarka
http://blogs.solidq.com/EN/dsarka/default.aspx

"Jeje" wrote in message

> Hi,
>
> I have created a decision tree DM model from a cube.
> now I try the singleton query, but how to create the query????
>
> the only samples I found works against an RDBMS model.
> so I'm not sure how to write my query:
>
> SELECT
> flattened
> [Test Dec Tree].[Performance Levels]
> ,PredictProbability([?????]) <-- error here
> From
> [Test Dec Tree]
> NATURAL PREDICTION JOIN
> (SELECT 'Male' AS [Gender],
> 'Asian' AS [Race Group]
> ) AS t
>
> I have tried a lot of different syntaxes in the predictprobabilty function
> without success.
>
> because it's OLAP based, I only have "existing" and "missing" in my model
> result, while the samples found are differents.
>
> can you point me on a sample anywhere?
>
> thanks.
> Jerome.
>
>
>

 >> Stay informed about: singleton query agains OLAP based model? 
Back to top
Login to vote
Jeje

External


Since: Apr 17, 2006
Posts: 184



(Msg. 3) Posted: Wed Jan 23, 2008 9:26 am
Post subject: Re: singleton query agains OLAP based model? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

this works, only if my predictable content is not a nested table.

I have a survey like cube:
customer dimension, product dimension and evaluation dimension (good, avg,
bad) and #Evaluations.
I have create a decision tree model using the customer key as the key, what
I want to predict is the evaluation (so a nested table) and also I'm using
the product characteristics in my model (color, type, size etc...)
it's ok.
1 thing is missing here: I have to select the tree what I want to track (ie
select bad, avg or good evaluations) and the model just display "existing"
"missing"
I will prefer to have the 3 evaluation types and the probability to fall
into 1 of these, but it's a small issue.

now, the PredictProbability formula...
the formula doesn't works.

in adv. works I can reproduce it:
SELECT [Subcategories]
, PredictProbability([Subcategories], 2) AS TwoCarsProb
FROM [decision]
NATURAL PREDICTION JOIN
(SELECT 'High School' AS Education,
'Single' AS [Marital Status],
'M' AS [Gender]) AS t


The error is:
Error (Data mining): Only a scalar column reference is allowed in the
prediction function at line 2, column 29.

So how to write a singleton query to use it against the Subcategories
prediction?

Thanks.

Jerome.



"Dejan Sarka" wrote in
message
> Jeje,
>
> I created a DT model on Adventure Works DW demo cube. I used Number Of
> Cars Owned as predictable, Education, Gender and Marital Status as input
> column. I checked the content of the predictable column - when it was read
> from the cube, it was Continuous; I changed it to Discrete. Deployed the
> model, and here is a query that works:
>
> SELECT [Number of Cars Owned],
> PredictProbability([Number of Cars Owned], 2)
> AS TwoCarsProb
> FROM [CubeDT]
> NATURAL PREDICTION JOIN
> (SELECT 'High School' AS Education,
> 'Single' AS [Marital Status],
> 'M' AS [Gender]) AS t
>
> What kind of error do you get? Can you test the way I did?
>
> --
> Dejan Sarka
> http://blogs.solidq.com/EN/dsarka/default.aspx
>
> "Jeje" wrote in message
>
>> Hi,
>>
>> I have created a decision tree DM model from a cube.
>> now I try the singleton query, but how to create the query????
>>
>> the only samples I found works against an RDBMS model.
>> so I'm not sure how to write my query:
>>
>> SELECT
>> flattened
>> [Test Dec Tree].[Performance Levels]
>> ,PredictProbability([?????]) <-- error here
>> From
>> [Test Dec Tree]
>> NATURAL PREDICTION JOIN
>> (SELECT 'Male' AS [Gender],
>> 'Asian' AS [Race Group]
>> ) AS t
>>
>> I have tried a lot of different syntaxes in the predictprobabilty
>> function without success.
>>
>> because it's OLAP based, I only have "existing" and "missing" in my model
>> result, while the samples found are differents.
>>
>> can you point me on a sample anywhere?
>>
>> thanks.
>> Jerome.
>>
>>
>>
>
 >> Stay informed about: singleton query agains OLAP based model? 
Back to top
Login to vote
Jeje

External


Since: Apr 17, 2006
Posts: 184



(Msg. 4) Posted: Thu Jan 24, 2008 4:38 pm
Post subject: Re: singleton query agains OLAP based model? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ok
I have found
I have to use:
PredictAssociation
instead of PredictProbability


"Jeje" wrote in message

> this works, only if my predictable content is not a nested table.
>
> I have a survey like cube:
> customer dimension, product dimension and evaluation dimension (good, avg,
> bad) and #Evaluations.
> I have create a decision tree model using the customer key as the key,
> what I want to predict is the evaluation (so a nested table) and also I'm
> using the product characteristics in my model (color, type, size etc...)
> it's ok.
> 1 thing is missing here: I have to select the tree what I want to track
> (ie select bad, avg or good evaluations) and the model just display
> "existing" "missing"
> I will prefer to have the 3 evaluation types and the probability to fall
> into 1 of these, but it's a small issue.
>
> now, the PredictProbability formula...
> the formula doesn't works.
>
> in adv. works I can reproduce it:
> SELECT [Subcategories]
> , PredictProbability([Subcategories], 2) AS TwoCarsProb
> FROM [decision]
> NATURAL PREDICTION JOIN
> (SELECT 'High School' AS Education,
> 'Single' AS [Marital Status],
> 'M' AS [Gender]) AS t
>
>
> The error is:
> Error (Data mining): Only a scalar column reference is allowed in the
> prediction function at line 2, column 29.
>
> So how to write a singleton query to use it against the Subcategories
> prediction?
>
> Thanks.
>
> Jerome.
>
>
>
> "Dejan Sarka" wrote in
> message
>> Jeje,
>>
>> I created a DT model on Adventure Works DW demo cube. I used Number Of
>> Cars Owned as predictable, Education, Gender and Marital Status as input
>> column. I checked the content of the predictable column - when it was
>> read from the cube, it was Continuous; I changed it to Discrete. Deployed
>> the model, and here is a query that works:
>>
>> SELECT [Number of Cars Owned],
>> PredictProbability([Number of Cars Owned], 2)
>> AS TwoCarsProb
>> FROM [CubeDT]
>> NATURAL PREDICTION JOIN
>> (SELECT 'High School' AS Education,
>> 'Single' AS [Marital Status],
>> 'M' AS [Gender]) AS t
>>
>> What kind of error do you get? Can you test the way I did?
>>
>> --
>> Dejan Sarka
>> http://blogs.solidq.com/EN/dsarka/default.aspx
>>
>> "Jeje" wrote in message
>>
>>> Hi,
>>>
>>> I have created a decision tree DM model from a cube.
>>> now I try the singleton query, but how to create the query????
>>>
>>> the only samples I found works against an RDBMS model.
>>> so I'm not sure how to write my query:
>>>
>>> SELECT
>>> flattened
>>> [Test Dec Tree].[Performance Levels]
>>> ,PredictProbability([?????]) <-- error here
>>> From
>>> [Test Dec Tree]
>>> NATURAL PREDICTION JOIN
>>> (SELECT 'Male' AS [Gender],
>>> 'Asian' AS [Race Group]
>>> ) AS t
>>>
>>> I have tried a lot of different syntaxes in the predictprobabilty
>>> function without success.
>>>
>>> because it's OLAP based, I only have "existing" and "missing" in my
>>> model result, while the samples found are differents.
>>>
>>> can you point me on a sample anywhere?
>>>
>>> thanks.
>>> Jerome.
>>>
>>>
>>>
>>
 >> Stay informed about: singleton query agains OLAP based model? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Avoiding singleton query - I am working on page 161 example of data mining w/sql server 2005 book. Instead of writing a singleton query as follows, I would like to run selects from the new tables: cust_new and movies_new. How would I write that query?? select flattened ..

Constructing a singleton query from a relational data source - I can't seem to do the following (in pseudo code) select prediction of an attribute from a data mining model natural prediction join (SELECT( OPENQUERY(source, some select) ) as nested table ) as t instead I need to manually build up the..

model from an OLAP cube, too many cases evaluated... -

query mining model from T-SQL - It is possible to query a relational datatable from DMX using call systemopenquery([Data_Source]'SELECT.....'). Is it possible to make queries of the mining model in the opposite direction from T-SQL on Database engine by any of the functions?

Question about query of "Mining Model Viewer" - Hi, What is the approach to get the leaf nodes of a decision tree? You allow us to drill through on the Decision Tree leaf nodes which means there should be a way to link the node to individual cases. I would like to use this as part of the prediction...
   Database Forums (Home) -> Datamining All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]