I'm trying to detect outliers in a dataframe using the Isolation Forest algorithm from sklearn.

Here's the code I'm using to set up the algorithm:

```
iForest = IsolationForest(n_estimators=100, max_samples=256, contamination='auto', random_state=1, behaviour='new')
iForest.fit(dataset)
scores = iForest.decision_function(dataset)

```

Now, since I don't know what a good value for the contamination could be, I would like to check my scores and decide where to draw the line based on the distribution of the scores. Here's the code for the graph and the graph itself:

```
plt.figure(figsize=(12, 8))
plt.hist(scores, bins=50);

```

[![enter image description here](https://i.stack.imgur.com/10G8g.png)](https://i.stack.imgur.com/10G8g.png)

Is it correct to assume that negative scores indicate outliers in my dataframe? I can't find a good explanation on the range of the IF scores and how these scores work (why do I get negative scores?).

Additionally, is there a way to attach these scores to the original dataset and manually check rows with negative scores to see if they make sense?

Thanks!