{"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":"7b01539d-779c-5915-aef8-cbd25d1e1c6a","task_key":"default--v0~2e1~2e0~5fhf--7b01539d-779c-5915-aef8-cbd25d1e1c6a","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 7b01539d-779c-5915-aef8-cbd25d1e1c6a","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nimport pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, target_column, target_values=None):\\n\",\"complete_prompt\":\"import numpy as np\\nimport pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\n\\n\\ndef task_func(df, target_column, target_values=None):\\n    \\\"\\\"\\\"\\n    Replace all elements in DataFrame columns that are not present in the target_values array with zeros, and then perform a linear regression using the target column.\\n\\n    Parameters:\\n        df (DataFrame): The input pandas DataFrame.\\n        target_column (str): The target column for the linear regression.\\n        target_values (array-like, optional): An array of target values to keep in the DataFrame. \\n        All other values will be replaced with zeros. Defaults to None.\\n\\n\\n    Returns:\\n        LinearRegression: The trained Linear Regression model.\\n\\n    Raises:\\n        ValueError: If df is not a DataFrame or if target_column is not a string or if target_values is not an array-like object\\n\\n    Requirements:\\n        - numpy\\n        - pandas\\n        - sklearn.linear_model.LinearRegression\\n\\n    Example:\\n        >>> rng = np.random.default_rng(seed=0)\\n        >>> df = pd.DataFrame(rng.integers(0, 100, size=(1000, 2)), columns=['A', 'predict'])\\n        >>> model = task_func(df, 'predict')\\n        >>> print(model.coef_)\\n        [-0.04934205]\\n        >>> print(model.intercept_)  \\n        53.67665840020308\\n\\n        >>> rng = np.random.default_rng(seed=0)\\n        >>> df = pd.DataFrame(rng.integers(0, 100, size=(1000, 5)), columns=['A', 'B', 'C', 'D', 'predict'])\\n        >>> model = task_func(df, 'predict')\\n        >>> print(model.coef_)\\n        [-0.00173703 -0.02190392 -0.03304266  0.00759771]\\n        >>> print(model.intercept_)\\n        53.362739257681035\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Replace all elements in DataFrame columns that are not present in the target_values array with zeros, and then perform a linear regression using the target column. >>> rng = np.random.default_rng(seed=0) >>> df = pd.DataFrame(rng.integers(0, 100, size=(1000, 5)), columns=['A', 'B', 'C', 'D', 'predict']) >>> model = task_func(df, 'predict') >>> print(model.coef_) [-0.00173703 -0.02190392 -0.03304266  0.00759771] >>> print(model.intercept_) 53.362739257681035\\nThe function should raise the exception for: ValueError: If df is not a DataFrame or if target_column is not a string or if target_values is not an array-like object\\nThe function should output with:\\n    LinearRegression: The trained Linear Regression model.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nimport pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, target_column, target_values=None):\\n```\",\"libs\":\"['pandas', 'numpy', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}