Useless Folder

Overview

The useless folder contains four miscellaneous Python scripts, primarily for fetching stock data and performing linear regression.

File: linear-code.py

Description: This script implements linear regression on synthetic data, visualizing the regression line and reporting metrics like MSE and R² score.

Dependencies: numpy, matplotlib, scikit-learn

Code Snippet:

                
                import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression

np.random.seed(42)
X = 2 * np.random.rand(100, 1)
y = 4 + 3 * X + np.random.randn(100, 1)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model = LinearRegression()
model.fit(X_train, y_train)
            

Other Files