Discussion:
CLR plug in algorithm
(too old to reply)
Efstathios Mantadakis
2007-06-29 09:00:20 UTC
Permalink
Hi,

The past few days I am looking for a tutorial about how to develop my custom data mining algorithm. I downloaded 'A Tutorial for Constructing a Managed Plug-In Algorithm' but I have the following question:

Where should I find the DMPluginWrapper.dll. It mentions that it is included as source code, in the SRC\DMPluginWrapper folder. What project is this ? Where can I find it ?

Thank you
ST
Bogdan Crivat [MSFT]
2007-06-29 17:07:03 UTC
Permalink
Hi

Here is a link to the whole package (including source code for the tutorial,
the documentation CHM file and the tutorial)
http://download.microsoft.com/download/f/7/4/f74cbdb1-87e2-4794-9186-e3ad6bd54b41/DMMgdPlugInAPI.msi
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.

thanks,
bogdan
Post by Efstathios Mantadakis
Hi,
The past few days I am looking for a tutorial about how to develop my
custom data mining algorithm. I downloaded 'A Tutorial for Constructing a
Where should I find the DMPluginWrapper.dll. It mentions that it is
included as source code, in the SRC\DMPluginWrapper folder. What project
is this ? Where can I find it ?
Thank you
ST
Efstathios Mantadakis
2007-06-30 16:00:21 UTC
Permalink
Post by Bogdan Crivat [MSFT]
Hi
Here is a link to the whole package (including source code for the tutorial,
the documentation CHM file and the tutorial)
http://download.microsoft.com/download/f/7/4/f74cbdb1-87e2-4794-9186-e3ad6bd54b41/DMMgdPlugInAPI.msi
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.
thanks,
bogdan
Post by Efstathios Mantadakis
Hi,
The past few days I am looking for a tutorial about how to develop my
custom data mining algorithm. I downloaded 'A Tutorial for Constructing a
Where should I find the DMPluginWrapper.dll. It mentions that it is
included as source code, in the SRC\DMPluginWrapper folder. What project
is this ? Where can I find it ?
Thank you
ST
Thank you very much for your reply ! It seems that it is exactly what I want.

ST
Efstathios Mantadakis
2007-09-21 13:40:13 UTC
Permalink
Hello,

I downloaded the whole package. I opened the Shell project and I tried to build it but an error occurs. It says that the RegAsm program cannot find an assembly! Also I did exactly what the tutorial says but still no luck.

Please help, it is urgent.
Thanks
ST
Bogdan Crivat
2007-09-22 02:20:12 UTC
Permalink
Could you please post the error log (output) from the build? What assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried to build it but an error occurs. It says that the RegAsm program cannot find an assembly! Also I did exactly what the tutorial says but still no luck.
Please help, it is urgent.
Thanks
ST
a***@sqlserverdatamining.com
2007-09-27 16:20:22 UTC
Permalink
I solved the problem. The tutorial has a small mistake. The post build commands should be :

"C:/Windows/..../RegAsm.exe" "$TargetPath"
and not:
"C:/Windows/..../RegAsm.exe" $TargetPath

One more question, is it possible to apply my custom data mining algorithm to CLR UDTs ?

Thanks
Post by Bogdan Crivat
Could you please post the error log (output) from the build? What assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried to build it but an error occurs. It says that the RegAsm program cannot find an assembly! Also I did exactly what the tutorial says but still no luck.
Please help, it is urgent.
Thanks
ST
Bogdan Crivat [MSFT]
2007-09-27 16:59:11 UTC
Permalink
Thanks for letting us know of the problem
The Data Mining plug-in "sees" the data through the Analysis Services
server. As you may have noticed in the implementation, data is typically
encoded when it reaches the plug-in algorithm (as attribute/state)
Therefore, whether a custom data mining algorithm can use a SQL Server UDT
depends on whether Analysis Services data mining can use that type.

In brief: If you can use a UDT with a built-in algorithm (i.e. it can be
treated as a basic type) then you can use it in the plug-in, otherwise it
cannot be used
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.

thanks,
bogdan
Post by a***@sqlserverdatamining.com
"C:/Windows/..../RegAsm.exe" "$TargetPath"
"C:/Windows/..../RegAsm.exe" $TargetPath
One more question, is it possible to apply my custom data mining algorithm to CLR UDTs ?
Thanks
Post by Bogdan Crivat
Could you please post the error log (output) from the build? What
assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried
to build it but an error occurs. It says that the RegAsm program cannot
find an assembly! Also I did exactly what the tutorial says but still
no luck.
Please help, it is urgent.
Thanks
ST
a***@sqlserverdatamining.com
2007-09-28 10:20:12 UTC
Permalink
Thank you very much for your reply !

