<jupyter_start><jupyter_text>Step 4: Data cleaning<jupyter_code># Eliminating NaN or missing input numbers 
df_binary.fillna(method ='ffill', inplace = True)<jupyter_output><empty_output><jupyter_text>Step 5: Training our model<jupyter_code>X = np.array(df_binary['Sal']).reshape(-1, 1) 
y = np.array(df_binary['Temp']).reshape(-1, 1) 
df_binary.dropna(inplace = True) 
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25)
# Splitting the data into training and testing data 
regr = LinearRegression()
regr.fit(X_train, y_train) 
print(regr.score(X_test, y_test))<jupyter_output>0.20626183115950517<jupyter_text>Step 6: Exploring our results<jupyter_code>y_pred = regr.predict(X_test) 
plt.scatter(X_test, y_test, color ='b') 
plt.plot(X_test, y_pred, color ='k') 
  
plt.show()<jupyter_output><empty_output><jupyter_text>Step 7: Working with a smaller dataset<jupyter_code>df_binary500 = df_binary[:][:500] 
  
# Selecting the 1st 500 rows of the data 
sns.lmplot(x ="Sal", y ="Temp", data = df_binary500, 
                               order = 2, ci = None) 
df_binary500.fillna(method ='ffill', inplace = True) 
  
X = np.array(df_binary500['Sal']).reshape(-1, 1) 
y = np.array(df_binary500['Temp']).reshape(-1, 1) 
  
df_binary500.dropna(inplace = True) 
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25) 
  
regr = LinearRegression() 
regr.fit(X_train, y_train) 
print(regr.score(X_test, y_test)) 
y_pred = regr.predict(X_test) 
plt.scatter(X_test, y_test, color ='b') 
plt.plot(X_test, y_pred, color ='k') 
  
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14383561643835616, 'fraction_numerical': 0.038605230386052306, 'mean_word_length': 5.428, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '263731', 'license': 'MIT', 'n_tokens_mistral': 724, 'n_tokens_neox': 664, 'n_words': 123, 'path': 'Linear Regression Model in Python using bottle.csv.ipynb', 'repo_name': 'kyashraj139/Python', 'size': '1606'}