<jupyter_start><jupyter_text>Outliers detection Overview ArgumentsArguments |  |-------|-----obj | Object to summarizeX | Datalabels_true | True cluster assignment. Default: *None*store_X| If X is stored as attribute. Default: *None*digits | Number of decimals to round FunctionsAlgorithm | Function | Summary |-----|------|-------Isolation Forest | [IsolationForest]()| IsolationForestSummaryOne Class support vector machine | [OneClassSVM](https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html) | OneClassSVMSummaryLocal Outlier Factor |[LocalOutlierFactor](https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html)| LocalOutlierFactorSummaryMean Shift | [MeanShift]((https://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html?highlight=meanshift)) | MeanShiftSummaryDBSCAN | [DBSCAN](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.dbscan.html?highlight=dbscansklearn.cluster.dbscan) | dbscanSummaryOPTICS | [OPTICS](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.OPTICS.html?highlight=opticssklearn.cluster.OPTICS)| opticsSummary  Isolation forest<jupyter_code>import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.ensemble import IsolationForest
from mlsummary.outliers import IsolationForestSummary

iris = load_iris()
iris = pd.DataFrame(data= np.c_[iris['data'], iris['target']],
                     columns= iris['feature_names'] + ['target'])
X = iris.drop(columns=['target'])
y = iris['target']
iforest = IsolationForest().fit(X)
iforest_summary = IsolationForestSummary(iforest, X = X)
iforest_summary.describe()
iforest_summary.plot(X)
print(pd.DataFrame((iforest_summary.__dict__.keys()), columns = ['Attribute']))<jupyter_output>Attribute
0             model
1            labels
2        n_clusters
3         variables
4               SIL
5                DB
6                CH
7           centers
8      labels_names
9      cluster_size
10  cluster_weights
11              ARI
12               FM
13                X
14     n_estimators
15   base_estimator
16     max_features
17        bootstrap
18    contamination
19      max_samples<jupyter_text>One Class support vector machine<jupyter_code>import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.svm import OneClassSVM
from mlsummary.outliers import OneClassSVMSummary

iris = load_iris()
iris = pd.DataFrame(data= np.c_[iris['data'], iris['target']],
                     columns= iris['feature_names'] + ['target'])
X = iris.drop(columns=['target'])
y = iris['target']
ocSVM = OneClassSVM().fit(X)
ocSVM_summary = OneClassSVMSummary(ocSVM, X = X, store_X=True)
ocSVM_summary.describe()
ocSVM_summary.plot()
print(pd.DataFrame((ocSVM_summary.__dict__.keys()), columns = ['Attribute']))<jupyter_output>Attribute
0              model
1             labels
2         n_clusters
3          variables
4                SIL
5                 DB
6                 CH
7            centers
8       labels_names
9       cluster_size
10   cluster_weights
11               ARI
12                FM
13                 X
14                 C
15            kernel
16            degree
17             gamma
18         shrinking
19  support_vectors_
20         n_support<jupyter_text>Local Outlier Factor<jupyter_code>import numpy as np
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.neighbors import LocalOutlierFactor
from mlsummary.outliers import LocalOutlierFactorSummary

iris = load_iris()
iris = pd.DataFrame(data= np.c_[iris['data'], iris['target']],
                     columns= iris['feature_names'] + ['target'])
X = iris.drop(columns=['target'])
y = iris['target']
lof = LocalOutlierFactor().fit(X)

lof_summary = LocalOutlierFactorSummary(lof, X = X)
lof_summary.describe()
lof_summary.plot(X=X)
print(pd.DataFrame((lof_summary.__dict__.keys()), columns = ['Attribute']))<jupyter_output>Attribute
0                     model
1                    labels
2                n_clusters
3                 variables
4                       SIL
5                        DB
6                        CH
7                   centers
8              labels_names
9              cluster_size
10          cluster_weights
11                      ARI
12                       FM
13                        X
14              labels_true
15              n_neighbors
16                   radius
17                   metric
18                        p
19               fit_method
20                leaf_size
21            contamination
22                  novelty
23  negative_outlier_factor
{'fraction_non_alphanumeric': 0.09194414607948442, 'fraction_numerical': 0.021482277121374866, 'mean_word_length': 2.4412416851441243, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '557267', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1340, 'n_words': 319, 'path': 'examples/outliers.ipynb', 'repo_name': 'serafinialessio/mlsummary', 'size': '4655'}