Post by a***@sqlserverdatamining.comIf 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.comThank 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.comI 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 CrivatCould you please post the error log (output) from the build? What
assembly cannot be found? DMPluginWrapper or the Shell?
Post by Efstathios MantadakisHello,
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