انا اول ما عملت كده يا أ.مصطفي فا حسابات الMSE فا كان ده النتجيه 87.53644204505163
مع العلم قبل ما اعمل كده فا كانت النتجيه 0.12410403813221675
فا اي السبيب ؟
وده الكود قبل
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
data = pd.read_csv("heart_disease.csv")
feutures = data.drop(['target'] , axis=1 , inplace=False)
outpnt = data['target']
x_traing , x_test , y_traing , y_test = train_test_split(feutures , outpnt , test_size=0.25, random_state=44 , shuffle=True)
linearregression = LinearRegression(fit_intercept=True , copy_X=True , n_jobs=-1)
fit = linearregression.fit(x_traing , y_traing)
y_prodict = fit.predict(x_test)
msevalue = mean_squared_error(y_test , y_prodict , multioutput="uniform_average")
print(f"MSEvalue: {msevalue}")
وده الكود بعد
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
data = pd.read_csv("heart_disease.csv")
feutures = data.drop(['target'] , axis=1 , inplace=False)
outpnt = data['target']
x_traing , x_test , y_traing , y_test = train_test_split(feutures , outpnt , test_size=0.25, random_state=44 , shuffle=True)
scaler = StandardScaler()
x_scaler_traing = scaler.fit_transform(x_traing)
linearregression = LinearRegression(fit_intercept=True , copy_X=True , n_jobs=-1)
fit = linearregression.fit(x_scaler_traing , y_traing)
y_prodict = fit.predict(x_test)
msevalue = mean_squared_error(y_test , y_prodict , multioutput="uniform_average")
print(f"MSEvalue: {msevalue}")