{"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":"e940de93-38d3-5a6e-b368-ba9260c79805","task_key":"default--v0~2e1~2e0~5fhf--e940de93-38d3-5a6e-b368-ba9260c79805","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf e940de93-38d3-5a6e-b368-ba9260c79805","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(num_samples=500, noise_strength=1, random_seed=None, test_size=0.2):\\n\",\"complete_prompt\":\"import numpy as np\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\n\\n\\ndef task_func(num_samples=500, noise_strength=1, random_seed=None, test_size=0.2):\\n    \\\"\\\"\\\"\\n    Generate a dataset with a single feature and a target variable. The target\\n    is computed from the feature using a linear relation.\\n    In addition some gaussian noise (random samples from normal distributioin), scaled by\\n    noise_strength, is added to the target. The dataset is split into training\\n    and test sets. Then a linear regression model is adjusted to the training\\n    set and the R-squared score is calculated on the test set.\\n\\n    Parameters:\\n    - num_samples (int): The number of samples to generate for the dataset.\\n                   Defaults to 500\\n    - noise_strength (float): The strength (magnitude) of the noise that is\\n                              added to the dataset. Defaults to 1\\n    - random_seed (int): The seed used in generating the dataset, in performing\\n                   the train test split and in generating the random noise.\\n                   Defaults to None\\n    - test_size (float): The fraction of the test split. Defaults to 0.2\\n\\n    Returns:\\n    float: The R-squared score of the fitted model on the test set.\\n    LinearRegression: The trained linear regression model.\\n\\n    Raises:\\n    - ValueError: If test set size is smaller than 2.\\n\\n    Requirements:\\n    - numpy\\n    - pandas\\n    - sklearn.model_selection.train_test_split\\n    - sklearn.linear_model.LinearRegression\\n\\n    Example:\\n    >>> task_func(num_samples=10, noise_strength=23.5, random_seed=24, test_size=0.3)\\n    (-0.4892453918038726, LinearRegression())\\n    >>> task_func(noise_strength=0.1)\\n    (0.9658328575162494, LinearRegression())\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Generate a dataset with a single feature and a target variable. The target is computed from the feature using a linear relation. In addition some gaussian noise (random samples from normal distributioin), scaled by noise_strength, is added to the target. The dataset is split into training and test sets. Then a linear regression model is adjusted to the training set and the R-squared score is calculated on the test set.\\nThe function should raise the exception for: ValueError: If test set size is smaller than 2.\\nThe function should output with:\\n    float: The R-squared score of the fitted model on the test set.\\n    LinearRegression: The trained linear regression model.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nfrom sklearn.model_selection import train_test_split\\nfrom sklearn.linear_model import LinearRegression\\ndef task_func(num_samples=500, noise_strength=1, random_seed=None, test_size=0.2):\\n```\",\"libs\":\"['numpy', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}