{{ message }}

Instantly share code, notes, and snippets.

💭
For the love of data.

💭
For the love of data.
Created Jan 18, 2021
View dataaspirant-bag-of-words-implementation.py
 ## dependencies import pandas as pd import nltk import numpy as np from nltk.corpus import stopwords from nltk.tokenize import sent_tokenize as st from nltk.stem import WordNetLemmatizer as wordnet import re
Created Jan 18, 2021
View dataaspirant-bag-of-words-requried-pacakges.py
 pip install nltk pip install pandas pip install numpy ## After installing the pacakges run the below code. nltk.download()
Created Jan 14, 2021
View dataaspirant-regularization-ridge-regression-prediction.py
 ## Ridge Regression Predictions final_model = Ridge(alpha=0.25) final_model.fit(X_train, y_train) print(final_model.score(X_test, y_test)) ## Output: 0.6973569341182368
Created Jan 14, 2021
View dataaspirant-regularization-ridge-regression.py
 ## Ridge regression ## two lists to hold alpha values and cross-validation scores alpha = [] ridge_scores = [] ## loop over different alpha values for i in range(1,10): ridge_model = Ridge(alpha=0.25*i)
Last active Jan 14, 2021
View dataaspirant-regularization-lasoo-regression.py
 # Lasso regression ## two lists to hold alpha values and cross-validation scores alpha = [] lasso_scores = [] ## we’ll be looping over different alpha values to find the one which gives us the best score. ## loop over different alpha values for i in range(1,10):
Created Jan 14, 2021
View dataaspirant-regularization-linear-regression-model.py
 ## Linear regression model linearModel = LinearRegression() linearModel.fit(X_train, y_train) ## Evaluating the model print(linearModel.score(X_test, y_test)) """
Created Jan 14, 2021