GithubHelp home page GithubHelp logo

xenia101 / local-outlier-factor Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 155 KB

Deriving the Local Outlier Factor Score

Python 100.00%
lof local-outlier-factor local-outlier machine-learning python classification algorithms algorithm sklearn sklearn-library

local-outlier-factor's Introduction

Local-Outlier-Factor (LOF)

Deriving the Local Outlier Factor Scores

LOF 란?

In anomaly detection, the local outlier factor (LOF) is an algorithm proposed by Markus M. Breunig, Hans-Peter Kriegel, Raymond T. Ng and Jörg Sander in 2000 for finding anomalous data points by measuring the local deviation of a given data point with respect to its neighbours. WIKIPEDIA

Example

from sklearn.neighbors import LocalOutlierFactor
import numpy as np

clf = LocalOutlierFactor(n_neighbors=3, contamination=0.1)
clf.fit_predict(load_data())
X_scores = clf.negative_outlier_factor_

X_scores  # X_scores is a negative number
-X_scores # print a positive number

Execution / Test Environment

  • Windows 10 or Ubuntu Linux
  • Python 3.6

Usage

  • Input : example_of_input.csv

    python3 LocalOutlierFactor.py

  • Output : example_of_output.csv with LOF scores

local-outlier-factor's People

Contributors

xenia101 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.