neurostatx.cli.PartialLeastSquareRegression
Attributes
| Name | Description |
|---|---|
app | Cyclopts application for the PartialLeastSquareRegression |
Functions
| Name | Description |
|---|---|
PartialLeastSquareRegression | Fit partial least squares regression of node attributes against |
appattributemodule attribute#
app = App(default_parameter=Parameter(negative=()))Cyclopts application for the PartialLeastSquareRegression command-line tool.
PartialLeastSquareRegressionfunction#
def PartialLeastSquareRegression(in_graph: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], attributes: Annotated[List[str], Parameter(group='Model Parameters', show_default=True)] = None, weight: Annotated[str, Parameter(group='Model Parameters', show_default=True)] = 'membership', splits: Annotated[int, Parameter(group='Model Parameters', show_default=True)] = 10, permutations: Annotated[int, Parameter(group='Model Parameters', show_default=True)] = 1000, scoring: Annotated[ScoringMethod, Parameter(group='Model Parameters', show_default=True)] = ScoringMethod.r2, processes: Annotated[int, Parameter(group='Model Parameters', show_default=True)] = 1, plot_distributions: Annotated[bool, Parameter(show_default=True, group='Visualization Options')] = False, verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, save_parameters: Annotated[bool, Parameter(-s, --save_parameters, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False)Fit partial least squares regression of node attributes against graph edges.
PartialLeastSquareRegression uses node attributes as predictors and edge weights as the response. It cross-validates to choose the number of components, then runs permutation testing for statistical significance. It writes PLSR coefficients, statistics, and plots of attribute and edge-weight distributions and of the coefficients.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
in_graph | str | required | Graph file containing the data for the PLSR model. |
out_folder | str | required | Output folder. |
attributes | List[str] | None | Attribute names to include in the PLSR model. If None are provided, all attributes will be included. Defaults to None. |
weight | str | 'membership' | Edge weight to use for the PLSR model. Defaults to membership. |
splits | int | 10 | Number of splits to use for the cross-validation. Defaults to 10. |
permutations | int | 1000 | Number of permutations to use for the permutation testing. Defaults to 1000. |
scoring | ScoringMethod | ScoringMethod.r2 | Scoring method to use for the permutation testing. Defaults to r2. |
processes | int | 1 | Number of processes to use for the cross-validation. Defaults to 1. |
plot_distributions | bool | False | If true, will plot the distributions of the edges’ weights. Defaults to False. |
verbose | bool | False | If true, produce verbose output. Defaults to False. |
save_parameters | bool | False | If true, will save input parameters to .txt file. Defaults to False. |
overwrite | bool | False | If true, force overwriting of existing output files. Defaults to False. |
Examples
PartialLeastSquareRegression --in-graph graph.gexf--out-folder output_folder -v -s