\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
csv.ancestor_fit¶
View page sourceDetermine Closet Ancestor With Fit and Samples¶
Prototype¶
# at_cascade.csv.ancestor_fit
def ancestor_fit(
fit_dir,
job_table,
predict_job_id,
node_table,
root_node_id,
split_reference_table,
root_split_reference_id,
at_cascade_log_dict,
allow_same_job,
) :
assert type(fit_dir) == str
assert type(job_table) == list
assert type(predict_job_id) == int
assert type(node_table) == list
assert type( root_node_id ) == int
assert type(split_reference_table) == list
assert type( root_split_reference_id) == int
assert type( at_cascade_log_dict ) == dict
assert type( allow_same_job ) == bool
assert type(predict_job_dir) == str
if type(ancestor_job_dir) == str :
assert predict_job_dir.startswith(ancestor_job_dir)
else :
assert ancestor_job_dir == None
#
return predict_job_dir, ancestor_job_dir
fit_dir¶
is the directory where the csv files are located.
job_table¶
is the job_table for this cascade.
predict_job_id¶
is the job_id for this prediction.
node_table¶
is the list of dict corresponding to the node table for this cascade.
root_node_id¶
is the node_id in the node table for the root node for this cascade. Note that csv version of the cascade does its sex split at this node.
root_split_reference_id¶
is the split_reference_id (sex id) for the root node of the cascade. The cascade can begin at female, both, or male.
at_cascade_log_dict¶
is a dictionary, with keys equal to job names, containing
the log messages that have type at_cascade .
The messages for each key are in the log table for the corresponding job.
allow_same_job¶
If this is true (false) the a job corresponding to the ancestor fit can be the same as the job for the prediction; i.e., the predict job is the closest ancestor job. Otherwise, the parent of the predict job is the closest ancestor job.
predict_job_dir¶
This is the directory, relative to the fit_dir, that corresponds to the predict_job_id . See get_database_dir .
ancestor_job_dir¶
This is the directory, relative to the fit_dir,
that corresponds to the closest ancestor of predict_job_id
that had a successful fit and posterior sampling.
To be specific, sample: OK is in its
log .