This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| y_pred = regressor.predict(X_test) | |
| print(r2_score(Y_test,y_pred)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.linear_model import LinearRegression | |
| from sklearn.metrics import r2_score | |
| regressor = LinearRegression() | |
| regressor.fit(X_train,Y_train) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.model_selection import train_test_split | |
| X_train,X_test,Y_train,Y_test = train_test_split(X,Y, test_size=0.2, random_state = 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.preprocessing import LabelEncoder, OneHotEncoder | |
| labelencoder_X = LabelEncoder() | |
| X[:,3] = labelencoder_X.fit_transform(X[:,3]) | |
| onehotencoder = OneHotEncoder(categorical_features = [3]) | |
| X=onehotencoder.fit_transform(X).toarray() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dataset = pd.read_csv('Startups.csv') | |
| X = dataset.iloc[:,:-1].values | |
| Y = dataset.iloc[:,4].values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sentences = nltk.sent_tokenize(text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| text = re.sub(r'\[[0-9]*\]',' ',text) | |
| text = re.sub(r'\s+',' ',text) | |
| text = text.lower() | |
| text = re.sub(r'\d',' ',text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nltk | |
| import urllib | |
| import bs4 as bs | |
| import pandas as pd | |
| import re | |
| from nltk.corpus import stopwords | |
| nltk.download('stopwords') |