Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P pyod
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Yue Zhao
  • pyod
  • Issues
  • #450
Closed
Open
Issue created Oct 25, 2022 by Administrator@rootContributor

Error message with ABOD

Created by: mccoydj1

I'm trying to run the code below and I get an error message. I don't understand why the first example works fine but the second does not. Let me know your thoughts!

from pyod.models.abod import ABOD
import seaborn as sns
import pandas as pd

# This data works fine
abod_clf = ABOD(contamination=0.05)
df = sns.load_dataset('tips')
inputdf = df[['total_bill', 'tip']]
abod_clf.fit(inputdf)
print('Method 1 works!')

# This data does not work
abod_clf = ABOD(contamination=0.05)
inputdf = pd.DataFrame(data=[[30, 20], [50, 20], [40, 60]])
abod_clf.fit(inputdf)
print('Method 2 works! (note this line is not reached)')

Here's the error message that I get when I try to run it. What am I doing wrong?

numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function dot at 0x000001E6E775DB88>) found for signature:
 
 >>> dot(array(int64, 1d, C), array(int64, 1d, C))
 
There are 4 candidate implementations:
  - Of which 4 did not match due to:
  Overload in function '_OverloadWrapper._build.<locals>.ol_generated': File: numba\core\overload_glue.py: Line 129.
    With argument(s): '(array(int64, 1d, C), array(int64, 1d, C))':
   Rejected as the implementation raised a specific error:
     TypingError: np.dot() only supported on float and complex arrays
  raised from C:\Users\mccoy\AppData\Local\PythonPlus\64bit\lib\site-packages\numba\core\typing\npydecl.py:920

During: resolving callee type: Function(<function dot at 0x000001E6E775DB88>)
During: typing of call at C:\Users\mccoy\AppData\Local\PythonPlus\64bit\lib\site-packages\pyod\models\abod.py (52)


File "..\..\..\..\..\..\..\AppData\Local\PythonPlus\64bit\lib\site-packages\pyod\models\abod.py", line 52:
def _wcos(curr_pt, a, b):  # pragma: no cover
    <source elided>
    wcos = np.dot(a_curr, b_curr) / (
            np.linalg.norm(a_curr, 2) ** 2) / (
            ^
Assignee
Assign to
Time tracking