<jupyter_start><jupyter_text>LassoReference: http://scikit-learn.org/stable/modules/linear_model.htmllasso<jupyter_code>from sklearn import linear_model

reg = linear_model.Lasso(alpha = 0.1)
reg.fit(X_train, y_train)
print(reg.predict(X_test))

pd.DataFrame(reg.predict(X_test)).reset_index(drop=True).plot()<jupyter_output>[ 2.38436186 -0.76427569  3.47591499 ...,  1.58217907  5.61635695
  3.52332026]<jupyter_text>Problem here is the predictions are not mapping to the output classes.<jupyter_code>np.sum(np.round(reg.predict(X_test)) == y_test) / len(y_test)<jupyter_output><empty_output><jupyter_text>Even with rounding the predictions, we do not get high accuracy.----In documentation they point us to `LassoLars`Reference: http://scikit-learn.org/stable/modules/linear_model.htmlleast-angle-regression<jupyter_code>reg = linear_model.LassoLars(alpha=.1)
reg.fit(X_train, y_train)
print(reg.predict(X_test))

pd.DataFrame(reg.predict(X_test)).reset_index(drop=True).plot()<jupyter_output>[ 4.44324405  4.44324405  4.44324405 ...,  4.44324405  4.44324405
  4.44324405]<jupyter_text>Same problem<jupyter_code>np.sum(np.round(reg.predict(X_test)) == y_test) / len(y_test)<jupyter_output><empty_output><jupyter_text>Worst accuracy----<jupyter_code>from sklearn.linear_model import Lasso
clf = Lasso(alpha=0.1)
clf.fit(X_train, y_train) 
print(clf.predict(X_test))

pd.DataFrame(clf.predict(X_test)).reset_index(drop=True).plot()<jupyter_output>[ 2.38436186 -0.76427569  3.47591499 ...,  1.58217907  5.61635695
  3.52332026]
{'fraction_non_alphanumeric': 0.14482306684141547, 'fraction_numerical': 0.10943643512450851, 'mean_word_length': 6.673366834170854, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '111833', 'license': 'MIT', 'n_tokens_mistral': 717, 'n_tokens_neox': 615, 'n_words': 78, 'path': 'digit_recognizer/day89-lasso.ipynb', 'repo_name': 'csiu/kaggle', 'size': '1526'}