<jupyter_start><jupyter_text>Polynomial Regression  Degree 2<jupyter_code>df = pd.read_csv('ps.csv')
X=df.iloc[:,1:2]
Y=df.iloc[:,2:]
PF=PolynomialFeatures(degree=2)
X=PF.fit_transform(X)
X_train, X_test, Y_train, Y_test = train_test_split(X,Y,test_size=0.3,random_state=42)
PR2=LinearRegression()
PR2.fit(X_train,Y_train)
Y_pred=PR2.predict(X_test)
score=r2_score(Y_test,Y_pred)
score<jupyter_output><empty_output><jupyter_text>Degree 5<jupyter_code>df = pd.read_csv('ps.csv')
X1=df.iloc[:,1:2]
Y1=df.iloc[:,2:]
PF=PolynomialFeatures(degree=5)
X=PF.fit_transform(X)
X_train, X_test, Y_train, Y_test = train_test_split(X,Y,test_size=0.3,random_state=42)
PR5=LinearRegression()
PR5.fit(X_train,Y_train)
Y_pred=PR5.predict(X_test)
score=r2_score(Y_test,Y_pred)
score
X=df.iloc[:,1:2]
plt.scatter(X1,Y1,c='red')
plt.plot(X1,PR5.predict(PF.fit_transform(X)), c='olive')
plt.xlabel('Designation')
plt.ylabel('Salary')
plt.show()
level=float(input())
PR5.predict(PF.fit_transform([[level]]))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18423645320197043, 'fraction_numerical': 0.034482758620689655, 'mean_word_length': 12.546666666666667, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '178727', 'license': 'MIT', 'n_tokens_mistral': 493, 'n_tokens_neox': 485, 'n_words': 44, 'path': 'Polynomial Regression/Polynomial Regression.ipynb', 'repo_name': 'Satyam-bajpai007/Machine_Learning', 'size': '1015'}