<jupyter_start><jupyter_text>LINEAR REGRESSION<jupyter_code>from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train, Y_train)
from sklearn import metrics
pred = regressor.predict(X_test)
print(pred)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred))
print(RMSE)<jupyter_output>6.276964899844313<jupyter_text>LASSO REGRESSION<jupyter_code>from sklearn.linear_model import Lasso
reg = Lasso(alpha=1.0)
reg.fit(X_train, Y_train)
pred_lasso= reg.predict(X_test)
print(pred_lasso)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_lasso))
print(RMSE)<jupyter_output>7.8093684285209735<jupyter_text>RIDGE REGRESSION<jupyter_code>from sklearn.linear_model import Ridge
clf = Ridge(alpha=1.0)
clf.fit(X_train, Y_train)
pred_ridge= clf.predict(X_test)
print(pred_ridge)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_ridge))
print(RMSE)<jupyter_output>6.279079648258132<jupyter_text>NEAREST NEIGHBOUR REGRESSOR<jupyter_code>from sklearn.neighbors import KNeighborsRegressor
neigh = KNeighborsRegressor(n_neighbors=5)
neigh.fit(X_train, Y_train)
pred_knn= neigh.predict(X_test)
print(pred_knn)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_knn))
print(RMSE)<jupyter_output>8.044732427345624<jupyter_text>SUPPORT VECTOR REGRESSOR<jupyter_code>from sklearn.svm import SVR
sregressor = SVR(kernel = 'rbf')
sregressor.fit(X_train, Y_train)
pred_svr= sregressor.predict(X_test)
print(pred_svr)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_svr))
print(RMSE)<jupyter_output>8.809050257909<jupyter_text>TREE REGRESSOR<jupyter_code>from sklearn.tree import DecisionTreeRegressor
tregressor = DecisionTreeRegressor(random_state=0)
tregressor.fit(X_train, Y_train)
pred_tree= tregressor.predict(X_test)
print(pred_tree)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_tree))
print(RMSE)<jupyter_output>6.63698493033676<jupyter_text>RANDOM FOREST REGRESSOR<jupyter_code>from sklearn.ensemble import RandomForestRegressor
rregressor = RandomForestRegressor(n_estimators = 100, random_state = 0)
rregressor.fit(X_train, Y_train)
pred_rftree= rregressor.predict(X_test)
print(pred_rftree)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_rftree))
print(RMSE)<jupyter_output>5.541554655704045<jupyter_text>GRADIENT BOOSTING REGRESSOR<jupyter_code>from sklearn.ensemble import GradientBoostingRegressor
REGGB = GradientBoostingRegressor(random_state=0)
REGGB.fit(X_train, Y_train)
pred_GB= REGGB.predict(X_test)
print(pred_GB)
RMSE = np.sqrt(metrics.mean_squared_error(Y_test, pred_GB))
print(RMSE)<jupyter_output>5.347902407831462
{'fraction_non_alphanumeric': 0.101076095311299, 'fraction_numerical': 0.05226748654880861, 'mean_word_length': 11.822660098522167, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '448938', 'license': 'Apache-2.0', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1074, 'n_words': 133, 'path': 'ML_ASSIGNMENT - REGRESSION-ALL.ipynb', 'repo_name': 'SAZZZO99/Football-Player-Price-Prediction-Premier-League-2017-dataset', 'size': '2602'}