Internal error: file 'dmattributeset.cpp', line 2004

I created a Neural Network model with AMO in C#. It seems that everything (including pre-processing) goes well until the final stage of processing (i.e. model training after retrieving all the data), then I consistently get the following error:

Internal error: An unexpected error occurred (file 'dmattributeset.cpp', line 2004, function 'DMCubeAttributeSet::GetAttributeGroup')

Could anyone offer any clue about this error?

I created an almost identical model with DM Studio and it works fine. It seems it is impossible to view the model created by AMO with DM Studio that is very handy in viewing various aspects of models.

Thanks in advance!

[721 byte] By [hipswich] at [2008-2-22]
# 1
This appears to be a bug. We would appreciate it if you could file the details here (including the AMO code, BI project and data, if possible) so we can investigate: http://labs.msdn.microsoft.com/productfeedback
RamanIyer at 2007-9-9 > top of Msdn Tech,SQL Server,Data Mining...
# 2

Thank you for your prompt response.

I have got exactly the same error in two completely independent environments - different workstations, different SQL servers and different databases. I will send the code that is pretty much a work of copying and pasting from

http://msdn2.microsoft.com/en-us/library/ms345093(SQL.90).aspx

and

http://msdn2.microsoft.com/en-us/library/ms345087(SQL.90).aspx

I also looked at the example code in book Data Mining with SQL Server 2005 and modified the code in various ways following it and made the DM structure as simple as possible, but the results are the same.

I believe the error message can be reproduced on any data. Since providing patient data even without Patient ID would require overcoming extraordinary adminstrative burden, let me just send you the AMO code shortly.

hipswich at 2007-9-9 > top of Msdn Tech,SQL Server,Data Mining...
# 3

is there any workAround ? I hope it is a smaal bug? this sample from MICROSOFT (!) not work... :(

static MiningStructure CreateMyForecastingMiningStructure(Database db)

{

MiningStructure ms = db.MiningStructures.FindByName("My Forecasting");

if (ms != null)

ms.Drop();

ms = db.MiningStructures.Add("My Forecasting", "My Forecasting");

ms.Source = new DataSourceViewBinding(db.DataSourceViews.FindByName("AdventureWorksDW").ID);

ScalarMiningStructureColumn amount = ms.Columns.Add("CustomerKey", "CustomerKey");

amount.IsKey = true;

amount.Content = MiningStructureColumnContents.Key;

//amount.Type = MiningStructureColumnTypes.;

amount.KeyColumns.Add("DimCustomer", "CustomerKey", OleDbType.Integer);

ScalarMiningStructureColumn modelRegion = ms.Columns.Add("HouseOwnerFlag", "HouseOwnerFlag");

modelRegion.IsKey = false ;

modelRegion.Type = MiningStructureColumnTypes.Text;

modelRegion.Content = MiningStructureColumnContents.Discrete;

modelRegion.KeyColumns.Add("DimCustomer", "HouseOwnerFlag", OleDbType.WChar, 56);

ScalarMiningStructureColumn qty = ms.Columns.Add("YearlyIncome", "YearlyIncome");

qty.IsKey = false;

qty.Type = MiningStructureColumnTypes.Long;

qty.Content = MiningStructureColumnContents.Continuous;

qty.KeyColumns.Add("DimCustomer", "YearlyIncome", OleDbType.Integer);

ms.Update();

// ms.Process(ProcessType.ProcessStructure);

MiningModel mm = ms.CreateMiningModel(true, "My Forecasting Model");

mm.Algorithm = MiningModelAlgorithms.MicrosoftDecisionTrees;

// mm.AlgorithmParameters.Add("COMPLEXITY_PENALTY", "{0.3}");

MiningModelColumn CustomerKey = mm.Columns.Add("CustomerKey1");

CustomerKey.SourceColumnID = "CustomerKey";

CustomerKey.Usage = MiningModelColumnUsages.Key;

MiningModelColumn HouseOwnerFlag = mm.Columns.Add("HouseOwnerFlag1");

HouseOwnerFlag.SourceColumnID = "HouseOwnerFlag";

HouseOwnerFlag.Usage = MiningModelColumnUsages.Predict;

//MiningModelColumn NumberCarsOwned = mm.Columns.Add("NumberCarsOwned1");

//NumberCarsOwned.SourceColumnID = "NumberCarsOwned";

//NumberCarsOwned.Usage = MiningModelColumnUsages.Input;

MiningModelColumn YearlyIncome = mm.Columns.Add("YearlyIncome1");

YearlyIncome.SourceColumnID = "YearlyIncome";

YearlyIncome.Usage = MiningModelColumnUsages.Predict;

mm.Update();

mm.Process(ProcessType.ProcessFull);

return ms;

}

GalogenOleg at 2007-9-9 > top of Msdn Tech,SQL Server,Data Mining...
# 4

I tried this out and it turns out that this is primarily a documentation bug (the secondary issue is that an internal error is returned instead of a more verbose validation error message). The source of the problem is the following line in the Books Online AMO code example that you copied:

MiningModel mm = ms.CreateMiningModel(true, "My Forecasting Model");

The CreateMiningModel method also copies over all the mining structure columns to the newly created model - all you need to do is set the algorithm and usage for the mining model columns. Since the code that follows adds the columns again, the mining model ends up with duplicate columns that point to the same mining structure column.

If you replace the above line with the following, the model will be created and processed successfully:.

MiningModel mm = new MiningModel("My Forecasting Model");

ms.MiningModels.Add(mm);

Alternatively, you could remove the code that adds the columns and just set the Usage for the existing columns (implicitly added by CreateMiningModel) appropriately.

Thank you for finding and reporting this issue. We'll fix the documentation in an upcoming web refresh and also track the secondary validation issue as a product bug.

RamanIyer at 2007-9-9 > top of Msdn Tech,SQL Server,Data Mining...

SQL Server

Site Classified