application_vnd.jupyter.stderr_output_1.png
from sklearn.compose import ColumnTransformer

from sklearn.linear_model import LinearRegression

from sklearn.preprocessing import OneHotEncoder

import numpy as np

import pandas as pd

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('../input/abalone-dataset/abalone.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values

from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
ct = ColumnTransformer(transformers=[('encoder', OneHotEncoder(drop='first'), [0])], remainder='passthrough', sparse_threshold=0)
X = np.array(ct.fit_transform(X))

from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train, y_train)

y_predict = regressor.predict(X_train)
np.set_printoptions(precision=2)
print(np.concatenate((y_predict.reshape(len(y_predict), 1), y_test.reshape(len(y_predict), 1)), 1))