{"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":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"37d1cdc0-90d3-55eb-90da-12814f0d2f72","task_key":"default--v0~2e1~2e0~5fhf--37d1cdc0-90d3-55eb-90da-12814f0d2f72","task_revision_id":"2","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 37d1cdc0-90d3-55eb-90da-12814f0d2f72","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nimport matplotlib.pyplot as plt\\nfrom sklearn.decomposition import PCA\\ndef task_func(data_matrix, n_components=2):\\n\",\"complete_prompt\":\"import pandas as pd\\nimport matplotlib.pyplot as plt\\nfrom sklearn.decomposition import PCA\\n\\n\\ndef task_func(data_matrix, n_components=2):\\n    \\\"\\\"\\\"\\n    Apply PCA with n_components components to a 2D data matrix, calculate the mean value of each component, and then return the cumulative explained variance of the components in a plot.\\n    - The function returns a dataframe with columns 'Component 1', 'Component 2', ... etc.\\n    - Each row of the dataframe correspond to a row of the original matrix mapped in the PCA space.\\n    - The dataframe should also include a column 'Mean' which is the average value of each component value per row\\n    - Create a plot of the cumulative explained variance.\\n        - the xlabel should be 'Number of Components' and the ylabel 'Cumulative Explained Variance'\\n\\n    Parameters:\\n    data_matrix (numpy.array): The 2D data matrix.\\n\\n    Returns:\\n    tuple:\\n        - pandas.DataFrame: A DataFrame containing the PCA transformed data and the mean of each component.\\n        - matplotlib.axes._axes.Axes: A plot showing the cumulative explained variance of the components.\\n\\n    Requirements:\\n    - pandas\\n    - matplotlib.pyplot\\n    - sklearn.decomposition\\n\\n    Example:\\n    >>> import numpy as np\\n    >>> data = np.array([[6, 8, 1, 3, 4], [-1, 0, 3, 5, 1]])\\n    >>> df, ax = task_func(data)\\n    >>> print(df[\\\"Mean\\\"])\\n    0    2.850439\\n    1   -2.850439\\n    Name: Mean, dtype: float64\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Apply PCA with n_components components to a 2D data matrix, calculate the mean value of each component, and then return the cumulative explained variance of the components in a plot. - The function returns a dataframe with columns 'Component 1', 'Component 2', ... etc. - Each row of the dataframe correspond to a row of the original matrix mapped in the PCA space. - The dataframe should also include a column 'Mean' which is the average value of each component value per row - Create a plot of the cumulative explained variance. - the xlabel should be 'Number of Components' and the ylabel 'Cumulative Explained Variance'\\nThe function should output with:\\n    tuple:\\n    pandas.DataFrame: A DataFrame containing the PCA transformed data and the mean of each component.\\n    matplotlib.axes._axes.Axes: A plot showing the cumulative explained variance of the components.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nimport matplotlib.pyplot as plt\\nfrom sklearn.decomposition import PCA\\ndef task_func(data_matrix, n_components=2):\\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":"noindex","subproblems":[],"grids":[]}