{"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":"c7b8e51c-e19a-59f4-aac8-e294205a6079","task_key":"default--v0~2e1~2e0~5fhf--c7b8e51c-e19a-59f4-aac8-e294205a6079","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf c7b8e51c-e19a-59f4-aac8-e294205a6079","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, col_a='A', col_b='B', col_c='C', seed=None):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\n\\ndef task_func(df, col_a='A', col_b='B', col_c='C', seed=None):\\n    \\\"\\\"\\\"\\n    This function filters rows from the input DataFrame 'df' based on conditions in columns 'B' and 'C', \\n    then uses linear regression to predict values in column 'B' using data from column 'A'. \\n    Specifically, it selects rows where column 'B' values are greater than 50 and column 'C' values equal 900.\\n    \\n    A train test split of the remaining data is performed, where the test_size = 0.2\\n    and col_a is used as X value and col_b is used as Y values / target.\\n\\n    This data is used to train a LinearRegression model. \\n\\n    The test split is used to generate predictions for col_b. These predictions\\n    are returned as well as the trained model.\\n\\n    If df is empty or empty after the filtering, None is returned.\\n    If df does contain non numeric data None is returned.\\n    If the specified columns are not contained in df, None is returned.\\n\\n    Parameters:\\n    df (DataFrame): The input pandas DataFrame with numeric data.\\n    col_a (str): The name of the first column to use for prediction (default is 'A').\\n    col_b (str): The name of the second column, the values of which are to be predicted (default is 'B').\\n    col_c (str): The name of the third column to use for row selection (default is 'C').\\n    seed (int, optional): random seed for the train test split. Default is None.\\n\\n    Returns:\\n    ndarray: The predicted values for the filtered rows in column 'B', or None if input is invalid.\\n    LinearRegression: The trained linear regression model is returned, if \\n    \\n    Requirements:\\n    - pandas\\n    - sklearn.model_selection\\n    - sklearn.linear_model\\n\\n    Example:\\n    >>> np.random.seed(32)\\n    >>> df = pd.DataFrame({'A': np.random.randint(0, 100, 1000),\\n    ...                    'B': np.random.randint(0, 100, 1000),\\n    ...                    'C': np.random.choice([900, 800, 700, 600], 1000)})\\n    >>> predictions, model = task_func(df, seed=1)\\n    >>> print(predictions)\\n    [77.21974339 76.26960987 76.34878767 77.16695819 76.53353585 76.86344332\\n     76.86344332 77.19335079 76.81065812 76.77106923 76.79746183 77.0481915\\n     76.23002098 76.63910624 77.114173   76.04527279 77.0217989  76.0188802\\n     77.18015449 76.91622851 76.62590994 76.90303222 76.75787293 77.29892118\\n     77.18015449 76.07166539 76.04527279 76.88983592]\\n    >>> print(model)\\n    LinearRegression()\\n\\n    >>> df = pd.DataFrame({'A': [1, 2, 3, 4, 5],\\n    ...                    'B': [10, 80, 80, 80, 80],\\n    ...                    'C': [900, 900, 900, 900, 900]})\\n    >>> predictions, model = task_func(df, seed=12)\\n    >>> print(predictions) \\n    [80.]\\n    >>> print(model)\\n    LinearRegression()\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"This function filters rows from the input DataFrame 'df' based on conditions in columns 'B' and 'C', then uses linear regression to predict values in column 'B' using data from column 'A'. Specifically, it selects rows where column 'B' values are greater than 50 and column 'C' values equal 900. A train test split of the remaining data is performed, where the test_size = 0.2 and col_a is used as X value and col_b is used as Y values / target. This data is used to train a LinearRegression model. The test split is used to generate predictions for col_b. These predictions are returned as well as the trained model. If df is empty or empty after the filtering, None is returned. If df does contain non numeric data None is returned. If the specified columns are not contained in df, None is returned. >>> df = pd.DataFrame({'A': [1, 2, 3, 4, 5], ...                    'B': [10, 80, 80, 80, 80], ...                    'C': [900, 900, 900, 900, 900]}) >>> predictions, model = task_func(df, seed=12) >>> print(predictions) [80.] >>> print(model) LinearRegression()\\nThe function should output with:\\n    ndarray: The predicted values for the filtered rows in column 'B', or None if input is invalid.\\n    LinearRegression: The trained linear regression model is returned, if\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(df, col_a='A', col_b='B', col_c='C', seed=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":[]}