[−][src]Struct lib_dachshund::dachshund::transformer::Transformer
Used to set up the typed graph clique mining algorithm.
Fields
core_type: String
non_core_type_ids: Rc<NonCoreTypeIds>
non_core_types: Rc<Vec<String>>
line_processor: Arc<TypedGraphLineProcessor>
edge_types: Rc<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
num_non_core_types: usize
debug: bool
min_degree: usize
long_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]
typespec: Vec<Vec<String>>,
core_type: &str,
non_core_types: Vec<String>
) -> CLQResult<NonCoreTypeIds>
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]
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>
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 densityglobal_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 leastlocal_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]
&self,
graph_id: GraphId,
rows: &Vec<EdgeRow>
) -> CLQResult<TGraph>
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]
&'a self,
graph: &'a TGraph,
clique_rows: &'a Vec<CliqueRow>,
graph_id: GraphId,
verbose: bool
) -> CLQResult<BeamSearchResult<'a, TGraph>>
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]
&'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>>>
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]
fn get_line_processor(&self) -> Arc<dyn LineProcessorBase>
[src]
fn process_row(&mut self, row: Box<dyn Row>) -> CLQResult<()>
[src]
fn reset(&mut self) -> CLQResult<()>
[src]
fn process_batch(
&self,
graph_id: GraphId,
output: &Sender<(Option<String>, bool)>
) -> CLQResult<()>
[src]
&self,
graph_id: GraphId,
output: &Sender<(Option<String>, bool)>
) -> CLQResult<()>
fn run(&mut self, input: Input<'_>, output: Output<'_>) -> CLQResult<()>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Transformer
impl !Send for Transformer
impl !Sync for Transformer
impl Unpin for Transformer
impl !UnwindSafe for Transformer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,