Skip to content

Commit fcb23e0

Browse files
committed
Updated documentation (#23)
Added short description and code of the PIG plotting function.
1 parent 002bc57 commit fcb23e0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/source/tutorial.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,18 @@ Now that we have build and selected a final model, it is time to evaluate it aga
180180
181181
evaluator.plot_cumulative_response_curve()
182182
183-
Additionally, we can also compute the output needed to plot the so-called Predictor Insights Graphs (PIGs in short). These are graphs that represents the insights of the relationship between a single predictor (e.g. age) and the target (e.g. burnouts). This is a graph where the predictor is binned into groups, and where we represent group size in bars and group (target) incidence in a colored line.
183+
Additionally, we can also compute the output needed to plot the so-called Predictor Insights Graphs (PIGs in short). These are graphs that represents the insights of the relationship between a single predictor (e.g. age) and the target (e.g. burnouts). This is a graph where the predictor is binned into groups, and where we represent group size in bars and group (target) incidence in a colored line. We have the option to force order of predictor values.
184184

185185
.. code-block:: python
186186
187187
from cobra.evaluation import generate_pig_tables
188+
from cobra.evaluation import plot_incidence
188189
189190
predictor_list = [col for col in basetable.columns
190191
if col.endswith("_bin") or col.endswith("_processed")]
191192
pig_tables = generate_pig_tables(basetable[basetable["split"] == "selection"],
192193
id_column_name=id_column_name,
193194
target_column_name=target_column_name,
194-
preprocessed_predictors=predictor_list)
195+
preprocessed_predictors=predictor_list)
196+
# Plot PIGs
197+
plot_incidence(pig_tables, 'predictor_name', predictor_order)

0 commit comments

Comments
 (0)