This section will appear Under Learn tab page
Load Diamonds dataset
diamonds dataset: https://ggplot2.tidyverse.org/reference/diamonds.html
This section will appear Under Python tab page
# Import core libraries for numerical computing, data analysis, visualization, and suppress warnings
import numpy as np # Numerical Python, supports homogeneous data types
import pandas as pd ## Built on top of NumPy, supports heterogeneous data type
import matplotlib.pyplot as plt # Plots 2D graphs and plots. Used for data visualization, e.g. histogram, bar chart, error chart etc.
import seaborn as sns # Built on top of Matplotlib. Less code & can plot heatmap, pairplot, violinplot etc.
import warnings # Python’s built-in module to manage warnings.
warnings.filterwarnings(“ignore”) # Suppresses all warning messages for cleaner output.
# Import model libraries
from sklearn.model_selection import train_test_split # Used to split arrays or matrices into random train and test subsets
from sklearn.linear_model import LinearRegression # Imports the Linear Regression model
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error # Imports metrics for evaluating regression models
# from sklearn.datasets import fetch_openml # Used to fetch datasets from OpenML
# Load Diamonds dataset
# diamonds dataset: https://ggplot2.tidyverse.org/reference/diamonds.html
df = sns.load_dataset(“diamonds”)
The section below will appear Under Dataset tab page
# diamonds dataset: https://ggplot2.tidyverse.org/reference/diamonds.html
if possible populate 3 rows of the table utilizing the code below:
import seaborn as sns
df = sns.load_dataset(“diamonds”)
df.head()
OR Populate the dataset earlier and display first 5 rows for explanation.