{"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":"d3855aa7-b018-5d29-807e-a0b3edb0cc4d","task_key":"default--v0~2e1~2e0~5fhf--d3855aa7-b018-5d29-807e-a0b3edb0cc4d","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf d3855aa7-b018-5d29-807e-a0b3edb0cc4d","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 RandomForestClassifier\\nfrom sklearn.metrics import accuracy_score\\ndef task_func(df, test_size=0.2, random_state=42):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.ensemble import RandomForestClassifier\\nfrom sklearn.metrics import accuracy_score\\n\\ndef task_func(df, test_size=0.2, random_state=42):\\n    \\\"\\\"\\\"\\n    Predicts categories based on 'Age' and 'Score' in a given DataFrame using a Random Forest Classifier. \\n    Rows with duplicate 'Name' entries are dropped before the prediction. The function uses a Random Forest Classifier \\n    from sklearn to make predictions and evaluates the model using accuracy.\\n\\n    Parameters:\\n    df (DataFrame): A pandas DataFrame with columns 'Name', 'Age', 'Score', and 'Category'.\\n    test_size (float, optional): Proportion of the dataset to include in the test split. Default is 0.2.\\n    random_state (int, optional): Controls the shuffling applied to the data before applying the split. Default is 42.\\n\\n    Returns:\\n    float: The accuracy of the prediction as a float value.\\n    \\n    Raises:\\n    - The function will raise a ValueError is input df is not a DataFrame.\\n    \\n    Requirements:\\n    - pandas\\n    - sklearn.model_selection.train_test_split\\n    - sklearn.ensemble.RandomForestClassifier\\n    - sklearn.metrics.accuracy_score\\n\\n    Example:\\n    >>> data = pd.DataFrame([{'Name': 'James', 'Age': 30, 'Score': 85, 'Category': 'Electronics'}, {'Name': 'Lily', 'Age': 28, 'Score': 92, 'Category': 'Home'}])\\n    >>> accuracy = task_func(data)\\n    >>> accuracy <= 1.0\\n    True\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Predicts categories based on 'Age' and 'Score' in a given DataFrame using a Random Forest Classifier. Rows with duplicate 'Name' entries are dropped before the prediction. The function uses a Random Forest Classifier from sklearn to make predictions and evaluates the model using accuracy.\\nThe function should raise the exception for: The function will raise a ValueError is input df is not a DataFrame.\\nThe function should output with:\\n    float: The accuracy of the prediction as a float value.\\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 RandomForestClassifier\\nfrom sklearn.metrics import accuracy_score\\ndef task_func(df, test_size=0.2, random_state=42):\\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":[]}