I read that I have to create a named query in my data source view and refer to UDT properties
and methods that return scalar values from the column of the UDT type, like
SELECT MyUDTcol.Property1, MyUDTcol.Property2...
Also I can use the default ToString method, if it returns string that
makes sense for my mining model.
If I refer to UDT directly, without an
explicit property, like
SELECT MyUDTcol,
SQL Servr returns binary string (the serialized UDT).
If I have a reference of my UDT Dll file to the plug in algorithm project will I be able to cast it to UDT ?

Thank you, I am new to .NET and I a need some help.

ST
Post by Bogdan Crivat [MSFT]
Thanks for letting us know of the problem
The Data Mining plug-in "sees" the data through the Analysis Services
server. As you may have noticed in the implementation, data is typically
encoded when it reaches the plug-in algorithm (as attribute/state)
Therefore, whether a custom data mining algorithm can use a SQL Server UDT
depends on whether Analysis Services data mining can use that type.
In brief: If you can use a UDT with a built-in algorithm (i.e. it can be
treated as a basic type) then you can use it in the plug-in, otherwise it
cannot be used
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.
thanks,
bogdan
Post by a***@sqlserverdatamining.com
I solved the problem. The tutorial has a small mistake. The post build
"C:/Windows/..../RegAsm.exe" "$TargetPath"
"C:/Windows/..../RegAsm.exe" $TargetPath
One more question, is it possible to apply my custom data mining algorithm
to CLR UDTs ?
Thanks
Post by Bogdan Crivat
Could you please post the error log (output) from the build? What
assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried
to build it but an error occurs. It says that the RegAsm program cannot
find an assembly! Also I did exactly what the tutorial says but still
no luck.
Please help, it is urgent.
Thanks
ST
Bogdan Crivat [MSFT]
2007-09-28 16:24:11 UTC
Permalink
Post by a***@sqlserverdatamining.com
If I have a reference of my UDT Dll file to the plug in algorithm project
will I be able to cast it to UDT ?
Not easily.
When doing data mining on top of a string attribute (column), the server
performs the following encoding steps:
- extracts all distinct strings from inside the relational data source
- maps all distinct strings to a number (named state)
- presents the specific String value to the (plug-in or built-in) algorithm
as a number (an attribute state)
The assumption is that, for discrete attributes, a data mining algorithm
cares about the statistical properties of a column and cross-correlations
between multiple column states rather than the absolute values of a column.
This encoding process is performed by analysis services before giving
control to the plug-in algorithm so that all algorithm see training data in
the same way, regardless of the actual underlying data type.

Now, for a given numeric state of a column, there is a method in the
AttributeSet class, GetAttributeStateValue, which returns the actual object
(string or a different type) represented by a state.
Using this mechanism during training is inefficient, but possible, and
allows you to get access to the actual strings inside the plug-in algorithm.
Now, using a reference to your UDT DLL you might be able to deserialize the
string. It will only work for real strings(such as an XML serialization) and
not for binary streams of bytes.

However, some problems appear during prediction. Assume that a serialization
of an UDT is presented, as a string, to the algorithm, to be used as input.
If that string was encountered during training, it is mapped to the
respective numeric attribute state and transmitted to the plug-in .
If, however, that string was not encountered, it is always mapped to the
numeric state 0, which denotes Missing (a NULL or never encoutered before
state) and there is no way to access, inside the plug-in, the actual input
string.


The named query solution is much better, as it solves all these problems
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.

thanks,
bogdan
Post by a***@sqlserverdatamining.com
Thank you very much for your reply !
I read that I have to create a named query in my data source view and
refer to UDT properties
and methods that return scalar values from the column of the UDT type, like
SELECT MyUDTcol.Property1, MyUDTcol.Property2...
Also I can use the default ToString method, if it returns string that
makes sense for my mining model.
If I refer to UDT directly, without an
explicit property, like
SELECT MyUDTcol,
SQL Servr returns binary string (the serialized UDT).
If I have a reference of my UDT Dll file to the plug in algorithm project
will I be able to cast it to UDT ?
Thank you, I am new to .NET and I a need some help.
ST
Post by Bogdan Crivat [MSFT]
Thanks for letting us know of the problem
The Data Mining plug-in "sees" the data through the Analysis Services
server. As you may have noticed in the implementation, data is typically
encoded when it reaches the plug-in algorithm (as attribute/state)
Therefore, whether a custom data mining algorithm can use a SQL Server UDT
depends on whether Analysis Services data mining can use that type.
In brief: If you can use a UDT with a built-in algorithm (i.e. it can be
treated as a basic type) then you can use it in the plug-in, otherwise it
cannot be used
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.
thanks,
bogdan
Post by a***@sqlserverdatamining.com
I solved the problem. The tutorial has a small mistake. The post build
"C:/Windows/..../RegAsm.exe" "$TargetPath"
"C:/Windows/..../RegAsm.exe" $TargetPath
One more question, is it possible to apply my custom data mining algorithm
to CLR UDTs ?
Thanks
Post by Bogdan Crivat
Could you please post the error log (output) from the build? What
assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried
to build it but an error occurs. It says that the RegAsm program cannot
find an assembly! Also I did exactly what the tutorial says but still
no luck.
Please help, it is urgent.
Thanks
ST
a***@sqlserverdatamining.com
2007-09-29 09:00:13 UTC
Permalink
Thanks again for your help I appreciate it!

