image_output_3.png image_output_2.png image_output_1.png
from sklearn.preprocessing import MinMaxScaler, OneHotEncoder, StandardScaler

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import seaborn as sns

train_path = '/kaggle/input/playground-series-s3e8/train.csv'
test_path = '/kaggle/input/playground-series-s3e8/test.csv'
train_df = pd.DataFrame(pd.read_csv(train_path))
test_df = pd.DataFrame(pd.read_csv(test_path))
ids = test_df[['id']]
df_copy = train_df

import seaborn as sns
def plot(dataframe, col):
    pass
train_df = train_df.drop('id', axis=1)

test_df = test_df.drop('id', axis=1)
train_y = train_df['price']
train_df = train_df.drop(['price'], axis=1)

encoder = OneHotEncoder(handle_unknown='ignore')
OH_cols_train = pd.DataFrame(encoder.fit_transform(train_df[['cut', 'color', 'clarity']]).toarray())
OH_cols_valid = pd.DataFrame(encoder.transform(test_df[['cut', 'color', 'clarity']]).toarray())
test_df = test_df.join(OH_cols_valid)
train_df = train_df.join(OH_cols_train)
train_df = train_df.drop(['cut', 'color', 'clarity'], axis=1)
test_df = test_df.drop(['cut', 'color', 'clarity'], axis=1)
print(train_df)