# estimation.feols_compressed_.FeolsCompressed { #pyfixest.estimation.feols_compressed_.FeolsCompressed }

```python
estimation.feols_compressed_.FeolsCompressed(
    self,
    FixestFormula,
    data,
    ssc_dict,
    drop_singletons,
    drop_intercept,
    weights,
    weights_type,
    collin_tol,
    fixef_tol,
    lookup_demeaned_data,
    solver,
    demeaner_backend='numba',
    store_data=True,
    copy_data=True,
    lean=False,
    context=0,
    reps=100,
    seed=None,
    sample_split_var=None,
    sample_split_value=None,
)
```

Non-user-facing class for compressed regression with fixed effects.

See the paper "You only compress once" by Wong et al (https://arxiv.org/abs/2102.11297) for
details on regression compression.

## Parameters {.doc-section .doc-section-parameters}

| Name                 | Type                            | Description                                                                                                                                                                                                                                                          | Default    |
|----------------------|---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| FixestFormula        | FixestFormula                   | The formula object.                                                                                                                                                                                                                                                  | _required_ |
| data                 | pd.DataFrame                    | The data.                                                                                                                                                                                                                                                            | _required_ |
| ssc_dict             | dict\[str, Union\[str, bool\]\] | The ssc dictionary.                                                                                                                                                                                                                                                  | _required_ |
| drop_singletons      | bool                            | Whether to drop columns with singleton fixed effects.                                                                                                                                                                                                                | _required_ |
| drop_intercept       | bool                            | Whether to include an intercept.                                                                                                                                                                                                                                     | _required_ |
| weights              | Optional\[str\]                 | The column name of the weights. None if no weights are used. For this method, weights needs to be None.                                                                                                                                                              | _required_ |
| weights_type         | Optional\[str\]                 | The type of weights. For this method, weights_type needs to be 'fweights'.                                                                                                                                                                                           | _required_ |
| collin_tol           | float                           | The tolerance level for collinearity.                                                                                                                                                                                                                                | _required_ |
| fixef_tol            | float                           | The tolerance level for the fixed effects.                                                                                                                                                                                                                           | _required_ |
| lookup_demeaned_data | dict\[str, pd.DataFrame\]       | The lookup table for demeaned data.                                                                                                                                                                                                                                  | _required_ |
| solver               | str                             | The solver to use.                                                                                                                                                                                                                                                   | _required_ |
| store_data           | bool                            | Whether to store the data.                                                                                                                                                                                                                                           | `True`     |
| copy_data            | bool                            | Whether to copy the data.                                                                                                                                                                                                                                            | `True`     |
| lean                 | bool                            | Whether to keep memory-heavy objects as attributes or not.                                                                                                                                                                                                           | `False`    |
| context              | int or Mapping\[str, Any\]      | A dictionary containing additional context variables to be used by formulaic during the creation of the model matrix. This can include custom factorization functions, transformations, or any other variables that need to be available in the formula environment. | `0`        |
| reps                 | int                             | The number of bootstrap repetitions. Default is 100. Only used for CRV1 inference, where a wild cluster bootstrap is used.                                                                                                                                           | `100`      |
| seed                 | Optional\[int\]                 | The seed for the random number generator. Only relevant for CRV1 inference, where a wild cluster bootstrap is used.                                                                                                                                                  | `None`     |

## Methods

| Name | Description |
| --- | --- |
| [predict](#pyfixest.estimation.feols_compressed_.FeolsCompressed.predict) | Compute predicted values. |
| [prepare_model_matrix](#pyfixest.estimation.feols_compressed_.FeolsCompressed.prepare_model_matrix) | Prepare model inputs for estimation. |
| [vcov](#pyfixest.estimation.feols_compressed_.FeolsCompressed.vcov) | Compute the variance-covariance matrix for the compressed regression. |

### predict { #pyfixest.estimation.feols_compressed_.FeolsCompressed.predict }

```python
estimation.feols_compressed_.FeolsCompressed.predict(
    newdata=None,
    atol=1e-06,
    btol=1e-06,
    type='link',
)
```

Compute predicted values.

#### Parameters {.doc-section .doc-section-parameters}

| Name    | Type                      | Description                                                                   | Default   |
|---------|---------------------------|-------------------------------------------------------------------------------|-----------|
| newdata | Optional\[DataFrameType\] | The new data. If None, makes a prediction based on the uncompressed data set. | `None`    |
| atol    | float                     | The absolute tolerance.                                                       | `1e-06`   |
| btol    | float                     | The relative tolerance.                                                       | `1e-06`   |
| type    | str                       | The type of prediction.                                                       | `'link'`  |

#### Returns {.doc-section .doc-section-returns}

| Name   | Type       | Description                                                                                            |
|--------|------------|--------------------------------------------------------------------------------------------------------|
|        | np.ndarray | The predicted values. If newdata is None, the predicted values are based on the uncompressed data set. |

### prepare_model_matrix { #pyfixest.estimation.feols_compressed_.FeolsCompressed.prepare_model_matrix }

```python
estimation.feols_compressed_.FeolsCompressed.prepare_model_matrix()
```

Prepare model inputs for estimation.

### vcov { #pyfixest.estimation.feols_compressed_.FeolsCompressed.vcov }

```python
estimation.feols_compressed_.FeolsCompressed.vcov(vcov, data=None)
```

Compute the variance-covariance matrix for the compressed regression.