Monday, March 19, 2012

Errors in the metadata manager

Good afternoon,

I'm having the following error when I run my mining model.

Errors in the metadata manager. The dimension with the ID of 'TMP ~MC-ID' cannot be found in the '' database.

I think the error is in caseprocessor.cpp at the ProcessCase method. There's a code snippet below:

The intention of the following code snippet is to run over the attributes of a case and put them on a vector that holds all the cases.

for (UINT iAttribute = 0; iAttribute < _cAttribute; iAttribute++) {

if(iAttribute == 0)

continue;

if(iAttribute == 1)

continue;

if(iAttribute == 2)

continue;

if(iAttribute == 3) {

vet_termos.push_back(rgdmstatevalue[iAttribute].ch);

continue;

if(iAttribute == 4)

vet_dados.push_back(rgdmstatevalue[iAttribute].r8);

DBL dblValue = 0;

if (_vbCategorical[iAttribute]) {

dblValue = (_bMissingAtRandom)

? ::DblCategoricalMAR(rgdmstatevalue[iAttribute])

: ::DblCategorical(rgdmstatevalue[iAttribute]);

}

if (_viewtype == CASEREADER::viewtypeSparse) {

if (dblValue != dblMissing) {

CHECK_STL_MEM(_vdblValue.push_back(dblValue));

CHECK_STL_MEM(_viAttribute.push_back(iAttribute));

}

}

else {

_vdblValue[iAttribute] = dblValue;

}

The attributes of the table are like following:

Index (iAttribute) == 0 -> This is an auto-incremental ID and is the primary key. Integer.

Index (iAttribute) == 1 -> Another ID. Non-key on this table. It is Integer.

Index (iAttribute) == 2 -> Another ID. Non-key on this table. It is integer.

Index (iAttribute) == 3 -> A term. It's a word. This is non-key and the type is varchar.

Index (iAttribute) == 4 -> Weight of the word. Non-key and type double.

As you can notice I also changed the union DM_STATE_VALUE definition on dmalgo.h to accept the reading of a string (if (iAttribute == 3)) :

typedef /* [public][public][public][public][public][public][public] */ union __MIDLMIDL_itf_dmalgo_0000_0002 {

DM_STATE_INDEX si;

DOUBLE r8;

char* ch;

} DM_STATE_VALUE;

So... Does anyone can help me with the error I discribed on the metadata manager ? I would be very pleased with any help.

Thanks a lot for your attention.

-Renan Souza

Good afternoon,

I've tryed to run the Microsoft Clustering algorithm on this table and I've got the following error:

Error 1 Error (Data mining): The source OLAP object for the 'ID' column of the 'TMP' model cannot be found. 0 0

So... I think the error is, somehow, on the table structure, or somethig like that...

Any ideas on how to fix this problem ?

Thanks a lot once more,

-Renan

|||

Hello

First, could you please try a Process Full on the mining structure?

If that does not work, is it possible for you to send the definition of your structure? (Right-click on the structure in the SQL Server Management Studio, select Script as Create and send the script to "bogdanc at sqlserverdatamining dot com")

|||

Dear Mr. Crivat,

Thanks for your prompt reply.

I get this error when I try to deply the model, before I choose the Process Full option: Error 1 Error (Data mining): The source OLAP object for the 'ID' column of the 'TMP' model cannot be found. 0 0

When I get this error a window prompts and asks me if I wish to continue anyway. I click 'yes' but the process fails when I run the model.

This second error is the one I discribed earlyer, as following:

Errors in the metadata manager. The dimension with the ID of 'TMP ~MC-ID' cannot be found in the '' database.

Any clues ?

Thanks a lot once more,

-Renan

|||Could you please send me (or post here) the DDL script for your mining structure ? (I included my email in my previous post)|||

Dear Mr. Drivat,

Here's the script. I also sent it to your e-mail.

USE [BM_TEXTOS]

GO

/****** Object: Table [dbo].[TMP] Script Date: 10/03/2001 10:23:50 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[TMP](

[ID] [int] NOT NULL,

[ID_DOC] [int] NOT NULL,

[ID_TERMO] [int] NOT NULL,

[TERMO] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[FREQ] [real] NOT NULL,

PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

Thanks a lot once more,

-Renan

|||

Hi
I meant, for the Analysis Services mining structure and model. This seems to be for the relational table that contains the training data

thanks

|||

Sorry... Forgive my mistake. Here's the script:

<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">

<ParentObject>

<DatabaseID>Analysis Services Project3</DatabaseID>

</ParentObject>

<ObjectDefinition>

<MiningStructure xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<ID>TMP</ID>

<Name>TMP</Name>

<Annotations>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:CaseTableName</Name>

<Value>dbo_TMP</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:ShowFriendlyNames</Name>

<Value>true</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramLayout</Name>

<Value>

<dds xmlns="">

<diagram fontclsid="{0BE35203-8F91-11CE-9DE3-00AA004BB851}" mouseiconclsid="{0BE35204-8F91-11CE-9DE3-00AA004BB851}" defaultlayout="MSDDS.Rectilinear" defaultlineroute="MSDDS.Rectilinear" version="7" nextobject="2" scale="100" pagebreakanchorx="0" pagebreakanchory="0" pagebreaksizex="0" pagebreaksizey="0" scrollleft="-7330" scrolltop="-4326" gridx="150" gridy="150" marginx="5000" marginy="5000" zoom="100" x="17701" y="11800" backcolor="15334399" defaultpersistence="2" PrintPageNumbersMode="3" PrintMarginTop="0" PrintMarginBottom="635" PrintMarginLeft="0" PrintMarginRight="0" marqueeselectionmode="0" mousepointer="0" snaptogrid="0" autotypeannotation="1" showscrollbars="0" viewpagebreaks="0" donotforceconnectorsbehindshapes="1" backpictureclsid="{00000000-0000-0000-0000-000000000000}">

<font>

<ddsxmlobjectstreamwrapper binary="01000000900144420100065461686f6d61" />

</font>

<mouseicon>

<ddsxmlobjectstreamwrapper binary="6c74000000000000" />

</mouseicon>

</diagram>

<layoutmanager>

<ddsxmlobj />

</layoutmanager>

<ddscontrol controlprogid="DdsShapes.DdsObjectManagedBridge.1" tooltip="TMP (dbo.TMP)" left="20" top="0" logicalid="1" controlid="1" masterid="0" hint1="0" hint2="0" width="3000" height="3149" noresize="0" nomove="0" nodefaultattachpoints="0" autodrag="1" usedefaultiddshape="1" selectable="1" showselectionhandles="1" allownudging="1" isannotation="0" dontautolayout="0" groupcollapsed="0" tabstop="1" visible="1" snaptogrid="0">

<control>

<ddsxmlobjectstreaminitwrapper binary="00080000b80b00004d0c0000" />

</control>

<layoutobject>

<ddsxmlobj>

<property name="LogicalObject" value="dbo_TMP" vartype="8" />

</ddsxmlobj>

</layoutobject>

<shape groupshapeid="0" groupnode="0" />

</ddscontrol>

</dds>

</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:ShowRelationshipNames</Name>

<Value>false</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:UseDiagramDefaultLayout</Name>

<Value>true</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramViewPortLeft</Name>

<Value>-7330</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramViewPortTop</Name>

<Value>-4326</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramBoundingLeft</Name>

<Value>20</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramBoundingTop</Name>

<Value>0</Value>

</Annotation>

<Annotation>

<Name>http://schemas.microsoft.com/DataWarehouse/Designer/1.0:DiagramZoom</Name>

<Value>100</Value>

</Annotation>

</Annotations>

<Source xsi:type="DataSourceViewBinding">

<DataSourceViewID>BM TEXTOS</DataSourceViewID>

</Source>

<Language>1033</Language>

<Collation>Latin1_General_CI_AS</Collation>

<Columns>

<Column xsi:type="ScalarMiningStructureColumn">

<ID>FREQ</ID>

<Name>FREQ</Name>

<Type>Double</Type>

<Content>Continuous</Content>

<KeyColumns>

<KeyColumn>

<DataType>Single</DataType>

<DataSize>-1</DataSize>

<Source xsi:type="ColumnBinding">

<TableID>dbo_TMP</TableID>

<ColumnID>FREQ</ColumnID>

</Source>

</KeyColumn>

</KeyColumns>

</Column>

<Column xsi:type="ScalarMiningStructureColumn">

<ID>ID</ID>

<Name>ID</Name>

<IsKey>true</IsKey>

<Type>Long</Type>

<Content>Key Time</Content>

<KeyColumns>

<KeyColumn>

<DataType>Integer</DataType>

<DataSize>-1</DataSize>

<Source xsi:type="ColumnBinding">

<TableID>dbo_TMP</TableID>

<ColumnID>ID</ColumnID>

</Source>

</KeyColumn>

</KeyColumns>

</Column>

<Column xsi:type="ScalarMiningStructureColumn">

<ID>ID DOC</ID>

<Name>ID DOC</Name>

<Type>Long</Type>

<Content>Continuous</Content>

<KeyColumns>

<KeyColumn>

<DataType>Integer</DataType>

<DataSize>-1</DataSize>

<Source xsi:type="ColumnBinding">

<TableID>dbo_TMP</TableID>

<ColumnID>ID_DOC</ColumnID>

</Source>

</KeyColumn>

</KeyColumns>

</Column>

<Column xsi:type="ScalarMiningStructureColumn">

<ID>ID TERMO</ID>

<Name>ID TERMO</Name>

<Type>Long</Type>

<Content>Continuous</Content>

<KeyColumns>

<KeyColumn>

<DataType>Integer</DataType>

<DataSize>-1</DataSize>

<Source xsi:type="ColumnBinding">

<TableID>dbo_TMP</TableID>

<ColumnID>ID_TERMO</ColumnID>

</Source>

</KeyColumn>

</KeyColumns>

</Column>

<Column xsi:type="ScalarMiningStructureColumn">

<ID>TERMO</ID>

<Name>TERMO</Name>

<Type>Text</Type>

<Content>Discrete</Content>

<KeyColumns>

<KeyColumn>

<DataType>WChar</DataType>

<DataSize>-1</DataSize>

<Source xsi:type="ColumnBinding">

<TableID>dbo_TMP</TableID>

<ColumnID>TERMO</ColumnID>

</Source>

</KeyColumn>

</KeyColumns>

</Column>

</Columns>

<MiningModels>

<MiningModel>

<ID>TMP</ID>

<Name>TMP</Name>

<Algorithm>PBM_K-MEANS</Algorithm>

<Columns>

<Column>

<ID>FREQ</ID>

<Name>FREQ</Name>

<SourceColumnID>FREQ</SourceColumnID>

<Usage>Predict</Usage>

<ModelingFlags>

<ModelingFlag>REGRESSOR</ModelingFlag>

</ModelingFlags>

</Column>

<Column>

<ID>ID</ID>

<Name>ID</Name>

<SourceColumnID>ID</SourceColumnID>

<Usage>Key</Usage>

</Column>

<Column>

<ID>ID DOC</ID>

<Name>ID DOC</Name>

<SourceColumnID>ID DOC</SourceColumnID>

<Usage>Predict</Usage>

<ModelingFlags>

<ModelingFlag>REGRESSOR</ModelingFlag>

</ModelingFlags>

</Column>

<Column>

<ID>ID TERMO</ID>

<Name>ID TERMO</Name>

<SourceColumnID>ID TERMO</SourceColumnID>

<Usage>Predict</Usage>

<ModelingFlags>

<ModelingFlag>REGRESSOR</ModelingFlag>

</ModelingFlags>

</Column>

<Column>

<ID>TERMO</ID>

<Name>TERMO</Name>

<SourceColumnID>TERMO</SourceColumnID>

<Usage>Predict</Usage>

</Column>

</Columns>

<Language>1033</Language>

<Collation>Latin1_General_CI_AS</Collation>

</MiningModel>

</MiningModels>

</MiningStructure>

</ObjectDefinition>

</Create>

Thanks a lot once more,

-Renan

|||

Hello

The one unexpected thing I see in your structure is that the key column of the structure, ID, is marked as Key Time. Is this the intention? Key Time columns are modeled, inside the structure, differently than other columns. The Key Time modeling is intended for Time Series models, where the Key Time (the time slice) is an actual modeling attribute. Was that the intention?

If you only intend to keep ID as a Key (i.e. row identifier, used at most in drillthrough), then I'd suggest to change it to Key (instead of Key Time) and maybe remove the support for Key Time from your algorithm

Does this help?

|||

Dear Mr. Crivat,

Your explanations were very helpful, as usual.

I thought about this time key matter, so when I'm creating the mining structure using the wizard, I manually set the ID collumn as key (it first appears as time key) on the "Specify Column's Contents and Data Types" page.

But when I do it I get the following error when deploying: Error 1 Error (Data mining): The source OLAP object for the 'ID' column of the 'TMP' model cannot be found. 0 0

I realized that it happens because somewhere the ID column is set as"time key" and when I try to deploy it as "key, it crashes.

I'm creating the table on a external Java program that runs the following code:

CREATE TABLE TMP (ID INT NOT NULL, ID_DOC INT NOT NULL, ID_TERMO INT NOT NULL, TERMO VARCHAR(MAX) NOT NULL, FREQ REAL NOT NULL)

GO
ALTER TABLE TMP ADD PRIMARY KEY(ID ASC);

Is there some reason for the key's content is been created as time key ? How to fix it ?

Thanks a lot again,

-Renan

|||

First, make sure your algorithm supports Key and does not support key time. For this, in your metadata class, make sure that GetSupInputContentTypes includes DM_MININGCOLUMN_CONTENT_KEY and does not include DM_MININGCOLUMN_CONTENT_KEY_TIME.

This should fix the problem you are seeing. However, KEY_TIME is not supported by your algorithm, then one thing you could try is the following:

- create (using the wizard) a Decision Tree model on your data.

- in the newly created structure, add a related model using your algorithm

- remove the DT model

The creation of the DT model will configure the key properly at the structure level.

|||

Problem solved.

Thanks a lot again. But I've got a new one I'm posting on a new thread.

No comments:

Post a Comment