[][src]Struct lib_dachshund::dachshund::transformer::Transformer

pub struct Transformer {
    pub core_type: String,
    pub non_core_type_ids: Rc<NonCoreTypeIds>,
    pub non_core_types: Rc<Vec<String>>,
    pub line_processor: Arc<TypedGraphLineProcessor>,
    pub edge_types: Rc<Vec<String>>,
    pub beam_size: usize,
    pub alpha: f32,
    pub global_thresh: Option<f32>,
    pub local_thresh: Option<f32>,
    pub num_to_search: usize,
    pub num_epochs: usize,
    pub max_repeated_prior_scores: usize,
    pub num_non_core_types: usize,
    pub debug: bool,
    pub min_degree: usize,
    pub long_format: bool,
    // some fields omitted
}

Used to set up the typed graph clique mining algorithm.

Fields

core_type: Stringnon_core_type_ids: Rc<NonCoreTypeIds>non_core_types: Rc<Vec<String>>line_processor: Arc<TypedGraphLineProcessor>edge_types: Rc<Vec<String>>beam_size: usizealpha: f32global_thresh: Option<f32>local_thresh: Option<f32>num_to_search: usizenum_epochs: usizemax_repeated_prior_scores: usizenum_non_core_types: usizedebug: boolmin_degree: usizelong_format: bool

Implementations

impl Transformer[src]

pub fn process_typespec(
    typespec: Vec<Vec<String>>,
    core_type: &str,
    non_core_types: Vec<String>
) -> CLQResult<NonCoreTypeIds>
[src]

processes a "typespec", a command-line argument, of the form: [["author", "published_in", "journal"], ["author", "co-authored", "article"]]. This sets up the semantics related to the set of relations contained in the typed graph. A requirement is that all relations share a "core" type, in this case, "author". Non-core types must be listed in a vector, which is used to index the non core-types. The function creates a vector of NonCoreTypeIds, which will then be used to process input rows.

pub fn new(
    typespec: Vec<Vec<String>>,
    beam_size: usize,
    alpha: f32,
    global_thresh: Option<f32>,
    local_thresh: Option<f32>,
    num_to_search: usize,
    num_epochs: usize,
    max_repeated_prior_scores: usize,
    debug: bool,
    min_degree: usize,
    core_type: String,
    long_format: bool
) -> CLQResult<Self>
[src]

Called by main.rs module to set up the beam search. Parameters are as follows:

  • typespec: a command-line argument, of the form: [["author", "published_in", "journal"], ["author", "co-authored", "article"]]. This sets up the semantics related to the set of relations contained in the typed graph. A requirement is that all relations share a "core" type, in this case, "author".
  • beam_size: Beam construction parameter. The number of top candidates to maintain as potential future cores for expansion in the "beam" (i.e., the list of top candidates).
  • alpha: Scorer constructor parameter. Controls the contribution of density
  • global_thresh: Scorer constructor parameter. If provided, candidates must be at least this dense to be considered valid (quasi-)cliques.
  • local_thresh: Scorer constructor parameter. if provided, each node in the candidate must have at least local_thresh proportion of ties to other nodes in the candidate, for the candidate to be considered valid.
  • num_to_search: number of expansion candidates to consider for each candidate in the beam.
  • num_epochs: maximum number of epochs to run search for.
  • max_repeated_prior_scores: maximum number of times for which the top score can be repeated in consecutive epochs, before the search gets shut down early.
  • debug: whether to produce verbose output in the search process.
  • min_degree: minimum degree required for each node in a (quasi-)clique in order for the subgraph to be considered interesting.
  • core_type: the core type, as found in the typespec.
  • long_format: whether to output results in long format, of the form: graph_id\tnode_id\tnode_type, instead of the more user-friendly (but machine-unfriendly) wide format.

pub fn from_argmatches(matches: ArgMatches<'_>) -> CLQResult<Self>[src]

constructs a transformer from an ArgMatches object (to help with command line arguments).

pub fn build_pruned_graph<TGraphBuilder: GraphBuilder<TGraph>, TGraph: GraphBase>(
    &self,
    graph_id: GraphId,
    rows: &Vec<EdgeRow>
) -> CLQResult<TGraph>
[src]

builds graph, pruned to ensure all nodes have at least self.min_degree degree with other nodes in the graph. This is done via a greedy algorithm which removes low-degree nodes iteratively.

pub fn process_graph<'a, TGraph: GraphBase>(
    &'a self,
    graph: &'a TGraph,
    clique_rows: &'a Vec<CliqueRow>,
    graph_id: GraphId,
    verbose: bool
) -> CLQResult<BeamSearchResult<'a, TGraph>>
[src]

Given a properly-built graph, runs the quasi-clique detection beam search on it.

pub fn process_clique_rows<'a, TGraphBuilder: GraphBuilder<TGraph>, TGraph: GraphBase>(
    &'a self,
    graph: &'a TGraph,
    clique_rows: &'a Vec<CliqueRow>,
    graph_id: GraphId,
    verbose: bool,
    output: &Sender<(Option<String>, bool)>
) -> CLQResult<Option<BeamSearchResult<'a, TGraph>>>
[src]

Used to "seed" the beam search with an existing best (quasi-)clique (if any provided), and then run the search under the parameters specified in the constructor.

Trait Implementations

impl TransformerBase for Transformer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,