{"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":"8d9a6ea2-a611-5ec6-8cc7-a5ef25aa2763","task_key":"default--v0~2e1~2e0~5fhf--8d9a6ea2-a611-5ec6-8cc7-a5ef25aa2763","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 8d9a6ea2-a611-5ec6-8cc7-a5ef25aa2763","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(file_path, output_path=None, sort_key='title', linear_regression=False, x_column=None, y_column=None):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\n\\n\\ndef task_func(file_path, output_path=None, sort_key='title', linear_regression=False, x_column=None, y_column=None):\\n    \\\"\\\"\\\"\\n    Sorts a CSV file by a specific column key using pandas, and optionally writes the sorted data to another CSV file.\\n    Can also fit a linear regression model to specified columns if required.\\n\\n    Parameters:\\n    file_path (str): The path to the input CSV file. This parameter is required.\\n    output_path (str): The path where the sorted CSV will be saved. If not provided, the function won't save the sorted dataframe.\\n    sort_key (str): The column name used as a key to sort the CSV file. Defaults to 'title'.\\n    linear_regression (bool): If True, fits a linear regression model to the specified columns. Defaults to False.\\n    x_column (str): The name of the column to use as the predictor variable for linear regression.\\n    y_column (str): The name of the column to use as the response variable for linear regression.\\n\\n    Returns: \\n    DataFrame, str, or LinearRegression model: The sorted pandas DataFrame if 'output_path' is None and\\n    'linear_regression' is False, otherwise the path to the saved output file. If 'linear_regression' is True,\\n    returns the fitted model.\\n\\n    Raises:\\n    Exception: If there is an error in reading, sorting the data, or fitting the model.\\n    If the specified columns for linear regression do not exist in the dataframe, a ValueError with \\\"Specified columns for linear regression do not exist in the dataframe\\\" message is also raised.\\n\\n    \\n    Requirements:\\n    - pandas\\n    - scikit-learn\\n\\n    Example:\\n    >>> model = task_func('data.csv', sort_key='title', linear_regression=True, x_column='age', y_column='salary')\\n    >>> # Returns a fitted LinearRegression model based on 'age' and 'salary' columns.\\n\\n    \\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Sorts a CSV file by a specific column key using pandas, and optionally writes the sorted data to another CSV file. Can also fit a linear regression model to specified columns if required.\\nThe function should raise the exception for: Exception: If there is an error in reading, sorting the data, or fitting the model. If the specified columns for linear regression do not exist in the dataframe, a ValueError with \\\"Specified columns for linear regression do not exist in the dataframe\\\" message is also raised.\\nThe function should output with:\\n    DataFrame, str, or LinearRegression model: The sorted pandas DataFrame if 'output_path' is None and\\n    'linear_regression' is False, otherwise the path to the saved output file. If 'linear_regression' is True,\\n    returns the fitted model.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(file_path, output_path=None, sort_key='title', linear_regression=False, x_column=None, y_column=None):\\n```\",\"libs\":\"['pandas', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}