8000 LocalOutlierFactor throws scipy FutureWarning: non-tuple sequence · Issue #12608 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

LocalOutlierFactor throws scipy FutureWarning: non-tuple sequence #12608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nocibambi opened this issue Nov 18, 2018 · 3 comments
Closed

LocalOutlierFactor throws scipy FutureWarning: non-tuple sequence #12608

nocibambi opened this issue Nov 18, 2018 · 3 comments

Comments

@nocibambi
Copy link

Description

FutureWarning thrown when calling fit on LocalOutlierFactor

Steps/Code to Reproduce

Example:

import numpy as np
from sklearn.neighbors import LocalOutlierFactor

d = np.random.randn(100, 100)
lof = LocalOutlierFactor()
lof.fit(d)

Expected Results

Only the LocalOutlierFactor:

LocalOutlierFactor(algorithm='auto', contamination=0.1, leaf_size=30,
metric='minkowski', metric_params=None, n_jobs=1, n_neighbors=20,
p=2)

Actual Results

/home/andras/anaconda3/lib/python3.6/site-packages/scipy/stats/stats.py:1713: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval

LocalOutlierFactor(algorithm='auto', contamination=0.1, leaf_size=30,
metric='minkowski', metric_params=None, n_jobs=1, n_neighbors=20,
p=2)

Versions

Linux-4.15.0-39-generic-x86_64-with-debian-buster-sid
Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51)
[GCC 7.2.0]
NumPy 1.15.1
SciPy 1.1.0
Scikit-Learn 0.19.2

@jnothman
Copy link
Member
jnothman commented Nov 18, 2018 via email

@rth
8000 Copy link
Member
rth commented Nov 18, 2018

Please check with scikit-learn master.

or at least 0.20.0.

@qinhanmin2014
Copy link
Member

Resolved in master, please update to 0.20.0.
See #11697, #11714.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0