ML Report Miniproject
ML Report Miniproject
Machine Learning
Year 2024-2025
Submitted By
Mayuri Avhad 1
Gauri Chaudhari 9
Hemangi Jadhav 21
Khyati Raghvani 48
1. Introduction
Analyzing Tesla's stock involves examining various factors that drive its price fluctuations,
including product innovations, earnings reports, market competition, and broader economic
trends. Tesla's stock is particularly volatile due to its leadership in the electric vehicle market,
with key influences such as new vehicle releases, advancements in battery technology, and
CEO Elon Musk's public statements. Additionally, the stock is affected by external factors like
global supply chain issues, government policies on clean energy, and competition from other
automakers. Investors use tools like technical analysis and market sentiment to predict future
stock movements, seeking to capitalize on the frequent "ups" and "downs" that characterize
Tesla's stock performance.
2. Objectives
• To evaluate the impact of Tesla's product launches and innovations on stock performance.
3. Key Points
• Volatility of Tesla Stock: Known for significant fluctuations due to market sentiment and
external factors.
• Earnings Reports: Quarterly earnings significantly affect investor confidence and stock
movement.
• Elon Musk’s Influence: CEO statements and actions can trigger immediate price reactions.
• Market Competition: Growing competition in the electric vehicle space impacts Tesla’s
market share and stock.
• Global Economic Factors: Supply chain issues, energy policies, and macroeconomic
conditions contribute to stock volatility.
4. Code:
1) import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import warnings
warnings.filterwarnings('ignore')
2) df = pd.read_csv('Tesla.csv')
df.head()
4) df.describe()
5) df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2416 entries, 0 to 2415
Data columns (total 7 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Date 2416 non-null object
1 Open 2416 non-null float64
2 High 2416 non-null float64
3 Low 2416 non-null float64
4 Close 2416 non-null float64
5 Adj Close 2416 non-null float64
6 Volume 2416 non-null int64
dtypes: float64(5), int64(1), object(1)
6) plt.figure(figsize=(15,5))
plt.plot(df['Close'])
plt.title('Tesla Close price.', fontsize=15)
plt.ylabel('Price in dollars.')
plt.show()
7) df[df['Close'] == df['Adj Close']].shape
(2416, 7)
Date 0
Open 0
High 0
Low 0
Close 0
Volume 0
dtype: int64
plt.subplots(figsize=(20,10))
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame(data)
scaler = StandardScaler()
features = scaler.fit_transform(features)
print(X_train.shape, X_valid.shape)
print(f'{model} : ')
print('Training Accuracy : ', metrics.roc_auc_score(
Y_train, model.predict_proba(X_train)[:, 1]))
print('Validation Accuracy : ', metrics.roc_auc_score(
Y_valid, model.predict_proba(X_valid)[:, 1]))
print()
else:
print("Error: Not enough classes in target variable.")
Conclusions