So to sum up : If I use the binary string it will be difficult to cast the value to my Udt.Is that right?
If I use the named query and get the ToString() value of my UDT, am I going to be able to cast or construct an instance of my UDT?


ST
Post by Bogdan Crivat [MSFT]
Post by a***@sqlserverdatamining.com
If I have a reference of my UDT Dll file to the plug in algorithm project
will I be able to cast it to UDT ?
Not easily.
When doing data mining on top of a string attribute (column), the server
- extracts all distinct strings from inside the relational data source
- maps all distinct strings to a number (named state)
- presents the specific String value to the (plug-in or built-in) algorithm
as a number (an attribute state)
The assumption is that, for discrete attributes, a data mining algorithm
cares about the statistical properties of a column and cross-correlations
between multiple column states rather than the absolute values of a column.
This encoding process is performed by analysis services before giving
control to the plug-in algorithm so that all algorithm see training data in
the same way, regardless of the actual underlying data type.
Now, for a given numeric state of a column, there is a method in the
AttributeSet class, GetAttributeStateValue, which returns the actual object
(string or a different type) represented by a state.
Using this mechanism during training is inefficient, but possible, and
allows you to get access to the actual strings inside the plug-in algorithm.
Now, using a reference to your UDT DLL you might be able to deserialize the
string. It will only work for real strings(such as an XML serialization) and
not for binary streams of bytes.
However, some problems appear during prediction. Assume that a serialization
of an UDT is presented, as a string, to the algorithm, to be used as input.
If that string was encountered during training, it is mapped to the
respective numeric attribute state and transmitted to the plug-in .
If, however, that string was not encountered, it is always mapped to the
numeric state 0, which denotes Missing (a NULL or never encoutered before
state) and there is no way to access, inside the plug-in, the actual input
string.
The named query solution is much better, as it solves all these problems
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.
thanks,
bogdan
Post by a***@sqlserverdatamining.com
Thank you very much for your reply !
I read that I have to create a named query in my data source view and
refer to UDT properties
and methods that return scalar values from the column of the UDT type, like
SELECT MyUDTcol.Property1, MyUDTcol.Property2...
Also I can use the default ToString method, if it returns string that
makes sense for my mining model.
If I refer to UDT directly, without an
explicit property, like
SELECT MyUDTcol,
SQL Servr returns binary string (the serialized UDT).
If I have a reference of my UDT Dll file to the plug in algorithm project
will I be able to cast it to UDT ?
Thank you, I am new to .NET and I a need some help.
ST
Post by Bogdan Crivat [MSFT]
Thanks for letting us know of the problem
The Data Mining plug-in "sees" the data through the Analysis Services
server. As you may have noticed in the implementation, data is typically
encoded when it reaches the plug-in algorithm (as attribute/state)
Therefore, whether a custom data mining algorithm can use a SQL Server UDT
depends on whether Analysis Services data mining can use that type.
In brief: If you can use a UDT with a built-in algorithm (i.e. it can be
treated as a basic type) then you can use it in the plug-in, otherwise it
cannot be used
--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.
thanks,
bogdan
Post by a***@sqlserverdatamining.com
I solved the problem. The tutorial has a small mistake. The post build
"C:/Windows/..../RegAsm.exe" "$TargetPath"
"C:/Windows/..../RegAsm.exe" $TargetPath
One more question, is it possible to apply my custom data mining algorithm
to CLR UDTs ?
Thanks
Post by Bogdan Crivat
Could you please post the error log (output) from the build? What
assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios Mantadakis
Hello,
I downloaded the whole package. I opened the Shell project and I tried
to build it but an error occurs. It says that the RegAsm program cannot
find an assembly! Also I did exactly what the tutorial says but still
no luck.
Please help, it is urgent.
Thanks
ST
a***@sqlserverdatamining.com
2007-07-08 21:00:17 UTC
Permalink
Post by Efstathios Mantadakis
Hi,
Where should I find the DMPluginWrapper.dll. It mentions that it is included as source code, in the SRC\DMPluginWrapper folder. What project is this ? Where can I find it ?
Thank you
ST
Loading...