Showing posts with label model. Show all posts
Showing posts with label model. Show all posts

Wednesday, March 28, 2012

Mirror of master, msdb, tempdb, or model databases.

Hi Guys,

Since,You cannot mirror the master, msdb, tempdb, or model databases.What will happen if i create new login,change existing security profile and new jobs,change of existing job on princicpal db. how these will be mirrored to other server and in case failover, how it will treat.

Thaks

Mirroring works at the database level only. dts/ssis packages, jobs etc are not mirrored. Database users are mirrored but not their corresponding SQL Server login.

You need to keep a copy of dts/ssis packages, jobs etc on the mirror server and whatever changes you make to them on the principal server, you will also have to make on the mirror server if you want to keep the servers exactly in sync.

hope this helps

Monday, March 26, 2012

Mining structure has to contain at least 2 mining models to see their accuracy charts?

Hi ,all here,

Thank you very much for your kind attention.

I just found that I am not able to view the accuracy chart for my mining model. The error message is: no mining models are selected for comparision. Which is quite strange.

Any guidance? thank you very much.

With best regards,

Yours sincerely,

Can you provide more details? The only scenario I can think of where this would happen is where the first model was a clustering model that had no predictable attributes.|||

Hi, Jamie,

Yes, my mining model is clustering model. So as you mentioned, seeing the accuracy chart of clustering model is restricted in there? If so, what's the resolution? Thank you very much for your further guidance.

With best regards,

Yours sincerely,

|||

The accuracy chart is only useful if your model has a predictable attribute (column), and the accuracy of the prediction can be evaluated against some test data. If your clustering model does not have a predictable attribute, the accuracy chart cannot be used.

|||

Hi, Bogdan, thank you very much for your guidance.

So in what way can we verify if the clustering model is good enough or not?

With best regards,

Yours sincerely,

Friday, March 23, 2012

Mining Model?

Hi,

I'm working on a project to create a mining model.I have one "flattened" table with a productID (key) and related attributes. Example columns are weight, color, price, units sold last year, product category, product rating (top seller, etc) and similar columns, about 40 in total. There are about 15,000 products and same number of rows in the table.

The objective is to pass a ProductID (that also exists in the table) and get back the top N products that most resemble the source product based on all the attributes.

Any advice on which models I should test and how to set up the models would be much appreciated. Also if there is a similar example/sample out there, please let me know. I downloaded the MovieClick sample, but that doesn't work in my case as I only have the equivalent of the Customers table.

Thanks in Advance.

This is actually a K-Nearest Neighbor problem, for which we don't ship an implementation for SQL Server Analysis Services (although someone may have written a plug in). I could imagine that you could use the fuzzy matching transform in Integration Services to do this, however. To do so you would just use your product table as the reference table, send in the fields of the product of interest, then sort the results by the match confidence.

HTH

-Jamie

|||

Thanks Jamie, I'll try fuzzy matching in SSIS. I'm also thinking of writing my own code to calculate based on KNN in TSQL. I'm not sure if the performance will be acceptable though especially as I need to pass in up to 5 products, evaluate based on their combined attributes and get a resultset back with top N matches.

Is there a third party software out there that can do this?

|||When using the fuzzy components in SSIS, do be aware that they are string matching components, evaluating the edit distance between two string. So, for example, "911" will be pretty much as close a match to "999" as "199" - so for any columns where you need to evaluate similarity of values you may need to use other components such as the Derived Column to perform the calculation.|||

Hi Donald,

Can you explain what you mean by Derived column. How would I make it work to calculate distances for numeric columns/attributes.

Thanks.

|||I don't know of a 3rd party KNN, but you would likely get better performance implementing your own algorithm using our plug-in interfaces in C#.|||

Jamie/Donald

Thanks for your responses. My C# is not that strong. For now I'll write something in SQL and if I can create a model that works, I'll convert that into a plug-in.

This is the plan. Normalize all attributes using mean and std dev. Apply the nearest neighbour algorithm using Euclidean distance. Also experiment with arbitrary weights for attributes or maybe use correlation to filter out some of the weaker attributes, not sure how that will work though at this point.

Any suggestions are welcome. Also, Is there a sample plug-in in C# out there I can use as template. Is there any way I can mold this table to use Association Rules or any other built-in algorithm.

Regards,

Asim.

|||

There are tutorials here for writing managed plug-in algorithms: http://www.sqlserverdatamining.com/DMCommunity/Tutorials/default.aspx

You may need to register (free!) to get access to the links.

mining model with time

i want create a model to predict what product i should Ads for customer at time.

example: in summer, i should show the , drinks (coca, pepsi) , ice food, bikini, sandals, glasses. in winter, i should show shoes, coats, hot food....

i have some table:

order(orderid, time,cusid...)

product(productid,..)

orderdetails(orderid, productid..)

customers(cuisid,....)

You can add the season as an input for the model, along with whatever other inputs you are interested in.

mining model viewer error

I am developing a multiple regression model for a super market site selection with 11 predictors.

