\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
csv.pre_user¶
View page sourceConvert Prediction Csv Files From dismod_at Notation to User csv.fit Notation¶
Prototype¶
# at_cascade.csv.pre_user
def pre_user(
fit_dir,
sim_dir,
job_table,
start_job_name,
predict_job_id_list,
node_table,
root_node_id,
root_split_reference_id,
root_database,
) :
assert type(fit_dir) == str
assert None == sim_dir or \
type(sim_dir) == str
assert type(job_table) == list
assert type( job_table[0] ) == dict
assert None == start_job_name or \
type( start_job_name ) == str
assert type(predict_job_id_list) == list
assert type( predict_job_id_list[0] ) == int
assert type(node_table) == list
assert type( node_table[0] ) == dict
assert type(root_node_id) == int
assert type(root_split_reference_id) == int
assert type(root_database) == str
fit_dir¶
Same as the csv fit fit_dir .
sim_dir¶
Same as sim_dir .
job_table¶
is the job_table for this cascade.
start_job_name¶
Is the name of the job (fit) that the predictions start at. This is a node name, followed by a period, followed by a sex. Only this fit, and its descendants, were included in the predictions. If this argument is None, all of the jobs (fits) were be included.
predict_job_id_list¶
Each element of this list is an index in the job_table of a job that was included in the predictions.
node_table¶
is the dismod_at node table for this cascade.
root_node_id¶
is the node table id for the root node of the cascade.
root_split_reference_id¶
is the split_reference table id for the root job of the cascade
root_database¶
specifies the location of the dismod_at root_database.
Input Prediction Files¶
Each job in the predict_job_id_list has a corresponding directory.
For prefix equal to fit , sam ,
the file prefix_prior.csv or prefix_posterior.csv
must exist in each of these directories
( see :ref:`pre_one_job@Csv Output Files` ).
In addition if *sim_dir is not None,
the file tru_prior.csv or true_posterior.csv
must also exist. These files use dismod_at notation.
Output Prediction Files¶
The predictions get converted to csv.predict notation; see Output Files .