{"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":"cb5e8849-4757-525e-b010-ab1ed0a59465","task_key":"default--v0~2e1~2e0~5fhf--cb5e8849-4757-525e-b010-ab1ed0a59465","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf cb5e8849-4757-525e-b010-ab1ed0a59465","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"from collections import Counter\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(df, n_clusters=3, random_state=None, n_init=10):\\n\",\"complete_prompt\":\"from collections import Counter\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\n\\n\\ndef task_func(df, n_clusters=3, random_state=None, n_init=10):\\n    \\\"\\\"\\\"\\n    Identify duplicate points in a DataFrame, perform KMeans clustering on the unique points,\\n    and record the clusters.\\n\\n    Parameters:\\n    df (pd.DataFrame): A DataFrame containing at least two columns 'x' and 'y' representing points.\\n    n_clusters (int, optional): Number of clusters for KMeans clustering. Default is 3.\\n    random_state (int, optional): The seed used by the random number generator for reproducibility. Default is None.\\n    n_init (int, optional): Number of time the k-means algorithm will be run with different centroid seeds.\\n                            The final results will be the best output of n_init consecutive runs in terms of\\n                            within-cluster sum of squares. Default is 10.\\n\\n    Returns:\\n    tuple: A tuple containing:\\n        - Counter: A Counter object with the count of duplicate points.\\n        - pd.DataFrame: A DataFrame with an additional column 'cluster' representing cluster assignments for unique points.\\n        - Axes: A scatter plot of the clustered data.\\n\\n    Requirements:\\n    - collections.Counter\\n    - sklearn.cluster.KMeans\\n    - matplotlib.pyplot\\n\\n    Example:\\n    >>> df = pd.DataFrame({\\\\\\n            'x': [1, 2, 2, 2, 3, 4],\\\\\\n            'y': [1, 1, 1, 1, 3, 3]\\\\\\n        })\\n    >>> duplicates, df_clustered, ax = task_func(df, random_state=42)\\n    >>> df_clustered\\n       x  y  cluster\\n    0  1  1        2\\n    1  2  1        0\\n    4  3  3        1\\n    5  4  3        1\\n    >>> duplicates\\n    Counter({(2, 1): 3})\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Identify duplicate points in a DataFrame, perform KMeans clustering on the unique points, and record the clusters.\\nThe function should output with:\\n    tuple: A tuple containing:\\n    Counter: A Counter object with the count of duplicate points.\\n    pd.DataFrame: A DataFrame with an additional column 'cluster' representing cluster assignments for unique points.\\n    Axes: A scatter plot of the clustered data.\\nYou should write self-contained code starting with:\\n```\\nfrom collections import Counter\\nfrom sklearn.cluster import KMeans\\nimport matplotlib.pyplot as plt\\ndef task_func(df, n_clusters=3, random_state=None, n_init=10):\\n```\",\"libs\":\"['collections', '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":[]}