SimMat - emer/etable GitHub Wiki

The simat package makes it easy to create similarity / distance matricies based on a Tensor or Table (actually an IdxView of a table for more flexibility).

The SimMat type contains the Tensor of the similarity matrix values, and labels for the Rows and Columns.

The etview package provides a SimMatGrid widget that displays the SimMat with the labels.

IMPORTANT You must do this in your import section to get the etview to work:

import (
	_ "github.com/emer/etable/etview" // include to get gui views
)

TableCol example

The TableCol method does a similarity matrix of a given column of data in a table, using an IdxView of the table:

	rels = etable.NewIdxView(ss.TstTrlLog)
	rels.SortCol(ss.TstTrlLog.ColIdx("TrialName"), true) // any repeated trial names will be grouped
	ss.HiddenRel.SimMat.TableCol(rels, "Hidden", "TrialName", true, metric.Cosine64) // true = blank repeats