GetDm

Syntax

DmMethodResult GetDm(DmMethod tArg)

Parameters

tArg. Data mining method parameters.

Description

The GetDm operation executes data mining.

Comments

To execute the operation, in the tArg field specify input and output data sources and specific settings of data mining method. The input data source should be opened for edit.

The operation results in the moniker of the report, to which data mining results were loaded, and an error message if errors occurred during the analysis.

Example

Below is the example of applying data mining. The request contains monikers of data provider and data consumer, type of method in use, and its settings.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDm xmlns="http://www.fsight.ru/PP.SOM.Som">
<tArg xmlns="">
<inputDataSource>
  <kind>DmReport</kind>
  <moniker>NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK!M!S!PMLFKAGGCGJPLFOAELHMPPKJEPKBGHJEEILCNPIBPFFNNKOJO</moniker>
<reportDataSource>
  <sheetIndex>0</sheetIndex>
<range>
  <left>0</left>
  <top>0</top>
  <width>7</width>
  <height>10</height>
  </range>
  </reportDataSource>
  <dataInColumns>true</dataInColumns>
  </inputDataSource>
<outputDataSource>
  <kind>DmReport</kind>
  <moniker>NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK!M!S!POBLIMLGCGJPLFOAEFBNGINPNNJMKKGNEFLDNBMEGFJGOOMKN</moniker>
  <dataInColumns>true</dataInColumns>
  </outputDataSource>
  <kind>KmodesClusterAnalysis</kind>
<details>
<kmodesClusterAnalysis>
<attributes>
<it>
  <index>0</index>
  </it>
<it>
  <index>3</index>
  </it>
  </attributes>
  <categoriesCount>2</categoriesCount>
  </kmodesClusterAnalysis>
  </details>
  </tArg>
  </GetDm>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDmResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <outputReport xmlns="">NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK</outputReport>
  </GetDmResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDm" :
{
"tArg" :
{
"inputDataSource" :
{
"kind" : "DmReport",
"moniker" : "NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK!M!S!PMLFKAGGCGJPLFOAELHMPPKJEPKBGHJEEILCNPIBPFFNNKOJO",
"reportDataSource" :
{
"sheetIndex" : "0",
"range" :
{
"left" : "0",
"top" : "0",
"width" : "7",
"height" : "10"
}
},
"dataInColumns" : "true"
},
"outputDataSource" :
{
"kind" : "DmReport",
"moniker" : "NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK!M!S!POBLIMLGCGJPLFOAEFBNGINPNNJMKKGNEFLDNBMEGFJGOOMKN",
"dataInColumns" : "true"
},
"kind" : "KmodesClusterAnalysis",
"details" :
{
"kmodesClusterAnalysis" :
{
"attributes" :
{
"it" :
[
{
"index" : "0"
},
{
"index" : "3"
}
]
},
"categoriesCount" : "2"
}
}
}
}
}

JSON response:

{
"GetDmResult" :
{
"outputReport" : "NJGNHPFCGJPLFOAEJIEHJJBIOJAKKBNEKKIELOKLJKFHPBCK"
}
}
public static DmMethodResult GetDm(string inputReportMoniker, string outputReportMoniker)
{
// Create a proxy object for operation execution
var somClient = new SomPortTypeClient();
// Set operation execution parameters
var tGet = new GetDm()
{
tArg = new DmMethod()
{
kind = DmMethodKind.KmodesClusterAnalysis,
inputDataSource = new DmDataSource()
{
kind = DmDataSourceKind.DmReport,
dataInColumns = true,
moniker = inputReportMoniker,
reportDataSource = new DmReportDataSource()
{
sheetIndex = 0,
range = new TabRange()
{
left = 0,
top = 0,
height = 10,
width = 7
}
}
},
outputDataSource = new DmDataSource()
{
kind = DmDataSourceKind.DmReport,
dataInColumns = true,
moniker = outputReportMoniker
},
details = new DmMethodDetails()
{
kmodesClusterAnalysis = new DmKmodesClusterAnalysis()
{
attributes = new DmField[] { new DmField() { index = 0 }, new DmField() { index = 3 } },
categoriesCount = 2
}
}
}
};
// Data mining
var result = somClient.GetDm(tGet);
return result;
}

See also:

Working with Modeling Container