# BigCodeBench / 

task_id: cc3787d3-82cb-5a3b-8dcd-6ab8392f29e0
task_key: default--v0~2e1~2e0~5fhf--cc3787d3-82cb-5a3b-8dcd-6ab8392f29e0
task_revision_id: 1

{"code_prompt":"import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report\ndef task_func(csv_file_path, target_column=\"target\", test_size=0.2, n_estimators=100):\n","complete_prompt":"import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report\n\n\ndef task_func(csv_file_path, target_column=\"target\", test_size=0.2, n_estimators=100):\n    \"\"\"\n    Processes a CSV file to train a Random Forest classifier and generates a formatted classification report.\n\n    Parameters:\n        csv_file_path (str): The path to the CSV file containing the data.\n        target_column (str, optional): The name of the target variable column. Defaults to 'target'.\n        test_size (float, optional): The proportion of the dataset to include in the test split. Defaults to 0.2.\n        n_estimators (int, optional): The number of trees in the RandomForestClassifier. Defaults to 100.\n\n    Returns:\n        str: A formatted classification report. The report includes metrics such as precision, recall,\n             f1-score for each class, as well as overall accuracy, macro average, and weighted average.\n\n    Raises:\n        ValueError: If the specified target_column is not found in the CSV file.\n\n    Requirements:\n        - pandas\n        - sklearn\n\n    Example:\n    >>> report = task_func('/path/to/data.csv')\n    >>> print(report)\n    class 0        0.88       0.90       0.89          50\n    class 1        0.89       0.87       0.88          48\n    ...\n    accuracy                           0.89         100\n    macro avg       0.88       0.89       0.88         100\n    weighted avg    0.89       0.89       0.89         100\n\n    Note:\n        The CSV file must have a column with the name specified by 'target_column', and it should be in a\n        format readable by pandas.read_csv().\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Processes a CSV file to train a Random Forest classifier and generates a formatted classification report.\nNote that: The CSV file must have a column with the name specified by 'target_column', and it should be in a format readable by pandas.read_csv().\nThe function should raise the exception for: ValueError: If the specified target_column is not found in the CSV file.\nThe function should output with:\n    str: A formatted classification report. The report includes metrics such as precision, recall,\n    f1-score for each class, as well as overall accuracy, macro average, and weighted average.\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 classification_report\ndef task_func(csv_file_path, target_column=\"target\", test_size=0.2, n_estimators=100):\n```","libs":"['pandas', 'sklearn']"}

Source: https://bigcode-bench.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=cc3787d3-82cb-5a3b-8dcd-6ab8392f29e0&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