As soon as I press the model viewer tab, the following message appears:

The server content appears to be out of date.
Would you like to build and deploy the project first?

I opt no and the error message pops up:

The tree graph cannot be created because of the following error:

'Either the user, ......., does not have access to the ....... database, or the database does not exist.'.

Could anyone mine out the cause please....

saji

Did you deploy the model at least once? The project (containing the data source, data source view, mining structure and model) should be deployed on the server for processing to happen. Once processing is complete, the viewer will work. It seems like the project was not deployed on the server.

Or, short answer, try to answer 'Yes' at the "Would you like to build and deploy first?" question, and let us know if it worked

sql

Mining Model predicts same set of products for all cases

Hi

I have developed a product

basket mining model as follows

DSV

SELECT C.CustomerId,C.CustomerIdName,P.ProductId,P.ProductIdName

FROM Customer INNER

JOIN CustomerProduct

ON C.OpportunityId

= P.OpportunityId

Mining Structure

CREATE MINING MODEL ProductBasket

(

CustomerId

TEXT KEY,

CustomerIdName

PREDICT,

ProductId

PREDICT,

ProductRecommend

TABLE PREDICT

(

ProductId TEXT KEY

ProductIdName PREDICTONLY

)

)

USING Microsoft_Association_Rules

Prediction Query

Since I want the output in the following format

Product

ID

Items (nested Table)

Product

A

product B

Product C

Product

B

Product A

Product C

I have written the prediction query as follows

SELECT

t.[ProductId],

PredictAssociation([Association].[ ProductId],3)

From

[Association]

PREDICTION JOIN

