Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
Hi everybody.

I'm rookie in knowage.

I'm trying to use scikit-learn library. I have installed this in the machine.

Before I installed scikit-learn I had a mistake when I wrote from sklearn.cluster import KMeans. After I installed scikit-learn I don't have a mistake.

Now, I have a mistake when I write kmeans = KMeans(n_clusters=3).fit(df).  I don't understand because in the command line python console this code is ok.

diabetes is a csv file upload in the knowage INPUT variable diabetes. It's is ok.

My source code is:

import pandas as pd
import numpy as np
from pandas import DataFrame
from sklearn.cluster import KMeans

diabetes = pd.read_csv(diabetes)

df=DataFrame(diabetes, columns=['Glucose','Insulin'])

kmeans = KMeans(n_clusters=3).fit(df)
centroids = kmeans.cluster_centers_

Moreover, I have a problem with dataset variable.

I need access to the dataset variable for read the elements when this variable is MySQL dataset , but I don't know how it is. When the dataset variable is a csv file there is no problem, but when the variable is MySQL dataset I don't know how access to de information in the variable.

Could you Help me please?.  Is there any manual to learn code for knowage??.

Thanks so much.
Environment knowage 6.3.3
in Build by (120 points)

Please log in or register to answer this question.

...