grnet.models package
Module contents
- class grnet.models.BinPC(data: DataFrame, n: int | None = None, random_state: int = 0)
Bases:
Estimatorpgmpy wrapper class for PC algorithm with DOR-based binarization
Methods
- __init__(
self, data: pandas.DataFrame, n: int, random_state: int
- ) -> None:
initialize attributes
- estimate(
self, variant: str, ci_test: str, max_cond_vars: int, return_type: str, significance_level: float, n_jobs: int, show_progress: bool
- ) -> None:
estimate network and save edges (a list of tuples) as self.edges by PC algorithm actual implementation of PC algorithm is a wrapper of pgmpy.estimators.PC default values are altered from the original codes for some arguments to adjust for GRNs
- get_matrix(
self
- ) -> pandas.core.frame.DataFrame:
export network information as DxD matrix of 0 or 1 elements
Attributes
- data: pandas.core.frame.DataFrame
input data or resampled data (data will be resampled if n is specified in self.__init__)
- model: pgmpy.estimators.PC.PC
model information (for debugging)
- edges: List[tuple]
information of edges are saved as a list of tuples after self.estimate was run
References
pgmpy.estimators.PC: https://pgmpy.org/structure_estimator/pc.html?highlight=pc
- estimate(variant: str = 'stable', ci_test: str = 'chi_square', max_cond_vars: int | None = None, return_type: str = 'dag', significance_level: float = 0.01, n_jobs: int = -1, show_progress: bool = False) None
Parameters
variant: str, default: “stable”, ci_test: str, default: “chi_square”, max_cond_vars: int, default: None, return_type: str, default: “dag”, significance_level: float, default: 0.01, n_jobs: int, default: -1, show_progress: bool, default: False
Returns
None
References
pgmpy.estimators.PC: https://pgmpy.org/structure_estimator/pc.html?highlight=pc
grnet.abstract.Estimator: https://grnet.readthedocs.io/en/latest/grnet.abstract.html#grnet.abstract.Estimator
- get_matrix() DataFrame
Parameters
None
Returns
- GRNMatrix: pandas.DataFrame
edge information of the GRN will be returned as a DxD matrix
References
grnet.abstract.Estimator: https://grnet.readthedocs.io/en/latest/grnet.abstract.html#grnet.abstract.Estimator
- class grnet.models.PC(data: DataFrame, n: int | None = None, random_state: int = 0)
Bases:
Estimatorpgmpy wrapper class for PC algorithm
Methods
- __init__(
self, data: pandas.core.frame.DataFrame, n: int, random_state: int
- ) -> None:
initialize attributes
- estimate(
self, variant: str, ci_test: str, max_cond_vars: int, return_type: str, significance_level: float, n_jobs: int, show_progress: bool
- ) -> None:
estimate network and save edges (a list of tuples) as self.edges by PC algorithm actual implementation of PC algorithm is a wrapper of pgmpy.estimators.PC default values are altered from the original codes for some arguments to adjust for GRNs
- get_matrix(
self
- ) -> pandas.core.frame.DataFrame:
export network information as DxD matrix of 0 or 1 elements
Attributes
- data: pandas.core.frame.DataFrame
input data or resampled data (data will be resampled if n is specified in self.__init__)
- model: pgmpy.estimators.PC.PC
model information (for debugging)
- edges: List[tuple]
information of edges are saved as a list of tuples after self.estimate was run
References
pgmpy.estimators.PC: https://pgmpy.org/structure_estimator/pc.html?highlight=pc
- estimate(variant: str = 'stable', ci_test: str = 'pearsonr', max_cond_vars: int | None = None, return_type: str = 'dag', significance_level: float = 0.01, n_jobs: int = -1, show_progress: bool = False) None
Parameters
variant: str, default: “stable”, ci_test: str, default: “pearsonr”, max_cond_vars: int, default: None, return_type: str, default: “dag”, significance_level: float, default: 0.01, n_jobs: int, default: -1, show_progress: bool, default: False
Returns
None
References
pgmpy.estimators.PC: https://pgmpy.org/structure_estimator/pc.html?highlight=pc
grnet.abstract.Estimator: https://grnet.readthedocs.io/en/latest/grnet.abstract.html#grnet.abstract.Estimator
- get_matrix() DataFrame
Parameters
None
Returns
- GRNMatrix: pandas.core.frame.DataFrame
edge information of the GRN will be returned as a DxD matrix
References
grnet.abstract.Estimator: https://grnet.readthedocs.io/en/latest/grnet.abstract.html#grnet.abstract.Estimator
- class grnet.models.PretrainedModel(data: DataFrame, n: int | None = None, random_state: int = 0)
Bases:
Estimatorclass for pretrained GRN matrix (to be treated as a subclass of Estimator)
Methods
- __init__(
self, data: pandas.DataFrame, n: int, random_state: int
- ) -> None:
initialize attributes
- estimate(
self
- ) -> None:
always ignored (preserved for consistency)
- get_matrix(
self
- ) -> pandas.DataFrame:
returns the original GRN matrix
Attributes
- data: pandas.DataFrame
GRN matrix
- edges: List[tuple]
information of edges are saved as a list of tuples
References
grnet.abstract.Estimator: https://grnet.readthedocs.io/en/latest/grnet.abstract.html#grnet.abstract.Estimator