{"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":"6defc411-efb7-5945-999a-a22121f6c4f4","task_key":"default--v0~2e1~2e0~5fhf--6defc411-efb7-5945-999a-a22121f6c4f4","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 6defc411-efb7-5945-999a-a22121f6c4f4","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import heapq\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, feature, target, n=10):\\n\",\"complete_prompt\":\"import heapq\\nfrom sklearn.linear_model import LinearRegression\\n\\ndef task_func(df, feature, target, n=10):\\n    \\\"\\\"\\\"\\n    Fit a simple linear regression model to two columns of a DataFrame \\n    specified by feature and target. \\n    return the indices of the n largest residuals as well as the linear \\n    regression model.\\n    \\n    Parameters:\\n    df (pandas.DataFrame): A DataFrame with at least two numerical columns named 'col1' and 'col2'.\\n    feature (str): The DataFrame column used as feature.\\n    target (str): The DataFrame column used as target.\\n    n (int, optional): Number of largest residuals to return. Default is 10.\\n    \\n    Returns:\\n    list[int]: Indices of the n largest residuals.\\n    LinearRegression: The LinearRegression model.\\n    \\n    Raises:\\n    ValueError: If specified columns are not in the provided DataFrame.\\n\\n    Requirements:\\n    - heapq\\n    - sklearn.linear_model\\n    \\n    Example:\\n    >>> df = pd.DataFrame({\\n    ...     'col1': [99, 86, 90, 70, 86, 95, 56, 98, 80, 81],\\n    ...     'col2': [21, 11, 21, 1, 26, 40, 4, 50, 34, 37]\\n    ... })\\n    >>> indices, model = task_func(df, 'col1', 'col2', n=5)\\n    >>> print(indices)\\n    [0, 1, 9, 7, 8]\\n    >>> print(model)\\n    LinearRegression()\\n\\n    >>> df = pd.DataFrame({\\n    ...     'a': [1, 2, 3, 4, 5],\\n    ...     'b': [1, 2, 3, 4, 5]\\n    ... })\\n    >>> indices, model = task_func(df, 'a', 'b', n=3)\\n    >>> print(indices)\\n    [0, 1, 2]\\n    >>> print(model)\\n    LinearRegression()\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Fit a simple linear regression model to two columns of a DataFrame specified by feature and target. return the indices of the n largest residuals as well as the linear regression model. >>> df = pd.DataFrame({ ...     'a': [1, 2, 3, 4, 5], ...     'b': [1, 2, 3, 4, 5] ... }) >>> indices, model = task_func(df, 'a', 'b', n=3) >>> print(indices) [0, 1, 2] >>> print(model) LinearRegression()\\nThe function should raise the exception for: ValueError: If specified columns are not in the provided DataFrame.\\nThe function should output with:\\n    list[int]: Indices of the n largest residuals.\\n    LinearRegression: The LinearRegression model.\\nYou should write self-contained code starting with:\\n```\\nimport heapq\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, feature, target, n=10):\\n```\",\"libs\":\"['sklearn', 'heapq']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}