Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sklearn.cluster import KMeans
from sklearn.utils import check_random_state
from sklearn.datasets.samples_generator import make_blobs
RUNS = 1
_CLUSTERS = 4
@spyhi
spyhi / BCclusterAnalysis.py
Created October 24, 2017 05:49
Python SKLearn KMeans Cluster Analysis on UW Breast Cancer Data
import pandas as pd #Using Pandas for DataFrame
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D #Create 3D plot
from sklearn.cluster import KMeans #Import learning algorithm
# Simple KMeans cluster analysis on breast cancer data using Python, SKLearn, Numpy, and Pandas
# Created for ICS 491 (Big Data) at University of Hawaii at Manoa, Fall 2017
# Questions? Tweet me at https://twitter.com/spyhi