<jupyter_start><jupyter_text>Data Exploration<jupyter_code>df.shape
df.isnull().sum()
plt.hist(df['R&D Spend'],bins=30);
plt.hist(df['Administration'],bins=30);
plt.hist(df['Marketing Spend'],bins=30);<jupyter_output><empty_output><jupyter_text>Data Cleansing<jupyter_code>state=pd.get_dummies(df['State'],drop_first=True)
state.head()
df.head()
df.drop('State',axis=1,inplace=True)
df=pd.concat([df,state],axis=1)
df.head()<jupyter_output><empty_output><jupyter_text>Model Creation<jupyter_code>df.shape
X=df.drop('Profit',axis=1)
X.head()
y=df['Profit']
y.head()
from sklearn.linear_model import LinearRegression
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=150)
lr=LinearRegression()
lr.fit(X_train,y_train)
y_pred=lr.predict(X_test)
from sklearn.metrics import r2_score
score=r2_score(y_test,y_pred)
score<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16324324324324324, 'fraction_numerical': 0.017297297297297298, 'mean_word_length': 14.694915254237289, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '59866', 'license': 'MIT', 'n_tokens_mistral': 401, 'n_tokens_neox': 386, 'n_words': 37, 'path': '50_Startups Data Analysis.ipynb', 'repo_name': 'pallabi-sahoo/Machine-learning-Projects', 'size': '925'}