# neurostatx.cli.ApplyModel

*module*

[View source](https://github.com/gagnonanthony/NeuroStatX/blob/main/neurostatx/cli/ApplyModel.py#L1-L1)

## neurostatx.cli.ApplyModel.app

*attribute* · *module attribute*

```python
app = App(default_parameter=Parameter(negative=()))
```

Cyclopts application for the ApplyModel command-line tool.

[View source](https://github.com/gagnonanthony/NeuroStatX/blob/main/neurostatx/cli/ApplyModel.py#L21-L21)

## neurostatx.cli.ApplyModel.ApplyModel

*function*

```python
def ApplyModel(in_dataset: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], model: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], id_column: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], desc_columns: Annotated[int, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(group='Essential Files Options')] = './ApplyModel/', 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)
```

Apply a pickled SEMopy, FactorAnalyzer, or sklearn model to a dataset.

Features in the dataset are scaled before the model is applied.

> **Notes**
>
> Currently supported models:
> 
> * SEMopy
> * FactorAnalyzer
> * sklearn

**Parameters**

- `in_dataset` (`str`) — Input dataset.
- `model` (`str`) — Path to the model to apply.
- `id_column` (`str`) — Column name to use as index.
- `desc_columns` (`int`) — Number of columns to use as descriptors.
- `out_folder` (`str`) (default: `'./ApplyModel/'`) — Output folder. Defaults to ``./ApplyModel/``.
- `verbose` (`bool`) (default: `False`) — Increase verbosity. Defaults to False.
- `save_parameters` (`bool`) (default: `False`) — Save parameters to a file. Defaults to False.
- `overwrite` (`bool`) (default: `False`) — Overwrite output folder if it already exists. Defaults to False.

**Examples**

```bash
ApplyModel --in-dataset dataset.xlsx --model model.pkl --id-column ID
--desc-columns 1 --out-folder ./output -v -f -s
```

[View source](https://github.com/gagnonanthony/NeuroStatX/blob/main/neurostatx/cli/ApplyModel.py#L25-L177)