OPENQUERY([Adventure Works Cycle MSCRM],

'SELECT DISTINCT

[ProductId]

FROM

(SELECT ProductId FROM ProductBase)

as [Product]

') AS t

ON

[Association].[Product Id] = t.[ProductId]

The model is predicting the

same set of products for every case. Even changes in the algorithm parameter

value do not have any impact on the result.

What is the reason for this and

how can u rectify it?

If you're doing a simple recommendation model (i.e. a model that provides recommendations based on what's in the user's shopping basket, there is no need to have the product id at both case and nested level. Your modeling seems unneccessarily complex for this scenario - it also explains why you're seeing the same recommendations for all cases: based on the DSV you've listed, your training cases don't include the basket contents at all for each transaction.

If you use a model definition similar to the one I described in an earlier thread on this topic (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=649759&SiteID=1), your query would look like this:


SELECT t.CustomerID, PredictAssociation(AssociationModel.Products, 3) FROM PM
PREDICTION JOIN
SHAPE {
OPENQUERY(ds, 'SELECT CustomerID FROM CustomerProducts ORDER BY CustomerID')
}
APPEND ( {
OPENQUERY(ds, 'SELECT CustomerID, ProductName FROM CustomerProducts ORDER BY CustomerID') }
RELATE CustomerID to CustomerID ) AS Products as t
ON AssociationModel.Products.ProductName = t.Products.ProductName

The core idea is that the input case (for prediction as well as training) is the set of products in the customer's basket and the prediction is the list of recommended products. Both the input and prediction map to the same nested table in the mining structure/model.

|||

The first query should be SELECT DISTINCT CustomerID ...

|||

Also, if you want simply a list of recommendations per product, and you first created a model based on customer baskets you could then create a query like this to get the complete list of product recommendations:

SELECT t.ProductName, PredictAssociation(Products, 3) FROM PM
PREDICTION JOIN
SHAPE {
OPENQUERY(ds, 'SELECT DISTINCT ProductName FROM CustomerProducts ORDER BY ProductName')
}
APPEND ( {
OPENQUERY(ds, 'SELECT DISTINCT ProductName FROM CustomerProducts ORDER BY ProductName') }
RELATE ProductName to ProductName) AS Products as t
ON PM.Products.ProductName = t.Products.ProductName

This works because you are specifying a basket containing a single item as input for the prediction on a model that was created on customer baskets. Using the productname on the top level of the input query for the prediction is just a shortcut since we know we want baskets of size 1 anyway. Doing an input query like this for the model training would cause no rules to be found since only baskets greater than size 1 imply any patterns.

Mining Model Prediction.

Mining Model Prediction... what for?

Which Data Mining algorithm use Mining Model Prediction?

Every algorithm has to use Mining Model Prediction for a final goal of a Data Mining Project?

In a very general sense...

Mining Model Prediction is typically the part of the UI which allows querying a mining model via DMX. What the model does depends on the algorithm, this part of the UI allows authoring DMX queries specific to that model.

Now, a mining model is not required to make predictions to be useful. Examples;

- algorithms may be used just to explore data, not to make predictions. Think the dependency net in naive bayes or Decision trees

- algorithms may assign unpredictive labels (e.g Clustering)

- algorithms may actually transform data for use in a different model (think of a decision tree model using as input the cluster label from a different model -- the cluster modell effectively transforms the input for decision trees)

|||

In case of Associantion Rules what should I show to final user? The same answer that Mining Model View gives or it′s necessary to make a Mining Model Prediction to a final answer?

If yes, it′s necessary to make a Mining Model Prediction to a final answer, how I do that?

|||

In general prediction isn't always the final outcome of a data mining models. Some models are only used for descriptive analysis. All of the algorithms in Analysis Services can be used for both predictive and descriptive analysis so it really is up to the application you require for your business problem as to how you want to use this.

If you want to get a predictive result from a model, you should always do a prediction and not try to impute the results from the algorithm content. The way to do so is to use a DMX query with a prediction join. To provide further details, I would need more information on what you were trying to accomplish.

|||Thanks

Mining Model Parameter

I have one main mining structure and several mining models that are using the MS Decision Trees algorithm. I have a Reporting Services report that displays the model using a table. I want to set it up so that in the DMX query, I can use a parameter to specify which model to use. That way I just have one report that can reference multiple models. For example I would like to do something like this:

SELECT FLATTENED * FROM [@.model].CONTENT

This doesn't work because I get the error message:

Preparation of DMX query failed.
Error (Data mining): Either the user, user, does not have permission to access the referenced mining model, @.model, or the object does not exist. (Microsoft SQL Server 2005 Analysis Services)

We are running SSAS 2005 SP2. Is there a way to accomplish this?

DMX does not support parameterization of the name of the object being queried.
One of the reasons is that a statement, once prepared, is supposed to have a well defined response schema (column definition) and this cannot be enforced as the value of the parameter changes. For example, the query above would return various results depending on the model being queried.

That aside, you should be able to construct the query by concatenating the DMX fragments with the report parameter, something like
"SELECT FLATTENED * FROM [" + @.model + "].CONTENT"|||

Thanks for your response. I actually tried that and it didn't seem to work. But I did figure out a way to do it. I created a stored procedure that looks like this:

Code Snippet

AS

BEGIN

DECLARE @.OPENQUERY nvarchar(4000), @.TSQL nvarchar(4000), @.LinkedServer nvarchar(4000)

SET @.LinkedServer = 'DMSERVER'

SET @.OPENQUERY = 'SELECT * FROM OPENQUERY('+ @.LinkedServer + ','''

SET @.TSQL = 'SELECT FLATTENED * FROM ['+@.miningModel+'].CONTENT'')'

EXEC (@.OPENQUERY+@.TSQL)

END

The linked server connects to the instance of SSAS 2005 and then I just call the stored procedure from reporting services and pass in the miningModel variable. I had to set it up this way becase OPENQUERY doesn't accept variables for its arguements. I found this article that explains how to get around it. You'll see that I just copied what they did. It might be a little bit of a hack but it works!

Mining Accuracy Chart, predictable column in nested tables

In the Mining Accuracy Chart, the predictable columns of nested tables does not show up in the "Select predictable mining model columns to show in the lift chart" table. The "Predictable column name" is empty.

Predictable columns in the case table shows up, but not the predictable columns in the nested table. What am I missing?

-Young K

The accuracy chart currently does not support predictable columns in nested tables.

Monday, March 12, 2012

Migratre from SQL 2000 to SQL 2005

Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do wit
h
the system Database (master, tempdb, model, and msdb)? what needs to be
migrate over and what not need to moved over?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200707/1Have you read this guide:
http://www.microsoft.com/downloads/...&displaylang=en
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"ajsql via droptable.com" <u35479@.uwe> wrote in message
news:749f424e180d9@.uwe...
> Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do
> with
> the system Database (master, tempdb, model, and msdb)? what needs to be
> migrate over and what not need to moved over?
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200707/1
>

Migratre from SQL 2000 to SQL 2005

Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do with
the system Database (master, tempdb, model, and msdb)? what needs to be
migrate over and what not need to moved over?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server/200707/1
Have you read this guide:
http://www.microsoft.com/downloads/details.aspx?FamilyID=3d5e96d9-0074-46c4-bd4f-c3eb2abf4b66&displaylang=en

Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"ajsql via droptable.com" <u35479@.uwe> wrote in message
news:749f424e180d9@.uwe...
> Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do
> with
> the system Database (master, tempdb, model, and msdb)? what needs to be
> migrate over and what not need to moved over?
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums.aspx/sql-server/200707/1
>

Migratre from SQL 2000 to SQL 2005

Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do with
the system Database (master, tempdb, model, and msdb)? what needs to be
migrate over and what not need to moved over?
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1Have you read this guide:
http://www.microsoft.com/downloads/details.aspx?FamilyID=3d5e96d9-0074-46c4-bd4f-c3eb2abf4b66&displaylang=en
Adam Machanic
SQL Server MVP - http://sqlblog.com
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
"ajsql via SQLMonster.com" <u35479@.uwe> wrote in message
news:749f424e180d9@.uwe...
> Migrating from SQL Server 2000 t o SQL Server 2005, what do I need to do
> with
> the system Database (master, tempdb, model, and msdb)? what needs to be
> migrate over and what not need to moved over?
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200707/1
>