benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 067ee0f6-a062-554d-8eab-05da6aa215c3

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import numpy as np
from sklearn.preprocessing import MinMaxScaler

def task_func(rows=3, columns=2, seed=42):
    """
    Generate a matrix of random values with specified dimensions and scale it between 0 and 1.
    
    Parameters:
    rows (int): The number of rows for the matrix. Default is 3.
    columns (int): The number of columns for the matrix. Default is 2.
    
    Returns:
    ndarray: A numpy ndarray with scaled values between 0 and 1.
    
    Requirements:
    - numpy
    - sklearn.preprocessing.MinMaxScaler
    
    Example:
    >>> task_func(3, 2)
    array([[0.37939383, 1.        ],
           [1.        , 0.55700635],
           [0.        , 0.        ]])
    
    >>> task_func(2, 2)
    array([[0., 1.],
           [1., 0.]])
    """

instruct prompt

Generate a matrix of random values with specified dimensions and scale it between 0 and 1. >>> task_func(2, 2) array([[0., 1.], [1., 0.]])
The function should output with:
    ndarray: A numpy ndarray with scaled values between 0 and 1.
You should write self-contained code starting with:

Code

import numpy as np
from sklearn.preprocessing import MinMaxScaler
def task_func(rows=3, columns=2, seed=42):

code prompt

Code

import numpy as np
from sklearn.preprocessing import MinMaxScaler
def task_func(rows=3, columns=2, seed=42):

entry point

task_func

libs

  • numpy
  • sklearn

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import