class documentation
class BaseStatistics(BaseModel):
Basic statistics to be computed and displayed on the dashboard.
This defines the base class with counts of the basic patient and tumor information.
It also defines the classmethod to compute the statistics from a dataset. In a
dynamically created subclass of this one, the fields for every LNL ipsi- and
contralaterally are added to the Statistics
class.
Class Method | from |
Compute statistics from a table of patients. |
Class Variable | central |
For how many patients was the tumor located centrally, for how many not? |
Class Variable | datasets |
How many patients are in each dataset. |
Class Variable | hpv |
Patients with or without HPV. |
Class Variable | is |
Number of patients with or without N+ status. |
Class Variable | midext |
Number of patients with or without tumors crossing the midline. |
Class Variable | sex |
Number of male and female patients. |
Class Variable | smoke |
Number of patients who did or did not smoke. |
Class Variable | subsite |
Number of patients with tumors in different subsites. |
Class Variable | surgery |
Number of patients that did or did not undergo surgery. |
Class Variable | t |
Counts of patients with different T-stages. |
Property | total |
Return the total number of patients in the dataset. |
@classmethod
def from_table(cls:
def from_table(cls:
type[ T]
, table: pd.DataFrame
, method: Literal[ 'max_llh', 'rank']
= 'max_llh') -> T
:
¶
Compute statistics from a table of patients.
This method computes e.g. how many patients in the queried table are
HPV positive, or how many patients have a certain T-stage. The statistics are
computed from the queried table and passed to the context of the
dataexplorer.views
. From there, the statistics can be displayed in the
rendered HTML or JSON response.