Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:36:47+00:00 2026-05-28T19:36:47+00:00

i am making using of the jama package for finding the lsa . I

  • 0

i am making using of the jama package for finding the lsa . I was told to reduce the dimensionality and hence i have reduced it to 3 in this case and i reconstruct the matrix . But the resultant matrix is very different from the one i had given to the system

heres the code

    a = new Matrix(termdoc); // get the matrix here 
    a = a.transpose() ; // since the matrix is in the form of doc * terms i transpose it 
    SingularValueDecomposition sv =new SingularValueDecomposition(a) ; 
    u = sv.getU();
    v = sv.getV(); 
    s = sv.getS();
    uarray = u.getArray();
    sarray = s.getArray(); 
    varray = v.getArray(); 
    sarray_mod = new double[3][3]; //reducing dimension 
    uarray_mod = new double[uarray.length][3];
    varray_mod = new double[3][varray.length]; 
    move(sarray,3,3,sarray_mod); // my method to move the contents 
    move(uarray,uarray.length,3,uarray_mod); 
    move(varray,3,varray.length,varray_mod); 
    e = new Matrix(uarray_mod); 
    f = new Matrix(sarray_mod);
    g = new Matrix(varray_mod);
    Matrix temp  =e.times(f); 
    result = temp.times(g); 
    result = result.transpose(); 
    results = result.getArray() ; 
    System.out.println(" The array after svd : \n"); 
    print(results);// my method to print the array 

 private static void move(double[][] sarray2, int r, int c,
        double[][] sarrayMod) {
    // TODO Auto-generated method stub 
    for(int i=0;i<r;i++)
        for(int t=0;t<c;t++)
            sarrayMod[i][t]=sarray2[i][t];

}

A sample output with just 3 files of which two are the similar

0.25 0 0 0 0 0 0 0 0.25 0 0.25 0.25 0 

0 0.083 0.083 0.083 0.083 0.083 0.083 0.083 0 0.083 0.083 0.167 0.083 

0.25 0 0 0 0 0 0 0 0.25 0 0.25 0.25 0 

The array after svd :

0.225 0.029 0.029 0.029 0.029 0.029 0.029 0.029 0.225 0.029 0.253 0.282 0.029 

-0.121 0.077 0.077 0.077 0.077 0.077 0.077 0.077 -0.121 0.077 -0.044 0.033 0.077 

0.245 0.012 0.012 0.012 0.012 0.012 0.012 0.012 0.245 0.012 0.257 0.269 0.012 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:36:48+00:00Added an answer on May 28, 2026 at 7:36 pm

    Go through the example Here

    In the example, we take first 2 columns from U,S and V . And then we multiply them. It wont result to give you the same matrix but will enhance the performance in similarity.

    If you have gone through the example, you will find that the similarity between user and human was in -ve. But after we performed SVD , similarity increased to a +ve value close to 1.

    I think the way you are moving is correct. Just go through the example once.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a website using JSP and servlets and I have to now break
I'm making a winform in C# using Visual Studio 2008. Currently, I have a
I am making a 3D cube using kit3D.this cube is generated at run time.I
Good day everyone. I have a question about making and using derived classes of
In a game that I am making whilst using Cocos2d, I have a sprite
I always have a problem when making webpages using input or select boxes in
We have a system wherein numerous retrieval/updation operations can be performed using making http
i am making a game using andengine in android, in this game various sprites(eggs)
I am making a activity using Tab-Host. I have two tabs. When I start
I have a social network that I am making using php and mysql. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.