{"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":"fa8220cf-03b4-5e19-98d6-6a71af860e28","task_key":"default--v0~2e1~2e0~5fhf--fa8220cf-03b4-5e19-98d6-6a71af860e28","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf fa8220cf-03b4-5e19-98d6-6a71af860e28","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.ensemble import RandomForestRegressor\\nfrom sklearn.metrics import mean_squared_error\\ndef task_func(data, target, test_size=0.2, random_state=None):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.ensemble import RandomForestRegressor\\nfrom sklearn.metrics import mean_squared_error\\n\\ndef task_func(data, target, test_size=0.2, random_state=None):\\n    \\\"\\\"\\\"\\n    Trains a RandomForestRegressor model and returns the mean squared error \\n    (MSE) of the predictions and the model.\\n\\n    First the data is converted into a pandas DataFrame and then split into a train and test set. The fractional size of\\n    the test set is determined by 'test_size'. Then a RandomForestRegressor is\\n    trained on the data, using the in 'target' specified column as target.\\n\\n    The MSE on the test set is calculated. \\n\\n    Parameters:\\n    data (dictionary): A DataFrame containing the dataset, including the target column.\\n    target (str): The name of the target column in the data DataFrame.\\n    test_size (float, optional): The proportion of the dataset to include in the test split. Default is 0.2.\\n    random_state (int, optional): Controls both the randomness of the bootstrapping of the samples used \\n                                   when building trees and the sampling of the features to consider when \\n                                   looking for the best split at each node. Default is None.\\n\\n    Returns:\\n    float: The mean squared error of the model's predictions on the test set.\\n    RandomForestRegressor: The trained model.\\n    DataFrame: The converted dictionary input data.\\n\\n    Raises:\\n    ValueError: If the input DataFrame is empty or the target column name is not in the DataFrame.\\n\\n    Requirements:\\n    - pandas\\n    - sklearn: sklearn.model_selection.train_test_split,\\n               sklearn.ensemble.RandomForestRegressor,\\n               sklearn.metrics.mean_squared_error\\n\\n    Examples:\\n    >>> data = {'feature1': [1,2,3], 'feature2': [2,3,4], 'target': [5,6,7]}\\n    >>> task_func(data, 'target', random_state=1)\\n    (1.6899999999999995, RandomForestRegressor(random_state=1),    feature1  feature2  target\\n    0         1         2       5\\n    1         2         3       6\\n    2         3         4       7)\\n    >>> data = {'feature1': [1, 2, 3, 53], 'feature2': [2, 3, 4, 1], 'feature3': [-12, -2, 4.2, -2], 'trgt': [5, 6, 7, 1]}\\n    >>> task_func(data, 'trgt', random_state=12, test_size=0.4)\\n    (2.7250000000000005, RandomForestRegressor(random_state=12),    feature1  feature2  feature3  trgt\\n    0         1         2     -12.0     5\\n    1         2         3      -2.0     6\\n    2         3         4       4.2     7\\n    3        53         1      -2.0     1)\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Trains a RandomForestRegressor model and returns the mean squared error (MSE) of the predictions and the model. First the data is converted into a pandas DataFrame and then split into a train and test set. The fractional size of the test set is determined by 'test_size'. Then a RandomForestRegressor is trained on the data, using the in 'target' specified column as target. The MSE on the test set is calculated.\\nThe function should raise the exception for: ValueError: If the input DataFrame is empty or the target column name is not in the DataFrame.\\nThe function should output with:\\n    float: The mean squared error of the model's predictions on the test set.\\n    RandomForestRegressor: The trained model.\\n    DataFrame: The converted dictionary input data.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.ensemble import RandomForestRegressor\\nfrom sklearn.metrics import mean_squared_error\\ndef task_func(data, target, test_size=0.2, random_state=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":[]}