Git Product home page Git Product logo

pylof's People

Contributors

bkaluza avatar damjankuznar avatar gaverhae avatar gsellers-ibm avatar kierkegaard13 avatar nuin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylof's Issues

idx out of range for knn when len(distances) < k

If the instance you're running lof for is the same distance away from most points, the distances list can have a length < k in which case distances[k - 1][0] returns an index out of range error

Apply it on 1D data

Hi

I know the input data must be in a form of tuple. But, I can't apply it on 1 dimensional data:

return lof.outliers(1, data)
File "C:\Users\lof.py", line 162, in outliers
value = l.local_outlier_factor(k, instance)
File "C:\Users\lof.py", line 95, in local_outlier_factor
return local_outlier_factor(min_pts, instance, self.instances, distance_function=self.distance_function)
File "C:\Users\lof.py", line 141, in local_outlier_factor
(k_distance_value, neighbours) = k_distance(min_pts, instance, instances, **kwargs)
File "C:\Users\lof.py", line 104, in k_distance
distance_value = distance_function(instance, instance2)
File "C:\Users\lof.py", line 33, in distance_euclidean
if len(instance1) != len(instance2):
TypeError: object of type 'float' has no len()

Do you have any suggestion?

Also do you have any advice on how to use it on large scale data?

Thanks

code to plot the figures

Hi Again,

I appreciate if you could put the codes of plotting figures (with outliers as different colors) here too.

Thanks

float division by zero when k=1

Hi,

When I'm trying to run example 2 on a different set of data, I got div-by-zero exceptions with some particular data. For example,

import lof
inst = [(1.,2.,3.),(2.,3.,4.),(1.,2.,4.),(1.,2.,1.)]
l = lof.outliers(1, inst)

produces

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lof.py", line 160, in outliers
    value = l.local_outlier_factor(k, instance)
  File "/lof.py", line 95, in local_outlier_factor
    return local_outlier_factor(min_pts, instance, self.instances, distance_function=self.distance_function)
  File "/lof.py", line 142, in local_outlier_factor
    instance_lrd = local_reachability_density(min_pts, instance, instances, **kwargs)
  File "/lof.py", line 134, in local_reachability_density
    return len(neighbours) / sum(reachability_distances_array)
ZeroDivisionError: float division by zero

I wonder if I'm doing anything wrong? Any help would be appreciated, thanks.

Euclidean distance

Hi, thanks for sharing this greate project!
There is one line of code I can't understand:
rmse = (sum(map(lambda x: x**2, differences)) / len(differences))**0.5
As far as I know, if x and y are two points in n-dimension space, the euclidean distance between them is

d(x,y) = sqrt((x1-y1)^2 + (x2-y2)^2 + ... + (xn-yn)^2)

So why in the code the sum term is divided by len(differences) ?
Thanks a lot if you could help me.

Estimated run time of LOF?

The performance evaluations of LOF in the paper shows that it takes about 2000 seconds for the algorithm to detect outliers in a 10-dimensional dataset with 200000 data points. However, when I run this implementation of LOF it takes about 2400 seconds to run a 7-dimensional dataset with just 1000 points. Why the huge discrepancy in performance?

I'm just getting started with LOF and just want to experiment with it a little. I'm sorry if I'm just misinterpreting the paper.

Would you like to tell me how to use your great pylof

Hello~ I just know the LOF algorithm today and I want to use this algorithm on a 3D point set to cluster the outliers. I find your great work on git, but I don't quite understand how to use your lof file. Would you like to show me the way please? Thank you for your patience.

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.