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 7775983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:45:43+00:00 2026-06-01T17:45:43+00:00

Now, I have separate any pair that is in common between the two input

  • 0

Now, I have separate any pair that is in common between the two input files. Find out the mean between that pair like this : (correlation in first text file)X(correlation in second text file)/ (correlation in first text file)+(correlation in second text file). Again store these in a separate matrix.

Building a tree :
Now, out of all the elements in both the input files, select the 10 most frequent ones. Each of these form the root of a separate K tree.The algorithm goes like this : For the word at the root level, check all its harmonic mean values with the other tags in the matrix that is developed in the previous step. Select the top two highest harmonic means, and put the other word in the tag pair as the child node of the root.

Can someone please guide me through the MATLAB steps of going through this? Thank you for your time.

  • 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-06-01T17:45:44+00:00Added an answer on June 1, 2026 at 5:45 pm

    Okay, so start by putting the data in a useful format; maybe count the number of distinct words, and make an N-by-M matrix of binary values (I’ll call this data1). Each of the N rows will describe the words associated with a single image. Each of the M columns will descibe the images for which a single word is tagged. Therefore, the value at (N, M) is 0 if tag M is not in image N, and 1 if it is.

    From this matrix, to find correlation between all pairs of words, you could do:

    correlations1 = zeros(M, M);
    for i=1:M
      for j=1:M
        correlations1(i, j) = corr(data1(:, i), data1(:, j));
      end
    end
    

    now the matrix correlations tells you the correlation between tags. Do the same for the other text file. You can make a matrix of harmonic means with:

    h_means = correlations1.*correlations2./(correlations1+correlations2);
    

    You can find the 30 most freqent tags by counting the number of 1s in each column of the data matrix. Since we want to find the most common tags in both files, we’ll add the data matricies first:

    [~, tag_ranks] = sort(sum(data1 + data2, 1), 'descending'); %get the indices in sorted order
    top_tags = tag_ranks(1:30);
    

    For the tree building at the end, you will either want to create a tree class (see classdef), or store the tree in an array. To find the top two highest harmonic means, you will want to look in the h_means matrix; for a tag m1, we can do:

    [~, tag_ranks] = sort(h_means(m1, :), 'descending');
    top_tag = tag_ranks(1);
    second_tag = tag_ranks(2);
    

    You will then need to insert these tags into the tree and repeat.

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

Sidebar

Related Questions

I now have a file uploader that goes on like this This is the
With help from you guys I now have a script that works like a
I have two separate processes: a C program that outputs comma separated values followed
I now have it set up so that when people go to a thank
I now have a running Java program which only lacks of the final step,that
in /usr/local i now have two mysql folders: mysql-5.1.34-osx10.5-x86 mysql-5.1.37-osx10.5-x86_64 is it possible to
Following on from this question I now have code that can attach to a
I have a server application that spins up and monitors about 8 separate processes
Lets say I have two separate databases, X and Y, on the same physical
I have a product which comes in two versions, and up to now 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.