FillTarget;
The FillTarget method loads missing data treatment results into the data source.
Loading of results is available only after method calculation.
Executing the example requires that the repository contains a table with the DATAMINING_DATA identifier. The table must consist of several columns containing only numeric values. The part of values must be missing in the last column.
Add links to the Metabase, Ms, Stat system assemblies.
Sub UserProc;
Var
mb: IMetabase;
TableDS: IDmTableDataSource;
Method: IDmMethod;
BackProp: IDmBackPropagation;
i: Integer;
Attrs: Array Of Integer;
Begin
mb := MetabaseClass.Active;
// Create table data source
TableDS := (New TableDataSource.Create) As IDmTableDataSource;
// Determine source table
TableDS.Table := mb.ItemByID("DATAMINING_DATA").Bind;
// Create calculation method
Method := (New DataMiningMethod.Create) As IDmMethod;
// Specify method type
Method.Kind := DmMethodKind.BackPropagation;
// Set input data source
Method.InputDataSource := TableDS;
// Set data consumer
Method.OutputDataSource := TableDS;
// Set up calculation method parameters
BackProp := Method.Details As IDmBackPropagation;
// Determine column for analysis
BackProp.Target := TableDS.FieldCount - 1;
// Set factors that influence analysis
Attrs := New Integer[TableDS.FieldCount - 2];
For i := 0 To Attrs.Length - 1 Do
Attrs[i] := i + 1;
End For;
BackProp.Attributes := Attrs;
// Perform analysis
Method.Execute;
// Check if results can be loaded
If TableDS.ReadOnly = False Then
// Load results into source table
BackProp.FillTarget;
TableDS.Save;
Else
// Display message that loading is not available
Debug.WriteLine("Data source is read-only. " +
"Saving results to data source is not available." );
End If;
End Sub UserProc;
After executing the example missing data is substituted in the last column of the DATAMINING_DATA table by means of the back-propagation network. Treatment results are loaded to the source table.
See also: