“SKLEARN StandardsCaler untuk kolom numerik” Kode Jawaban

Pandas Standardscaler

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
Xanthous Xenomorph

SKLEARN StandardsCaler untuk kolom numerik

# Author: Pedro Morales <[email protected]>
#
# License: BSD 3 clause

import numpy as np

from sklearn.compose import ColumnTransformer
from sklearn.datasets import fetch_openml
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split, GridSearchCV

np.random.seed(0)

# Load data from https://www.openml.org/d/40945
X, y = fetch_openml("titanic", version=1, as_frame=True, return_X_y=True)
Tired Tern

Jawaban yang mirip dengan “SKLEARN StandardsCaler untuk kolom numerik”

Pertanyaan yang mirip dengan “SKLEARN StandardsCaler untuk kolom numerik”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya