{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"bigcodebench","formal_name":"BigCodeBench","introduction":"BigCodeBench poses 1,140 function-level tasks drawn across 139 libraries. It tests whether a model can compose several real APIs correctly rather than write one self-contained function.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://bigcode-bench.github.io/","indexing_mode":"index","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[],"history":"","construction":"","limitations":"","saturation":"","scores":[]}},"task_id":"d3f45f1b-504e-5ca8-8a95-4bae26778774","task_key":"default--v0~2e1~2e0~5fhf--d3f45f1b-504e-5ca8-8a95-4bae26778774","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf d3f45f1b-504e-5ca8-8a95-4bae26778774","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(s1, s2, n_clusters=3):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\n\\n\\ndef task_func(s1, s2, n_clusters=3):\\n    \\\"\\\"\\\"\\n    Perform K-Means clustering on data points from two pandas Series and visualize the clusters.\\n\\n    Parameters:\\n    - s1 (pandas.Series): The first series of data. Each value in the series represents a data point's coordinate along one dimension.\\n    - s2 (pandas.Series): The second series of data. Each value corresponds to a data point's coordinate along another dimension. The length of s2 must match that of s1.\\n    - n_clusters (int, optional): The number of clusters to form as well as the number of centroids to generate. Defaults to 3.\\n\\n    Returns:\\n    - tuple: A tuple containing the following elements:\\n        - ndarray: An array of cluster labels indicating the cluster each data point belongs to.\\n        - matplotlib.axes.Axes: The Axes object of the plot, which shows the data points colored according to their cluster labels.\\n\\n    Raises:\\n    - ValueError: If either s1 or s2 is not a pandas Series, raise \\\"s1 and s2 must be pandas Series\\\"\\n    - ValueError: If s1 and s2 have different lengths, raise \\\"s1 and s2 must have the same length\\\"\\n\\n    Requirements:\\n    - pandas\\n    - scikit-learn\\n    - matplotlib\\n\\n    Notes:\\n    - The function needs to ensure that s1 and s2 are pandas Series of equal length. \\n    - It then performs K-Means clustering on the combined data points from s1 and s2. \\n    - After clustering, it creates a scatter plot where each cluster is visualized with a different color. \\n    - The plot title is set to \\\"K-Means Clustering\\\" to describe the visualization technique. \\n    - A legend is added, which uses elements from the scatter plot to describe each cluster.\\n        \\n    Example:\\n    >>> s1 = pd.Series(np.random.rand(100), name='feature1')\\n    >>> s2 = pd.Series(np.random.rand(100), name='feature2')\\n    >>> labels, ax = task_func(s1, s2, n_clusters=4)\\n    >>> print(ax.get_title())\\n    K-Means Clustering\\n\\n   \\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Perform K-Means clustering on data points from two pandas Series and visualize the clusters.\\nNote that: Notes: The function needs to ensure that s1 and s2 are pandas Series of equal length. It then performs K-Means clustering on the combined data points from s1 and s2. After clustering, it creates a scatter plot where each cluster is visualized with a different color. The plot title is set to \\\"K-Means Clustering\\\" to describe the visualization technique. A legend is added, which uses elements from the scatter plot to describe each cluster.\\nThe function should raise the exception for: ValueError: If either s1 or s2 is not a pandas Series, raise \\\"s1 and s2 must be pandas Series\\\" ValueError: If s1 and s2 have different lengths, raise \\\"s1 and s2 must have the same length\\\"\\nThe function should output with:\\n    tuple: A tuple containing the following elements:\\n    ndarray: An array of cluster labels indicating the cluster each data point belongs to.\\n    matplotlib.axes.Axes: The Axes object of the plot, which shows the data points colored according to their cluster labels.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(s1, s2, n_clusters=3):\\n```\",\"libs\":\"['pandas', 'matplotlib', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}