Skip to content

Tag: scikit-learn

Scaling / Normalizing pandas column

I have a dataframe like: I’d like to create a newly scaled column in the dataframe called SIZE where SIZE is a number between 5 and 50. For Example: I’ve tried but got Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a sin…

Kmean clustering top terms in cluster

I am using python Kmean clustering algorithm for cluster document. I have created a term-document matrix Then I applied Kmean clustering using following code My next task is to see the top terms in every cluster, searching on googole suggested that many of the people has used the km.cluster_centers_.argsort()…