{"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":"23265cc6-cef1-5253-b2c0-17a698fb9bfb","task_key":"default--v0~2e1~2e0~5fhf--23265cc6-cef1-5253-b2c0-17a698fb9bfb","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 23265cc6-cef1-5253-b2c0-17a698fb9bfb","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nfrom sklearn.decomposition import PCA\\nimport matplotlib.pyplot as plt\\ndef task_func(P, T, tensor_shape=(3, 3, 3)):\\n\",\"complete_prompt\":\"import numpy as np\\nfrom sklearn.decomposition import PCA\\nimport matplotlib.pyplot as plt\\n\\n\\ndef task_func(P, T, tensor_shape=(3, 3, 3)):\\n    \\\"\\\"\\\"\\n    Calculate the product of a matrix \\\"P\\\" and a 3D tensor \\\"T\\\" with numpy and then apply PCA to reduce the\\n    dimensionality of the result. The resulting 2D data is then visualized.\\n    Note: This function only accepts numpy matrices/arrays.\\n\\n    Parameters:\\n    P (numpy.ndarray): The input matrix.\\n    T (numpy.ndarray): The input tensor. Must have same shape as tensor_shape.\\n    tensor_shape (tuple, optional): The shape of the tensor. Must be same as T.shape. Default is (3, 3, 3).\\n\\n    Returns:\\n    pca_result (numpy.ndarray): The result of PCA of shape (N, 2), where N is the number of rows in matrix P.\\n    ax (matplotlib.axes.Axes): Plot of 'PCA Result Visualization', with 'Principal Component 1' on the x-axis\\n                               and 'Principal Component 2' on the y-axis.\\n\\n\\n\\n    Requirements:\\n    - numpy\\n    - sklearn.decomposition\\n    - matplotlib.pyplot\\n\\n    Example:\\n    >>> P = np.array([[6, 2, 7], [1, 1, 8], [8, 7, 1], [9, 6, 4], [2, 1, 1]])\\n    >>> T = np.array([[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[1, 2, 3], [4, 5, 6], [7, 8, 9]]])\\n    >>> pca_result, ax = task_func(P, T)\\n    >>> pca_result.shape\\n    (3, 2)\\n    >>> type(ax)\\n    <class 'matplotlib.axes._axes.Axes'>\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Calculate the product of a matrix \\\"P\\\" and a 3D tensor \\\"T\\\" with numpy and then apply PCA to reduce the dimensionality of the result. The resulting 2D data is then visualized.\\nNote that: This function only accepts numpy matrices/arrays.\\nThe function should output with:\\n    pca_result (numpy.ndarray): The result of PCA of shape (N, 2), where N is the number of rows in matrix P.\\n    ax (matplotlib.axes.Axes): Plot of 'PCA Result Visualization', with 'Principal Component 1' on the x-axis\\n    and 'Principal Component 2' on the y-axis.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nfrom sklearn.decomposition import PCA\\nimport matplotlib.pyplot as plt\\ndef task_func(P, T, tensor_shape=(3, 3, 3)):\\n```\",\"libs\":\"['numpy', '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":[]}