<jupyter_start><jupyter_text>Data Processing  Importing the libraries<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd<jupyter_output><empty_output><jupyter_text>Importing the dataset<jupyter_code>dataset = pd.read_table("data/airfoil_self_noise.dat", 
                        header=None, 
                        names=['frequency', 'angle_of_attack', 'chord_length', 'free_stream_velocity', 
                               'suction_side_displacement_thickness', 'scaled_sound_pressure_level'])
X = dataset.iloc[:,:-1].values
y = dataset.iloc[:,-1].values
X
y<jupyter_output><empty_output><jupyter_text>Feature Scaling<jupyter_code>from sklearn.preprocessing import StandardScaler

sc = StandardScaler()
X = sc.fit_transform(X)<jupyter_output><empty_output><jupyter_text>Splitting the dataset into the Training set and Test set<jupyter_code>from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0)<jupyter_output><empty_output><jupyter_text>Training<jupyter_code>from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression

poly_transform=PolynomialFeatures(degree=4)
X_poly = poly_transform.fit_transform(X_train)

regressor = LinearRegression()
regressor.fit(X_poly, y_train)<jupyter_output><empty_output><jupyter_text>Predicting the Test set results<jupyter_code>y_pred = regressor.predict(poly_transform.transform(X_test))
np.set_printoptions(precision=2)
print(np.concatenate((y_pred.reshape(len(y_pred),1), y_test.reshape(len(y_test),1)),1))<jupyter_output>[[133.45 130.79]
 [120.36 119.54]
 [111.48 110.32]
 [119.59 117.4 ]
 [126.69 127.62]
 [124.99 121.66]
 [119.81 118.69]
 [129.41 130.03]
 [113.44 114.73]
 [126.36 124.21]
 [125.87 125.84]
 [131.16 131.52]
 [130.58 130.7 ]
 [118.84 117.81]
 [124.73 126.66]
 [112.6  113.14]
 [129.43 126.76]
 [133.16 133.38]
 [119.64 118.08]
 [125.34 116.15]
 [123.07 123.46]
 [130.67 130.09]
 [129.84 129.93]
 [124.69 120.66]
 [133.06 134.06]
 [123.51 122.09]
 [115.83 117.09]
 [135.99 138.76]
 [128.54 130.83]
 [128.08 128.24]
 [129.72 128.95]
 [120.43 122.53]
 [111.44 103.38]
 [125.05 126.41]
 [130.95 131.8 ]
 [127.02 130.96]
 [116.56 119.25]
 [114.23 109.64]
 [129.1  127.78]
 [126.48 129.01]
 [130.92 132.54]
 [127.3  125.48]
 [122.95 138.27]
 [122.45 123.13]
 [108.1  111.03]
 [134.96 135.96]
 [126.61 127.12]
 [127.64 129.67]
 [126.51 125.65]
 [123.   129.24]
 [122.5  123.21]
 [124.   127.  ]
 [117.01 119.91]
 [127.26 126.56]
 [122.18 121.53]
 [123.4  122.23]
 [119.77 113.3 ]
 [127.26 128.34]
 [122.9  121.7[...]<jupyter_text>Measuring performance<jupyter_code>from sklearn.metrics import r2_score 
from sklearn.metrics import mean_squared_error
from sklearn.metrics import median_absolute_error
r2_score(y_test, y_pred)
mean_squared_error(y_test, y_pred)
median_absolute_error(y_test, y_pred)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14513394370973212, 'fraction_numerical': 0.19837232960325535, 'mean_word_length': 4.462962962962963, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '371105', 'license': 'MIT', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1203, 'n_words': 219, 'path': '03. polinomial-regression-full-data.ipynb', 'repo_name': 'matheussoaress/Airfoil-Self-Noise-Data-Set', 'size': '2949'}