Skip to content

neurostatx.cli.PartialLeastSquareRegression

Attributes

NameDescription
appCyclopts application for the PartialLeastSquareRegression

Functions

NameDescription
PartialLeastSquareRegressionFit 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

NameTypeDefaultDescription
in_graphstrrequiredGraph file containing the data for the PLSR model.
out_folderstrrequiredOutput folder.
attributesList[str]NoneAttribute names to include in the PLSR model. If None are provided, all attributes will be included. Defaults to None.
weightstr'membership'Edge weight to use for the PLSR model. Defaults to membership.
splitsint10Number of splits to use for the cross-validation. Defaults to 10.
permutationsint1000Number of permutations to use for the permutation testing. Defaults to 1000.
scoringScoringMethodScoringMethod.r2Scoring method to use for the permutation testing. Defaults to r2.
processesint1Number of processes to use for the cross-validation. Defaults to 1.
plot_distributionsboolFalseIf true, will plot the distributions of the edges’ weights. Defaults to False.
verboseboolFalseIf true, produce verbose output. Defaults to False.
save_parametersboolFalseIf true, will save input parameters to .txt file. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.

Examples

Terminal window
PartialLeastSquareRegression --in-graph graph.gexf
--out-folder output_folder -v -s