Skip to content

Tag: scikit-learn

How do I load a dataframe in Python sklearn?

I did some computations in an IPython Notebook and ended up with a dataframe df which isn’t saved anywhere yet. In the same IPython Notebook, I want to work with this dataframe using sklearn. df is a dataframe with 4 columns: id (string), value(int), rated(bool), score(float). I am trying to determine w…

How to print KMeans intiatial parameters?

I am using PyCharm to run Kmeans using Iris data. When I run this, simply prints KMeans() But I would like it to print the following: How can this be accomplished? Answer Simply run kmeans.get_params(). This will print out the parameters (default or custom) used while instantiating the function in a dictionar…