category: preprocessing

prompt: Fit a StandardScaler on X_clf and return its per-feature mean_, rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: preprocessing

prompt: Fit a StandardScaler on X_clf, transform it, and return a 2-element array [mean of the transformed matrix, std of the transformed matrix], each rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: preprocessing

prompt: Fit a MinMaxScaler on X_clf, transform it, and return a 2-element array [min of the result, max of the result], rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: preprocessing

prompt: Fit PCA(n_components=3, random_state=20260806) on X_clf and return its explained_variance_ratio_, rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: preprocessing

prompt: Apply SelectKBest(f_classif, k=4) to (X_clf, y_clf) and return the 0-based indices of the selected features as a sorted int array.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: preprocessing

prompt: Split (X_clf, y_clf) with train_test_split(test_size=0.25, random_state=20260806, stratify=y_clf) and return a 4-element int array [n_train_rows, n_test_rows, positives in train, positives in test].

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Split (X_clf, y_clf) with train_test_split(test_size=0.25, random_state=20260806, stratify=y_clf). Fit LogisticRegression(max_iter=1000, random_state=20260806) on the train split and return a 1-element array with the test accuracy rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Same split as above. Fit RandomForestClassifier(n_estimators=50, random_state=20260806, n_jobs=1) and return a 1-element array with the test accuracy rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Same split as above. Fit DecisionTreeClassifier(max_depth=4, random_state=20260806) and return its feature_importances_ rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Same split as above. Fit a Pipeline of StandardScaler then SVC(kernel='rbf', random_state=20260806) and return a 1-element array with the test accuracy rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Same split as above. Fit GradientBoostingClassifier(n_estimators=40, random_state=20260806) and return a 1-element array with the test accuracy rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: classification

prompt: Same split as above. Fit LogisticRegression(max_iter=1000, random_state=20260806) and return the first 10 predicted TEST labels as an int array, in test-set order.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: metrics

prompt: Split (X_imb, y_imb) with train_test_split(test_size=0.25, random_state=20260806, stratify=y_imb). Fit LogisticRegression(max_iter=1000, random_state=20260806) and return a 4-element array [accuracy, precision, recall, f1] on the test split, each rounded to 6 decimals. Use zero_division=0 for precision.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: metrics

prompt: Same imbalanced split. Fit LogisticRegression(max_iter=1000, random_state=20260806) and return a 1-element array with the test ROC AUC computed from predict_proba, rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: metrics

prompt: Same imbalanced split. Return a 4-element int array with the confusion-matrix counts [tn, fp, fn, tp] for LogisticRegression(max_iter=1000, random_state=20260806) on the test split.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: metrics

prompt: Return a 2-element array [number of class-0 samples, number of class-1 samples] in y_imb, as int64.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: regression

prompt: Split (X_reg, y_reg) with train_test_split(test_size=0.25, random_state=20260806). Fit LinearRegression and return a 3-element array [R2, MAE, RMSE] on the test split, each rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: regression

prompt: Same regression split. Fit LinearRegression and return its coef_ rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: regression

prompt: Same regression split. Fit Ridge(alpha=10.0, random_state=20260806) and return a 1-element array with the test R2 rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: regression

prompt: Same regression split. Fit a Pipeline of StandardScaler then Ridge(alpha=1.0, random_state=20260806) and return the first 5 test predictions rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: validation

prompt: Run cross_val_score on the FULL (X_clf, y_clf) with LogisticRegression(max_iter=1000, random_state=20260806), cv=KFold(n_splits=5, shuffle=True, random_state=20260806), scoring 'accuracy', and return the 5 fold scores rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: validation

prompt: Same cross-validation setup, but score a Pipeline of StandardScaler then LogisticRegression(max_iter=1000, random_state=20260806) — so the scaler is fitted INSIDE each fold. Return the 5 fold scores rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: validation

prompt: Same cross-validation setup with RandomForestClassifier(n_estimators=40, random_state=20260806, n_jobs=1). Return a 2-element array [mean score, std of scores], rounded to 6 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: validation

prompt: Fit KMeans(n_clusters=3, n_init=10, random_state=20260806) on X_clf and return a 1-element array with its inertia_ rounded to 4 decimals.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)


category: validation

prompt: Fit KMeans(n_clusters=3, n_init=10, random_state=20260806) on X_clf and return the size of each cluster as an int array, ordered by cluster label.

datasets:
Three datasets are preloaded, each generated with a fixed seed:

    X_clf, y_clf : make_classification(n_samples=300, n_features=8, n_informative=5,
                                       n_redundant=1, n_classes=2, random_state=20260806)
    X_imb, y_imb : make_classification(n_samples=400, n_features=6, n_informative=4,
                                       n_redundant=0, n_classes=2, weights=[0.9, 0.1],
                                       random_state=20260806)
    X_reg, y_reg : make_regression(n_samples=200, n_features=5, n_informative=3,
                                   noise=8.0, random_state=20260806)