<a id="skfolio-alpha-fixedweightedalpha"></a>

# skfolio.alpha.FixedWeightedAlpha

<a id="skfolio.alpha.FixedWeightedAlpha"></a>

### *class* skfolio.alpha.FixedWeightedAlpha(\*, descriptors, forecast_scale, weights=None, forecast_unit=IDIO_RETURN, min_coverage=0.0, neutralize_against=None, outlier_transformer=None, scoring_transformer=None, transform_by_group=None, n_jobs=1)

Fixed-weighted descriptor alpha estimator.

This estimator converts descriptors into cross-sectional scores, optionally
neutralizes the scores against factor exposures, and combines them with fixed
weights to produce an alpha forecast in expected return units.

Unlike [`EWSharpeOptimalAlpha`](https://skfolio.org/generated/skfolio.alpha.EWSharpeOptimalAlpha.html.md#skfolio.alpha.EWSharpeOptimalAlpha), the descriptor weights and forecast scale are
not estimated from realized returns. They are fixed hyperparameters of the
estimator.

For descriptor score $s_{k,i}$ and signed fixed weight $w_k$, the
composite score for asset $i$ is:

$$
z_i = \frac{\sum_{k \in V_i} w_k s_{k,i}}
           {\sum_{k \in V_i} |w_k|}
$$

where $V_i$ is the set of descriptors with finite scores for asset
$i$. The forecast in the selected `forecast_unit` is:

$$
\hat y_i = \text{forecast\_scale} \, z_i
$$

With `forecast_unit=ForecastUnit.IDIO_RETURN`, the alpha forecast is:

$$
\alpha_i = \hat y_i
$$

With `forecast_unit=ForecastUnit.IDIO_SHARPE`, the forecast is converted to
expected return units:

$$
\alpha_i = \sigma_i \hat y_i
$$

where $\sigma_i$ is the forecast idiosyncratic volatility.

* **Parameters:**
  **descriptors** *list of (name, estimator) tuples*
  : List of descriptors that compute signals from characteristics.

  **weights** *array-like of shape (n_descriptors,), optional*
  : Signed descriptor weights. If `None`, equal positive weights are used. Weights
    are normalized by their absolute sum. When some descriptor scores are missing,
    the composite score is renormalized over the available absolute weight.

  **forecast_scale** *float*
  : Multiplicative scale applied to the composite score in `forecast_unit`. With
    `ForecastUnit.IDIO_RETURN`, this is expected idiosyncratic return per score
    unit. With `ForecastUnit.IDIO_SHARPE`, this is idiosyncratic Sharpe per score
    unit.

  **forecast_unit** *ForecastUnit, default=ForecastUnit.IDIO_RETURN*
  : Unit of the fixed forecast before conversion to `alpha_`. The `alpha_`
    attribute is always returned in expected return units. With
    `ForecastUnit.IDIO_SHARPE`, `idio_variances` are required and the forecast is
    multiplied by current idiosyncratic volatility.

  **min_coverage** *float, default=0.0*
  : Minimum fraction of absolute descriptor weight that must be finite for the
    composite score to be computed. Values where available absolute weight is below
    this threshold are set to `NaN`. Must be in `[0, 1]`.

  **neutralize_against** *list of str, optional*
  : Factor names or families to neutralize scores against.

  **outlier_transformer** *BaseCSTransformer or “passthrough”, optional*
  : Cross-sectional transformer for descriptor outlier handling. If `None`,
    defaults to `CSWinsorizer()`. Use `"passthrough"` to skip.

  **scoring_transformer** *BaseCSTransformer or “passthrough”, optional*
  : Cross-sectional transformer for descriptor scoring applied after outlier
    handling. If `None`, defaults to `CSStandardScaler()`. Use `"passthrough"` to
    skip.

  **transform_by_group** *str, optional*
  : Name of a categorical characteristic in the AssetPanel to use for group-wise
    transformations.

  **n_jobs** *int, default=1*
  : Number of parallel jobs for descriptor computation.
* **Attributes:**
  [`named_descriptors`](#skfolio.alpha.FixedWeightedAlpha.named_descriptors)
  : Dictionary to access any fitted factors by name.

### Methods

| [`fit`](#skfolio.alpha.FixedWeightedAlpha.fit)(X[, y])                   | Fit descriptors and store the latest alpha forecast in `alpha_`.      |
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [`fit_transform`](#skfolio.alpha.FixedWeightedAlpha.fit_transform)(X[, y])         | Fit descriptors and return historical alpha forecasts.                |
| [`get_metadata_routing`](#skfolio.alpha.FixedWeightedAlpha.get_metadata_routing)()        | Return metadata routing for descriptor estimators.                    |
| [`get_params`](#skfolio.alpha.FixedWeightedAlpha.get_params)([deep])            | Get the parameters of an estimator from the ensemble.                 |
| [`partial_fit`](#skfolio.alpha.FixedWeightedAlpha.partial_fit)(X[, y])           | Incrementally update descriptors and store the latest alpha forecast. |
| [`partial_fit_transform`](#skfolio.alpha.FixedWeightedAlpha.partial_fit_transform)(X[, y]) | Incrementally update descriptors and return new alpha forecasts.      |
| [`set_params`](#skfolio.alpha.FixedWeightedAlpha.set_params)(\*\*params)        | Set the parameters of a factor from the ensemble.                     |

<a id="skfolio.alpha.FixedWeightedAlpha.fit"></a>

#### fit(X, y=None, \*\*fit_params)

Fit descriptors and store the latest alpha forecast in `alpha_`.

<a id="skfolio.alpha.FixedWeightedAlpha.fit_transform"></a>

#### fit_transform(X, y=None, \*\*fit_params)

Fit descriptors and return historical alpha forecasts.

<a id="skfolio.alpha.FixedWeightedAlpha.get_metadata_routing"></a>

#### get_metadata_routing()

Return metadata routing for descriptor estimators.

<a id="skfolio.alpha.FixedWeightedAlpha.get_params"></a>

#### get_params(deep=True)

Get the parameters of an estimator from the ensemble.

Returns the parameters given in the constructor as well as the
estimators contained within the `estimators` parameter.

* **Parameters:**
  **deep** *bool, default=True*
  : Setting it to True gets the various estimators and the parameters
    of the estimators as well.
* **Returns:**
  **params** *dict*
  : Parameter and estimator names mapped to their values or parameter
    names mapped to their values.

<a id="skfolio.alpha.FixedWeightedAlpha.named_descriptors"></a>

#### *property* named_descriptors

Dictionary to access any fitted factors by name.

* **Returns:**
  `Bunch`

<a id="skfolio.alpha.FixedWeightedAlpha.partial_fit"></a>

#### partial_fit(X, y=None, \*\*fit_params)

Incrementally update descriptors and store the latest alpha forecast.

<a id="skfolio.alpha.FixedWeightedAlpha.partial_fit_transform"></a>

#### partial_fit_transform(X, y=None, \*\*fit_params)

Incrementally update descriptors and return new alpha forecasts.

<a id="skfolio.alpha.FixedWeightedAlpha.set_params"></a>

#### set_params(\*\*params)

Set the parameters of a factor from the ensemble.

Valid parameter keys can be listed with `get_params()`. Note that you
can directly set the parameters of the estimators contained in
`estimators`.

* **Parameters:**
  **\*\*params** *keyword arguments*
  : Specific parameters using e.g.
    `set_params(parameter_name=new_value)`. In addition, to setting the
    parameters of the estimator, the individual estimator of the
    estimators can also be set, or can be removed by setting them to
    ‘drop’.
* **Returns:**
  **self** *object*
  : Estimator instance.

