<jupyter_start><jupyter_text>Implementing Linear Regression<jupyter_code>from sklearn.linear_model import LinearRegression
linr = LinearRegression()<jupyter_output><empty_output><jupyter_text>Fitting the model<jupyter_code>linr.fit(X_train_scaled, y_train)<jupyter_output><empty_output><jupyter_text>Evaluating model<jupyter_code>print(linr.predict(X_train_scaled)[:15])
print(y_train[:15])
linr.score(X_train_scaled, y_train)
linr.score(X_test_scaled, y_test)<jupyter_output><empty_output><jupyter_text>Using Random Forest<jupyter_code>from sklearn.ensemble import RandomForestRegressor
rf = RandomForestRegressor(n_estimators=50)
rf.fit(X_train, y_train)
rf.score(X_train, y_train)
rf.score(X_test, y_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10840108401084012, 'fraction_numerical': 0.008130081300813009, 'mean_word_length': 17.024390243902438, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '493237', 'license': 'MIT', 'n_tokens_mistral': 305, 'n_tokens_neox': 293, 'n_words': 30, 'path': 'super_learn.ipynb', 'repo_name': 'Byte7/ML-intro-Scikit', 'size': '738'}