Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Importing R cosine similarity to UNIX? Post 302767747 by A-V on Thursday 7th of February 2013 11:28:10 AM
Old 02-07-2013
I have two files each of 6 lines each representing the frequency of specific words
now I wanted to calculate the cosine similarity between these files

for R I simply combine both files and extracted the bits from overall matrix that I needed
Code:
test <- as.matrix(read.csv(file="file.csv", sep=",", header=FALSE)) 
result<- cosine(t(test))
result-files <- (result[7:12,1:6])

I know that is not the best solution but it was easier as I am new to both languages

I have tried to get R running in cygwin but didnt manage... so now I am wondering whether it is possible to do cosine similarity calculations in unix... is there any shortcuts on doing so?

I a working on windows Vista

Cheers
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

importing database from unix to winnt

i am a unix-super-beginner (swaddled and weaned on windows) and am trying to import a database from a unix directory into winnt. can someone help me or am i a hopeless case? (4 Replies)
Discussion started by: sadiecutie
4 Replies

2. UNIX for Dummies Questions & Answers

Importing a unix file dump into a PC capable database

My development team has been trying to figure out how to import a unix data dump into SQL Server or convert it into an intermediate file format for several days. The data dump in question looks like this: $RecordID: 1<eof> $Version: 1<eof> Category: 1<eof> Poster: John Doe<eof>... (7 Replies)
Discussion started by: DaltonF
7 Replies

3. UNIX for Advanced & Expert Users

building flat files in unix and importing them from windows

what is a flat file in unix? i have to import a unix flat files from windows based programme. my question is not to export from unix but only to import from windows only. how to build that flat files? how to create export to windows how to import from windows (3 Replies)
Discussion started by: tunirayavarapu
3 Replies

4. Shell Programming and Scripting

awk? create similarity matrix by calculating overlaps between sets comprising of individual parts

Hi everyone I am very new at awk and to me the task I need to get done is very very challenging... Nevertheless, after admiring how fast and elegant issues are being solved here I am sure this is my best chance. I have a 2D data file (input file is a plain tab-delimited text file). The first... (1 Reply)
Discussion started by: stonemonkey
1 Replies

5. Shell Programming and Scripting

Help with merge data based on similarity

Input_file data1 USA 100 ASE data3 UK 20 GWQR data4 Brazil 40 QWE data2 Scotland 60 THWE data5 USA 40 QWERR Reference_file USA 12312 34532 1324 Brazil 23321 231 3421 Scotland 342 34235 UK 231 141 England... (1 Reply)
Discussion started by: patrick87
1 Replies

6. Shell Programming and Scripting

Help with sort list of file based on similarity

Input file (long list of input file): s_1_1_AABCD.txt s_1_1_ABADA.txt s_1_1_DSCBA.txt s_1_1_DSCCA.txt s_1_1_EATTG.txt s_1_1_FADSD.txt s_1_1_TGACC.txt s_1_1_TTAGG.txt s_1_2_AABCD.txt s_1_2_ABADA.txt s_1_2_DSCBA.txt s_1_2_DSCCA.txt s_1_2_EATTG.txt s_1_2_FADSD.txt ... (1 Reply)
Discussion started by: perl_beginner
1 Replies

7. UNIX for Advanced & Expert Users

Vector base Cosine Similarity for two Matrices -- R in UNIX

Dear All, I am facing a problem and I would be Thankful if you can help Hope this is the right place to ask this question I have two matrices of (row=10, col=3) and I want to get the cosine similarity between two lines (vectors) of each file --> the result should be (10,1) of cosine measures I... (10 Replies)
Discussion started by: A-V
10 Replies
MKCFM(1)						      General Commands Manual							  MKCFM(1)

NAME
mkcfm - create summaries of font metric files in CID font directories SYNOPSIS
mkcfm [CID-font-directory-name] DESCRIPTION
There is usually only one CID font directory on the X font path. It is usually called /usr/X11R6/lib/X11/fonts/CID. If you do not specify an argument, mkcfm will try to go through the subdirectories of that directory, and create one summary of font metric files for each CID- Font (character descriptions) file and each CMap (Character Maps) file it finds. The summaries of font metric files are put in the existing CFM subdirectory. The CFM subdirectories are created when CID-keyed fonts are installed. If you specify a CID font directory as an argument, mkcfm will try to go through the subdirectories of that directory, and create one sum- mary of font metric files for each CIDFont file and each CMap file it finds. mkcfm will calculate the summaries of the font metric files stored in AFM subdirectories of the CID font directory. Those summaries are needed by the rasterizer of CID-keyed fonts to speed up the response to X font calls. If those files do not exist, CID rasterizer will have to go through usually large font metric files, and calculate the summaries itself each time the font is called. You will notice a substantial wait on a call to a large CID-keyed font. FILES
.afm files Each CID-keyed font file is supposed to have a font metric file (.afm file). mkcfm creates summary files (.cfm files) of those font metric files. mkcfm should be run whenever a change is made to the files stored in the subdirectories of the CID font directory. For example, it should be run when new CID fonts are installed. .cfm files Summaries of font metric (.afm) files created by mkcfm. SEE ALSO
The rasterizer for CID-keyed fonts in the directory xc/lib/font/Type1. CID Fonts Version 1.0 Release 1.0 MKCFM(1)
All times are GMT -4. The time now is 12:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy