{"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":"da25a411-7a99-576d-b234-6eda5c6fe1a5","task_key":"default--v0~2e1~2e0~5fhf--da25a411-7a99-576d-b234-6eda5c6fe1a5","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf da25a411-7a99-576d-b234-6eda5c6fe1a5","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.ensemble import RandomForestClassifier\\nimport seaborn as sns\\nimport matplotlib.pyplot as plt\\nimport os\\ndef task_func(file_path='arena.csv', target_column='Index', seed=42):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.ensemble import RandomForestClassifier\\nimport seaborn as sns\\nimport matplotlib.pyplot as plt\\nimport os\\n\\ndef task_func(file_path='arena.csv', target_column='Index', seed=42):\\n    \\\"\\\"\\\"\\n    Trains a random forest model on data from a CSV file, using one column as the target variable (y) \\n    and the rest as features (X), and visualizes the feature importances in a bar plot. This function \\n    also handles missing values by dropping rows with any NaN values.\\n\\n    Parameters:\\n    - file_path (str): Path to the CSV file containing the dataset. Defaults to 'arena.csv'.\\n    - target_column (str): Name of the column to be used as the target variable (y). Defaults to 'Index'.\\n    - seed (int): Seed for the random state of the RandomForestClassifier to ensure reproducibility. Defaults to 42.\\n\\n    Returns:\\n    - matplotlib.axes.Axes: Axes object displaying the bar plot of feature importances.\\n    - numpy.ndarray: Array containing the feature importances derived from the random forest model.\\n\\n    Raises:\\n    - FileNotFoundError: Raised if the specified file_path does not lead to a valid file.\\n    - ValueError: Raised if the specified target_column is not found in the CSV file's columns, or if the input data contains NaN, infinity or a value too large for dtype('float32').\\n\\n    Requirements:\\n    - pandas: For loading and manipulating the CSV file.\\n    - sklearn.ensemble.RandomForestClassifier: For training the random forest model.\\n    - seaborn and matplotlib for plotting the feature importances.\\n    - os \\n\\n    Example:\\n    The CSV file format:\\n        Index,Score1,Score2,Score3\\n        1,10,20,30\\n        2,15,25,35\\n        3,20,30,40\\n    \\n    >>> file_path = 'arena.csv'\\n    >>> create_dummy_file(file_path)\\n    >>> ax, importances = task_func(file_path, 'Index') # This will train a random forest model predicting 'Index' from 'Score1', 'Score2', and 'Score3', then plot and return the importances of 'Score1', 'Score2', and 'Score3' as features (X).\\n    >>> os.remove(file_path)\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Trains a random forest model on data from a CSV file, using one column as the target variable (y) and the rest as features (X), and visualizes the feature importances in a bar plot. This function also handles missing values by dropping rows with any NaN values. >>> file_path = 'arena.csv' >>> create_dummy_file(file_path) >>> ax, importances = task_func(file_path, 'Index') # This will train a random forest model predicting 'Index' from 'Score1', 'Score2', and 'Score3', then plot and return the importances of 'Score1', 'Score2', and 'Score3' as features (X). >>> os.remove(file_path)\\nThe function should raise the exception for: FileNotFoundError: Raised if the specified file_path does not lead to a valid file. ValueError: Raised if the specified target_column is not found in the CSV file's columns, or if the input data contains NaN, infinity or a value too large for dtype('float32').\\nThe function should output with:\\n    matplotlib.axes.Axes: Axes object displaying the bar plot of feature importances.\\n    numpy.ndarray: Array containing the feature importances derived from the random forest model.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.ensemble import RandomForestClassifier\\nimport seaborn as sns\\nimport matplotlib.pyplot as plt\\nimport os\\ndef task_func(file_path='arena.csv', target_column='Index', seed=42):\\n```\",\"libs\":\"['pandas', 'matplotlib', 'seaborn', 'sklearn', 'os']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}