> For the complete documentation index, see [llms.txt](https://docs.numer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.numer.ai/numerai-tournament/scoring/feature-neutral-correlation.md).

# Feature Neutral Correlation (FNC)

## What is FNC?

Feature neutral correlation (FNC) is the correlation of a model with the target, after its predictions have been neutralized to Numerai's features.

Since features are known to be inconsistent on their own, models with too much linear exposure to features are expected to perform poorly. By neutralizing this linear exposure to features, FNC isolates the predictive performance of the model that isn't just from the feature exposure.

## Calculation

To calculate a user's FNC for a given round we

* Normalize the predictions in their submission
* Neutralize their submission to Numerai's features for that round
* Calculate the Spearman rank-order correlation of their neutralized submission to the target

```python
def calculate_fnc(sub, targets, features):
    """    
    Args:
        sub (pd.Series)
        targets (pd.Series)
        features (pd.DataFrame)
    """
    
    # Normalize submission
    sub = (sub.rank(method="first").values - 0.5) / len(sub)

    # Neutralize submission to features
    f = features.values
    sub -= f.dot(np.linalg.pinv(f).dot(sub))
    sub /= sub.std()
    
    sub = pd.Series(np.squeeze(sub)) # Convert np.ndarray to pd.Series

    # FNC: Spearman rank-order correlation of neutralized submission to target
    fnc = np.corrcoef(sub.rank(pct=True, method="first"), targets)[0, 1]

    return fnc
```

## FNC on the website

The current version of FNC shown on the website is called `FNCv3` which is neutral to the "medium" subset of features in the V3 data.

## Discussion

Read more about feature neutralization and feature exposure [here](https://forum.numer.ai/t/model-diagnostics-feature-exposure/899).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.numer.ai/numerai-tournament/scoring/feature-neutral-correlation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
