Skip to content
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

Clustering doesn't work. #45

Closed
iwantofun opened this issue Oct 12, 2020 · 2 comments
Closed

Clustering doesn't work. #45

iwantofun opened this issue Oct 12, 2020 · 2 comments
Assignees

Comments

@iwantofun
Copy link

iwantofun commented Oct 12, 2020

  • igel version:0.2.8
  • Python version:3.7.3
  • Operating System:MacOS

Description

I am trying to use clustering model with KMeans, and got the error output below:

ERROR - Error while storing the fit description file: Object of type ndarray is not JSON serializable

after that, I found the content of model_results/description.json is incomplete.

Here is the details:

cmd:

igel fit -dp s1.txt -yml igel.2.yaml

s1.txt:

664159,550946
597173,575538
635690,608046
582015,546191
572029,518313
577728,587566
627968,574625
603145,574795

igel.2.yaml:

dataset:
  split:
    shuffle: false
    test_size: 0.2
  type: csv
model:
  algorithm: KMeans
  type: clustering
target:
- x
- y

Can you provide us an exmaple of clustering ?
Thanks in advance.

@nidhaloff
Copy link
Owner

@iwantofun thanks for noticing this. Indeed numpy arrays are not JSON compatible that's what the error is saying. This is a bug that I will fix now and draft a new release.

It is also interesting that the data are read and no error was thrown since your data is a .txt and igel supports only csv (at least for now) and make use of the column names to determine which target you want to predict (since you are providing this in the target field in the yaml file). In your case you are providing x and y as a target, but where does these come from? As I can see your txt file is not labeled with an x and y column names


I just added an example for using clustering now. You can check it out and give me a feedback.

@nidhaloff nidhaloff self-assigned this Oct 12, 2020
@iwantofun
Copy link
Author

It works now, thanks.

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

2 participants