navigation

package
v0.0.0-...-3c9b827 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Gamma                float64 // The model's gamma parameter, a penalty for a node having too many children
	TerminationThreshold float64 // The threshold below which the learning algorithm stops
	TerminationWindow    int     // The number of prior iterations to account for in terminating
	MaxIters             int     // The node reachability below which we choose to delete a parent instead of adding a parent
}

Config for an organization

type IDNamePair

type IDNamePair struct {
	ID      int64
	Name    string
	Dataset string
}

type Node

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

Node is a node in the organization graph.

func ToDSNode

func ToDSNode(s graph.Node) *Node

func (*Node) Attributes

func (n *Node) Attributes() []encoding.Attribute

Attributes for the DOT encoding. Implements encoding.Attributer.

func (*Node) ID

func (n *Node) ID() int64

ID Returns the ID of the node, in order to conform to the graph.Node interface

func (*Node) Vector

func (n *Node) Vector() []float32

type ReachabilityPriorityQueue

type ReachabilityPriorityQueue []*Node

Use priority queue to get the least reachable nodes at a given level It implements the container/heap interface.

func (*ReachabilityPriorityQueue) HasNext

func (pq *ReachabilityPriorityQueue) HasNext() bool

func (ReachabilityPriorityQueue) Len

func (pq ReachabilityPriorityQueue) Len() int

func (ReachabilityPriorityQueue) Less

func (pq ReachabilityPriorityQueue) Less(i, j int) bool

func (*ReachabilityPriorityQueue) Pop

func (pq *ReachabilityPriorityQueue) Pop() interface{}

func (*ReachabilityPriorityQueue) Push

func (pq *ReachabilityPriorityQueue) Push(x interface{})

func (ReachabilityPriorityQueue) Swap

func (pq ReachabilityPriorityQueue) Swap(i, j int)

type ServeableNode

type ServeableNode struct {
	ID        int64
	NodeName  string
	Dataset   string
	ParentIDs []*IDNamePair
	ChildIDs  []*IDNamePair
}

ServeableNode a data structure containing node information for the frontend

func ToServeableNode

func ToServeableNode(O *TableGraph, s graph.Node) *ServeableNode

ToServeableNode converts a node in the organization into a node that is serveable

type TableGraph

type TableGraph struct {
	*simple.DirectedGraph
	// contains filtered or unexported fields
}

TableGraph the custom graph structure for an organization

func BuildInitialOrg

func BuildInitialOrg(db *database.DB, cfg *Config, ids []string) (*TableGraph, error)

buildInitialOrg builds the initial organization of the navigation graph.

The initial organization is a binary tree created by joining the most similar pairs of nodes under a parent node.

func BuildOrganization

func BuildOrganization(db *database.DB, ft *fasttext.FastText, cfg *Config, ids []string) (*TableGraph, error)

func (*TableGraph) CopyOrganization

func (O *TableGraph) CopyOrganization() *TableGraph

Wrapper around GoNum's implementation

func (*TableGraph) GetChildren

func (O *TableGraph) GetChildren(s graph.Node) []*Node

func (*TableGraph) GetParents

func (O *TableGraph) GetParents(s graph.Node) []*Node

func (*TableGraph) GetRootNode

func (O *TableGraph) GetRootNode() graph.Node

func (*TableGraph) MarshalDOT

func (O *TableGraph) MarshalDOT() ([]byte, error)

func (*TableGraph) SetRootName

func (O *TableGraph) SetRootName(name string)

func (*TableGraph) ToVisualizer

func (O *TableGraph) ToVisualizer(path string)

Jump to

Keyboard shortcuts

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