sim

package
v0.0.0-...-894c189 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path = "mlscript/"
View Source
var ScriptName = "train.sh"

Functions

func Eigen

func Eigen(inputPath string, mu float64, k int) (*mat64.Dense, *mat64.Dense, error)

Run the script, generate a temporary file for output, parse it, delete it.

func EigenRaw

func EigenRaw(inputPath, outputPath string, mu float64, k int) error

Run the script at Path with arguments: inputPath, outputPath, mu, k.

func ParseEigenOutput

func ParseEigenOutput(path string) (*mat64.Dense, *mat64.Dense, error)

Parse the output file of the eigen algorithm. The format is: Qr Qc q1 q2 q3 ... Zr Zc z1 z2 z3 ...

Where: Qr - rows of Q; Qc - columns of Q; q1, q1, qn - elements of Q, ordered as:

Matrix: 1 2 3 4 5 6

Is written as: 1 3 5 2 4 5

Types

type Result

type Result struct {
	// contains filtered or unexported fields
}

In result, unlike in Matlab, the node IDs start from 0. In matlab and the CSV files provided, they start from 1.

func FromQZ

func FromQZ(q, z *mat64.Dense) *Result

FromQZ creates a result object form a q and a z matrix. Obtain those matrices from Eigen().

func (*Result) DistanceSim

func (r *Result) DistanceSim(from, to int) float64

Sim returns the similarity metric between two nodes.

func (*Result) Len

func (r *Result) Len() int

Len returns the number of nodes in the graph behind this Result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL