<jupyter_start><jupyter_text>Linear_model<jupyter_code>from sklearn.linear_model import LinearRegression
regressor=LinearRegression()
#fit
regressor.fit(X_train,y_train)
y_pred=regressor.predict(X_test)<jupyter_output><empty_output><jupyter_text>Visualing Training Set<jupyter_code>plt.scatter(X_train,y_train,color='deeppink')
plt.plot(X_train,regressor.predict(X_train),color='skyblue')
plt.title('Salary VS Experience (training set)')
plt.xlabel('Year of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output><jupyter_text>Visualing Testing Set<jupyter_code>plt.scatter(X_test,y_test,color='deeppink')
#Regressor是針對training set做擬合
plt.plot(X_train,regressor.predict(X_train),color='skyblue')
plt.title('Salary VS Experience (testing set)')
plt.xlabel('Year of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13768961493582263, 'fraction_numerical': 0.0, 'mean_word_length': 15.18867924528302, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '451587', 'license': 'MIT', 'n_tokens_mistral': 351, 'n_tokens_neox': 325, 'n_words': 36, 'path': '08_Model_Development/Models/Regression/Simple Regression.ipynb', 'repo_name': 'erik1110/Data-Science', 'size': '857'}