<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(dataset, num_clusters=None, features=None, label=None, initial_centers=None, max_iterations=10, batch_size=None, verbose=True):
 """ Create a k-means clustering model. The KmeansModel object contains the computed cluster centers and the cluster assignment for each instance in the input 'dataset'. Given a number of clusters, k-means iteratively chooses the best cluster centers and assigns nearby points to the best cluster. If no points change cluster membership between iterations, the algorithm terminates. Parameters dataset : SFrame Each row in the SFrame is an observation. num_clusters : int Number of clusters. This is the 'k' in k-means. features : list[str], optional Names of feature columns to use in computing distances between observations and cluster centers. 'None' (the default) indicates that all columns should be used as features. Columns may be of the following types: - *Numeric*: values of numeric type integer or float. - *Array*: list of numeric (int or float) values. Each list element is treated as a distinct feature in the model. - *Dict*: dictionary of keys mapped to numeric values. Each unique key is treated as a distinct feature in the model. Note that columns of type *list* are not supported. Convert them to array columns if all entries in the list are of numeric types. label : str, optional Name of the column to use as row labels in the Kmeans output. The values in this column must be integers or strings. If not specified, row numbers are used by default. initial_centers : SFrame, optional Initial centers to use when starting the K-means algorithm. If specified, this parameter overrides the *num_clusters* parameter. The 'initial_centers' SFrame must contain the same features used in the input 'dataset'. If not specified (the default), initial centers are chosen intelligently with the K-means++ algorithm. max_iterations : int, optional The maximum number of iterations to run. Prints a warning if the algorithm does not converge after max_iterations iterations. If set to 0, the model returns clusters defined by the initial centers and assignments to those centers. batch_size : int, optional Number of randomly-chosen data points to use in each iteration. If 'None' (the default) or greater than the number of rows in 'dataset', then this parameter is ignored: all rows of `dataset` are used in each iteration and model training terminates once point assignments stop changing or `max_iterations` is reached. verbose : bool, optional If True, print model training progress to the screen. Returns ------- out : KmeansModel A Model object containing a cluster id for each vertex, and the centers of the clusters. See Also -------- KmeansModel Notes ----- - Integer features in the 'dataset' or 'initial_centers' inputs are converted internally to float type, and the corresponding features in the output centers are float-typed. - It can be important for the K-means model to standardize the features so they have the same scale. This function does *not* standardize automatically. References - `Wikipedia - k-means clustering <http://en.wikipedia.org/wiki/K-means_clustering>`_ - Artuhur, D. and Vassilvitskii, S. (2007) `k-means++: The Advantages of Careful Seeding <http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf>`_. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms. pp. 1027-1035. - Elkan, C. (2003) `Using the triangle inequality to accelerate k-means <http://www.aaai.org/Papers/ICML/2003/ICML03-022.pdf>`_. In Proceedings of the Twentieth International Conference on Machine Learning, Volume 3, pp. 147-153. - Sculley, D. (2010) `Web Scale K-Means Clustering <http://www.eecs.tufts.edu/~dsculley/papers/fastkmeans.pdf>`_. In Proceedings of the 19th International Conference on World Wide Web. pp. 1177-1178 Examples -------- """

    opts = {'model_name': 'kmeans',
            'max_iterations': max_iterations,
            }

    ## Validate the input dataset and initial centers.
    _validate_dataset(dataset)

    if initial_centers is not None:
        _validate_initial_centers(initial_centers)

    ## Validate and determine the correct number of clusters.
    opts['num_clusters'] = _validate_num_clusters(num_clusters,
                                                  initial_centers,
                                                  dataset.num_rows())

    ## Validate the row label
    col_type_map = {c: dataset[c].dtype for c in dataset.column_names()}

    if label is not None:
        _validate_row_label(label, col_type_map)

        if label in ['cluster_id', 'distance']:
            raise ValueError("Row label column name cannot be 'cluster_id' " +
                             "or 'distance'; these are reserved for other " +
                             "columns in the Kmeans model's output.")

        opts['row_labels'] = dataset[label]
        opts['row_label_name'] = label

    else:
        opts['row_labels'] = _tc.SArray.from_sequence(dataset.num_rows())
        opts['row_label_name'] = 'row_id'


    ## Validate the features relative to the input dataset.
    if features is None:
        features = dataset.column_names()

    valid_features = _validate_features(features, col_type_map,
                                        valid_types=[_array, dict, int, float],
                                        label=label)

    sf_features = dataset.select_columns(valid_features)
    opts['features'] = sf_features

    ## Validate the features in the initial centers (if provided)
    if initial_centers is not None:
        try:
            initial_centers = initial_centers.select_columns(valid_features)
        except:
            raise ValueError("Specified features cannot be extracted from " +
                             "the provided initial centers.")

        if initial_centers.column_types() != sf_features.column_types():
            raise TypeError("Feature types are different in the dataset and " +
                            "initial centers.")

    else:
        initial_centers = _tc.SFrame()

    opts['initial_centers'] = initial_centers

    ## Validate the batch size and determine the training method.
    if batch_size is None:
        opts['method'] = 'elkan'
        opts['batch_size'] = dataset.num_rows()

    else:
        opts['method'] = 'minibatch'
        opts['batch_size'] = batch_size

    ## Create and return the model
    with _QuietProgress(verbose):
        params = _tc.extensions._kmeans.train(opts)

    return KmeansModel(params['model'])