tag:blogger.com,1999:blog-19467404.post7466609603810312366..comments2009-06-02T12:33:18.419-04:00Comments on Oracle Data Mining and Analytics: Way Cool: Linear Algebra in the Oracle Database 1Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-19467404.post-38437598848669899372009-06-02T10:28:53.435-04:002009-06-02T10:28:53.435-04:00do you have an example for multiple linear regress...do you have an example for multiple linear regression. thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-85334496537089483532008-08-01T08:33:00.000-04:002008-08-01T08:33:00.000-04:00Mikka,Oracle should do fine with larger matrices a...Mikka,<BR/><BR/>Oracle should do fine with larger matrices as well (as long as it has less than one million elements). The UTL_NLA package uses LAPACK routines. Those are very robust and the basis for linear algebra packages out there. If you could post your code and the data for the matrix in the ODM forum (<A HREF="http://forums.oracle.com/forums/forum.jspa?forumID=55" REL="nofollow">link</A>) Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-72961281050873776212008-07-31T05:16:00.000-04:002008-07-31T05:16:00.000-04:00Hi Marcos!I tried your 2nd example with my bigger ...Hi Marcos!<BR/><BR/>I tried your 2nd example with my bigger matrix and info parameter was 0 but the result was not right. I don't know why. I stored the matrix elemets in a table both Java and Oracle version and I got totally different results. With utl_nla I got much bigger elements than with Java version...Do you have any idea? I think with smaller matrix Oracle version works fine but with Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-22740872884760822432008-07-30T13:05:00.000-04:002008-07-30T13:05:00.000-04:00Hi Mikka,The UTL_NLA package does have some limita...Hi Mikka,<BR/><BR/>The UTL_NLA package does have some limitations on the size of the matrices it supports. However 124 is fine. The problem seems to be related with the method used to solve the problem. There are many different methods that you can pick depending on the special nature of the matrix. The one I used in the code uses LU decomposition. It seems that this decomposition fails for your Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-59074674765860521112008-07-30T09:25:00.000-04:002008-07-30T09:25:00.000-04:00Hi Marcos!Thanks for your example, it helped me. I...Hi Marcos!<BR/><BR/>Thanks for your example, it helped me. I've tried your example with a bigger matrix (n=124) and variable info was 114 after execution and the result was not right. I've used an external function wrote in JAVA to determine the inverse matrix and Java version gave right result. I suppose there are limitations in Oracle version. Am I right?<BR/><BR/>Thaks!<BR/><BR/>MikkaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-1936732731189097092008-07-29T08:31:00.000-04:002008-07-29T08:31:00.000-04:00Hi Mika,You can invert a matrix solving a system o...Hi Mika,<BR/><BR/>You can invert a matrix solving a system of linear equation AX = B like the ones I described in the post but setting B to the identity matrix.<BR/><BR/>For example, the following code inverts the matrix you gave in your question:<BR/>DECLARE<BR/> A utl_nla_array_dbl := utl_nla_array_dbl(<BR/> 5, 153, 352, <BR/> 153, 5899, 9697,<BR/> 352, Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-53046639600325720422008-07-16T11:44:00.000-04:002008-07-16T11:44:00.000-04:00Hi Marcos!Could you give me an example how to inve...Hi Marcos!<BR/><BR/>Could you give me an example how to inverse a matrix using UTL_NLA package? Which procedure should I use to get an inverted matrix?<BR/>For example:<BR/><BR/> v_A utl_nla_array_dbl:=utl_nla_array_dbl(5, 153, 352,<BR/>153, 5899, 9697,<BR/>352, 9697, 26086);<BR/><BR/>Thanks!<BR/><BR/>MikkaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-58442307266617499802008-05-07T08:08:00.000-04:002008-05-07T08:08:00.000-04:00The UTL_NLA package only supports matrices with up...The UTL_NLA package only supports matrices with up to 1M elements. Depending on what you would like to do there workarounds that can be used. Can you give some details about your use cases?Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-82243605265277194432008-05-07T02:28:00.000-04:002008-05-07T02:28:00.000-04:00Thanks for the post. It is really good. However, I...Thanks for the post. It is really good. However, I have one query. What if we want to work with a mtrix with more than 1mil elements. We have a need to cater for a matrix that is 3000 x 3000 elements.<BR/><BR/>Is there any way to do it still using the package or it just can't be done and will have to fall back to traditional coding.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-67304402922007587992008-03-31T09:26:00.000-04:002008-03-31T09:26:00.000-04:00Hi Henry,The problem the link pointed to is an exa...Hi Henry,<BR/><BR/>The problem the link pointed to is an example of linear programming (optimization). In this case the constraints are not equalities but inequalities (e.g., <= or >=). The UTL_NLA package does not have support for this type of problem.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-67456151542484010512008-03-29T20:54:00.000-04:002008-03-29T20:54:00.000-04:00Hi Marco, Great post. It gave me a good guide on ...Hi Marco,<BR/> Great post. It gave me a good guide on how to solve linear equations.<BR/><BR/> However, I can't seem to figure out how to solve "minimize" or "maximize" object functions.<BR/><BR/> An example of what I'm trying to solve is found in the link <A HREF="http://people.hofstra.edu/Stefan_Waner/Realworld/simplex.html" REL="nofollow">http://people.hofstra.edu/Stefan_Waner/Realworld/Henryhttp://www.blogger.com/profile/07282324464603392411noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-67255750975087755682007-11-15T15:04:00.000-05:002007-11-15T15:04:00.000-05:00I believe that the demo requires you to install so...I believe that the demo requires you to install some content from the Oracle RDBMS companion CD. This is the case for the data mining demos. See this <A HREF="http://download.oracle.com/docs/cd/B19306_01/datamine.102/b14338/sampleprogs.htm#sthref245<br/>" REL="nofollow">link</A> for instructions for the data mining demos. Follow similar steps for installing the sample files for UTL_NLA.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-6703738360583282482007-09-20T23:04:00.000-04:002007-09-20T23:04:00.000-04:00Hi Macro, New to ODM, interesting stuffs, thanks a...Hi Macro, <BR/>New to ODM, interesting stuffs, thanks a lot.<BR/><BR/>Get a question about OLS_Regression mentioned in your paragraph. My oracle is version 10g. Unfortunately, I can't find the OLS Regression object in my $ORACLE_HOME/plsql/demo. And an error was generated when trying to run the OLS_Regression example in the 'here' link. Could you please shed me some light on how OLS Regression Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-53327503323764810882007-09-13T19:59:00.000-04:002007-09-13T19:59:00.000-04:00Take a look at the procedures in my second post fo...Take a look at the procedures in my second post for reading and writing data from tables. In the case of reading you can actually specify a query. <A HREF="http://oracledmt.blogspot.com/2007/06/way-cooler-pca-and-visualization-linear.html" REL="nofollow">Here</A> is a link to the post.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-88233375067259089522007-08-21T15:46:00.000-04:002007-08-21T15:46:00.000-04:00Very interesting undocumented features! Is it poss...Very interesting undocumented features! <BR/><BR/>Is it possible to create a "utl_nla_array_dbl" data type dynamically from a select query instead of having to explicitly declare it like you do here:<BR/><BR/>A := utl_nla_array_dbl <BR/> (1, 2, 4,<BR/> 1, 1, 1);<BR/><BR/>I want to retrieve these values from a table.<BR/><BR/>Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-13534299037000031462007-07-14T01:47:00.000-04:002007-07-14T01:47:00.000-04:00Unfortunately I don't know of a book that explains...Unfortunately I don't know of a book that explains the routines in layman's terms. The BLAS and LAPACK routines were designed to support scientific programming. So they kind of assume knowledge about the methods they implement. A good book on scientific programming that covers many of the methods implemented by these routine is Numerical Recipes in C (there are versions for other languages as Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-2168381190282045742007-07-09T19:47:00.000-04:002007-07-09T19:47:00.000-04:00thanks a lot for the excellent coverage on utl_nla...thanks a lot for the excellent coverage on utl_nla.<BR/>i'm trying to understand blas and lapack routines. it seems like one should know a great deal about linear algebra to understand.<BR/>if possible could you please suggest a good book or a reference where each of these routines are explained in layman's terms.rv raonoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-90462450604596110882007-05-23T07:10:00.000-04:002007-05-23T07:10:00.000-04:00Thanks Davide. I did look around for examples of h...Thanks Davide. I did look around for examples of how to use UTL_NLA and there is very little out there. The next post will cover PCA and touch on the use of Singular Value Decomposition (SVD). Very powerful features.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-75833317936042111122007-05-23T06:17:00.000-04:002007-05-23T06:17:00.000-04:00At last one clarifying article about a very powerf...At last one clarifying article about a very powerful yet undiscovered feature of Oracle Thanks for sharing it with us. Please post more on this! If you have reccomended readings about this please share them with us! Thanks a lot.<BR/>Davide MoraschiDavide Moraschinoreply@blogger.comtag:blogger.com,1999:blog-19467404.post-40320652638793792652007-05-06T11:36:00.000-04:002007-05-06T11:36:00.000-04:00Thanks Venkat. I hope to have a second post on UTL...Thanks Venkat. I hope to have a second post on UTL_NLA soon. It will cover Principal Component Analysis and its uses in visualization and search.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.comtag:blogger.com,1999:blog-19467404.post-45968796678081420882007-05-05T18:19:00.000-04:002007-05-05T18:19:00.000-04:00Excellent stuff..thanks for sharing.Excellent stuff..thanks for sharing.Venkatnoreply@blogger.com