Groups | Blog | Home
all groups > sql server data mining > march 2005 >

sql server data mining : Connecting analysis server to c#.net



pras kumar
3/7/2005 3:45:23 PM



Hi Jamie MacLennan,
I want to make use of the rules to a user given input.I have
uploaded the kddcup1999 intrusion detection dataset and i have generated
a tree using decision tree algorithm which is in graphical format.I want
to make use of these rules to the user given input.I am planning to
create a user interface in c#.Is there any way that i can connect c# and
analysis server to make use of these rules on the user given input.

*** Sent via Developersdex http://www.developersdex.com ***
Jamie MacLennan (MS)
3/8/2005 9:26:03 AM
You simply use ADO.Net to connect to the server like you would any other
database source e.g.
(this is from memory, so you will have to validate)

AdoConnection con;
AdoCommand cmd;
AdoDataReader reader;

con = new AdoConnection();
cmd = new AdoCommand();

con.ConnectionString="Provider=MSOLAP;Location=MyServer;Initial
Catalog=MyDatabase";
con.Open();
cmd.Connection=con;
cmd.CommandText="<my prediction query>";
reader = cmd.ExecuteReader();
while (reader.Read())
{
// work with data
}
reader.Close();
con.Close();

For the prediction query you want to use a singleton prediction. For
example, the following DMX query will retrieve the predicted credit risk
along with the confidence of the prediction given the inputs

SELECT Predict([Credit Risk]), PredictProbability([Credit Risk]) FROM
CreditModel NATURAL PREDICTION JOIN
(SELECT 45000 AS [Income], 'Male' AS [Gender], 'Single' AS [Marital Status],
32 AS [Age]) AS t

For help in creating DMX queries, you can download the DMSample application
and sample queries from www.sqlserverdatamining.com
--

-Jamie MacLennan
SQL Server Data Mining
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view]

AddThis Social Bookmark Button