diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-10-output-2.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-10-output-2.png index d768d848..2c87cfcc 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-10-output-2.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-10-output-2.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-12-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-12-output-1.png index e351a778..2d1655c2 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-12-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-12-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-13-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-13-output-1.png index d6e0808a..d75aaf3b 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-13-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-13-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-17-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-17-output-1.png new file mode 100644 index 00000000..ca7e64f1 Binary files /dev/null and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-17-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-18-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-18-output-1.png index a5513d21..f258bbd4 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-18-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-18-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-19-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-19-output-1.png index c9b146de..e36a6dde 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-19-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-19-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-20-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-20-output-1.png index ae3ccf06..7530590c 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-20-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-20-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-4-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-4-output-1.png new file mode 100644 index 00000000..224a8b08 Binary files /dev/null and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-4-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-5-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-5-output-1.png index 8495665a..3bc172d7 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-5-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-5-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-6-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-6-output-1.png new file mode 100644 index 00000000..5542b461 Binary files /dev/null and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-6-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-7-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-7-output-1.png index 3e274fc7..a5b366fc 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-7-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-7-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-8-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-8-output-1.png new file mode 100644 index 00000000..ea9a22ea Binary files /dev/null and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-8-output-1.png differ diff --git a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-9-output-1.png b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-9-output-1.png index 5615c4f7..c60bfd6f 100644 Binary files a/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-9-output-1.png and b/docs/constant_model_loss_transformations/loss_transformations_files/figure-html/cell-9-output-1.png differ diff --git a/docs/cv_regularization/cv_reg.html b/docs/cv_regularization/cv_reg.html index df297ee5..0f40966e 100644 --- a/docs/cv_regularization/cv_reg.html +++ b/docs/cv_regularization/cv_reg.html @@ -726,7 +726,7 @@

ridge_model.coef_
-
array([ 5.89130559e-02, -6.42445915e-03,  4.44468157e-05, -8.83981945e-08])
+
array([ 5.89130560e-02, -6.42445916e-03,  4.44468157e-05, -8.83981945e-08])
diff --git a/docs/eda/eda.html b/docs/eda/eda.html index 6221f5d1..56c64c59 100644 --- a/docs/eda/eda.html +++ b/docs/eda/eda.html @@ -692,7 +692,7 @@

force=False) covid_file # a file path wrapper object
-
Using cached version that was downloaded (UTC): Fri Aug 18 22:19:42 2023
+
Using cached version that was downloaded (UTC): Fri Aug 25 09:57:25 2023
PosixPath('data/confirmed-cases.json')
@@ -724,7 +724,7 @@
!ls -lh {covid_file}
 !wc -l {covid_file}
-
-rw-r--r--  1 Ishani  staff   114K Aug 18 22:19 data/confirmed-cases.json
+
-rw-r--r--  1 lillianweng  staff   114K Aug 25 09:57 data/confirmed-cases.json
    1109 data/confirmed-cases.json
@@ -4137,14 +4137,8 @@

sns.displot(co2['Days']);
 plt.title("Distribution of days feature"); # suppresses unneeded plotting output

-
-
/Users/Ishani/micromamba/lib/python3.9/site-packages/seaborn/axisgrid.py:118: UserWarning:
-
-The figure layout has changed to tight
-
-
-

+

In terms of data quality, a handful of months have averages based on measurements taken on fewer than half the days. In addition, there are nearly 200 missing values–that’s about 27% of the data!

@@ -4154,8 +4148,8 @@

Code -
sns.scatterplot(x="Yr", y="Days", data=co2);
-plt.title("Day field by Year"); # the ; suppresses output
+
sns.scatterplot(x="Yr", y="Days", data=co2);
+plt.title("Day field by Year"); # the ; suppresses output

@@ -4179,23 +4173,17 @@

Code -
# Histograms of average CO2 measurements
-sns.displot(co2['Avg']);
+
# Histograms of average CO2 measurements
+sns.displot(co2['Avg']);
-
-
/Users/Ishani/micromamba/lib/python3.9/site-packages/seaborn/axisgrid.py:118: UserWarning:
-
-The figure layout has changed to tight
-
-
-

+

The non-missing values are in the 300-400 range (a regular range of CO2 levels).

We also see that there are only a few missing Avg values (<1% of values). Let’s examine all of them:

-
co2[co2["Avg"] < 0]
+
co2[co2["Avg"] < 0]
@@ -4304,8 +4292,8 @@

Code -
sns.lineplot(x='DecDate', y='Avg', data=co2)
-plt.title("CO2 Average By Month");
+
sns.lineplot(x='DecDate', y='Avg', data=co2)
+plt.title("CO2 Average By Month");

@@ -4317,9 +4305,9 @@

-
# 1. Drop missing values
-co2_drop = co2[co2['Avg'] > 0]
-co2_drop.head()
+
# 1. Drop missing values
+co2_drop = co2[co2['Avg'] > 0]
+co2_drop.head()
@@ -4395,9 +4383,9 @@

-
# 2. Replace NaN with -99.99
-co2_NA = co2.replace(-99.99, np.NaN)
-co2_NA.head()
+
# 2. Replace NaN with -99.99
+co2_NA = co2.replace(-99.99, np.NaN)
+co2_NA.head()
@@ -4481,10 +4469,10 @@

-
# 3. Use interpolated column which estimates missing Avg values
-co2_impute = co2.copy()
-co2_impute['Avg'] = co2['Int']
-co2_impute.head()
+
# 3. Use interpolated column which estimates missing Avg values
+co2_impute = co2.copy()
+co2_impute['Avg'] = co2['Int']
+co2_impute.head()
@@ -4564,30 +4552,30 @@

Code -
# results of plotting data in 1958
-
-def line_and_points(data, ax, title):
-    # assumes single year, hence Mo
-    ax.plot('Mo', 'Avg', data=data)
-    ax.scatter('Mo', 'Avg', data=data)
-    ax.set_xlim(2, 13)
-    ax.set_title(title)
-    ax.set_xticks(np.arange(3, 13))
-
-def data_year(data, year):
-    return data[data["Yr"] == 1958]
-    
-# uses matplotlib subplots
-# you may see more next week; focus on output for now
-fig, axes = plt.subplots(ncols = 3, figsize=(12, 4), sharey=True)
-
-year = 1958
-line_and_points(data_year(co2_drop, year), axes[0], title="1. Drop Missing")
-line_and_points(data_year(co2_NA, year), axes[1], title="2. Missing Set to NaN")
-line_and_points(data_year(co2_impute, year), axes[2], title="3. Missing Interpolated")
-
-fig.suptitle(f"Monthly Averages for {year}")
-plt.tight_layout()
+
# results of plotting data in 1958
+
+def line_and_points(data, ax, title):
+    # assumes single year, hence Mo
+    ax.plot('Mo', 'Avg', data=data)
+    ax.scatter('Mo', 'Avg', data=data)
+    ax.set_xlim(2, 13)
+    ax.set_title(title)
+    ax.set_xticks(np.arange(3, 13))
+
+def data_year(data, year):
+    return data[data["Yr"] == 1958]
+    
+# uses matplotlib subplots
+# you may see more next week; focus on output for now
+fig, axes = plt.subplots(ncols = 3, figsize=(12, 4), sharey=True)
+
+year = 1958
+line_and_points(data_year(co2_drop, year), axes[0], title="1. Drop Missing")
+line_and_points(data_year(co2_NA, year), axes[1], title="2. Missing Set to NaN")
+line_and_points(data_year(co2_impute, year), axes[2], title="3. Missing Interpolated")
+
+fig.suptitle(f"Monthly Averages for {year}")
+plt.tight_layout()

@@ -4604,8 +4592,8 @@

Code -
sns.lineplot(x='DecDate', y='Avg', data=co2_impute)
-plt.title("CO2 Average By Month, Imputed");
+
sns.lineplot(x='DecDate', y='Avg', data=co2_impute)
+plt.title("CO2 Average By Month, Imputed");

@@ -4632,9 +4620,9 @@

Code -
co2_year = co2_impute.groupby('Yr').mean()
-sns.lineplot(x='Yr', y='Avg', data=co2_year)
-plt.title("CO2 Average By Year");
+
co2_year = co2_impute.groupby('Yr').mean()
+sns.lineplot(x='Yr', y='Avg', data=co2_year)
+plt.title("CO2 Average By Year");

@@ -4975,1218 +4963,1218 @@

<

diff --git a/docs/eda/eda_files/figure-html/cell-62-output-1.png b/docs/eda/eda_files/figure-html/cell-62-output-1.png index a04218cf..f392d5f9 100644 Binary files a/docs/eda/eda_files/figure-html/cell-62-output-1.png and b/docs/eda/eda_files/figure-html/cell-62-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-67-output-1.png b/docs/eda/eda_files/figure-html/cell-67-output-1.png new file mode 100644 index 00000000..be96b8c9 Binary files /dev/null and b/docs/eda/eda_files/figure-html/cell-67-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-67-output-2.png b/docs/eda/eda_files/figure-html/cell-67-output-2.png deleted file mode 100644 index 31857f62..00000000 Binary files a/docs/eda/eda_files/figure-html/cell-67-output-2.png and /dev/null differ diff --git a/docs/eda/eda_files/figure-html/cell-68-output-1.png b/docs/eda/eda_files/figure-html/cell-68-output-1.png index 67c3959d..ffd29ff8 100644 Binary files a/docs/eda/eda_files/figure-html/cell-68-output-1.png and b/docs/eda/eda_files/figure-html/cell-68-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-69-output-1.png b/docs/eda/eda_files/figure-html/cell-69-output-1.png new file mode 100644 index 00000000..29088928 Binary files /dev/null and b/docs/eda/eda_files/figure-html/cell-69-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-69-output-2.png b/docs/eda/eda_files/figure-html/cell-69-output-2.png deleted file mode 100644 index fb28f5d5..00000000 Binary files a/docs/eda/eda_files/figure-html/cell-69-output-2.png and /dev/null differ diff --git a/docs/eda/eda_files/figure-html/cell-71-output-1.png b/docs/eda/eda_files/figure-html/cell-71-output-1.png index 39cac822..49ef3d6a 100644 Binary files a/docs/eda/eda_files/figure-html/cell-71-output-1.png and b/docs/eda/eda_files/figure-html/cell-71-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-75-output-1.png b/docs/eda/eda_files/figure-html/cell-75-output-1.png index 6382e58a..15a5fe82 100644 Binary files a/docs/eda/eda_files/figure-html/cell-75-output-1.png and b/docs/eda/eda_files/figure-html/cell-75-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-76-output-1.png b/docs/eda/eda_files/figure-html/cell-76-output-1.png index db2b0dee..40b1fc71 100644 Binary files a/docs/eda/eda_files/figure-html/cell-76-output-1.png and b/docs/eda/eda_files/figure-html/cell-76-output-1.png differ diff --git a/docs/eda/eda_files/figure-html/cell-77-output-1.png b/docs/eda/eda_files/figure-html/cell-77-output-1.png index 897b8b39..99b6c2d1 100644 Binary files a/docs/eda/eda_files/figure-html/cell-77-output-1.png and b/docs/eda/eda_files/figure-html/cell-77-output-1.png differ diff --git a/docs/feature_engineering/feature_engineering.html b/docs/feature_engineering/feature_engineering.html index ea770e7f..22d26788 100644 --- a/docs/feature_engineering/feature_engineering.html +++ b/docs/feature_engineering/feature_engineering.html @@ -556,7 +556,7 @@

my_model.fit(X, Y)

-
LinearRegression()
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
+
LinearRegression()
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.

Notice that we use double brackets to extract this column. Why double brackets instead of just single brackets? The .fit method, by default, expects to receive 2-dimensional data – some kind of data that includes both rows and columns. Writing penguins["flipper_length_mm"] would return a 1D Series, causing sklearn to error. We avoid this by writing penguins[["flipper_length_mm"]] to produce a 2D DataFrame.

@@ -607,7 +607,7 @@

print(f"The RMSE of the model is {np.sqrt(np.mean((Y-Y_hat_two_features)**2))}")

-
The RMSE of the model is 0.9881331104079044
+
The RMSE of the model is 0.9881331104079045

We can also see that we obtain the same predictions using sklearn as we did when applying the ordinary least squares formula before!

@@ -977,7 +977,7 @@

print(f"MSE of model with (hp^2) feature: {np.mean((Y-hp2_model_predictions)**2)}")

-
MSE of model with (hp^2) feature: 18.984768907617223
+
MSE of model with (hp^2) feature: 18.984768907617216

diff --git a/docs/feature_engineering/feature_engineering_files/figure-html/cell-16-output-2.png b/docs/feature_engineering/feature_engineering_files/figure-html/cell-16-output-2.png index 92cb01c9..f8396667 100644 Binary files a/docs/feature_engineering/feature_engineering_files/figure-html/cell-16-output-2.png and b/docs/feature_engineering/feature_engineering_files/figure-html/cell-16-output-2.png differ diff --git a/docs/feature_engineering/feature_engineering_files/figure-html/cell-17-output-2.png b/docs/feature_engineering/feature_engineering_files/figure-html/cell-17-output-2.png index f4ae4ea0..ceecd30f 100644 Binary files a/docs/feature_engineering/feature_engineering_files/figure-html/cell-17-output-2.png and b/docs/feature_engineering/feature_engineering_files/figure-html/cell-17-output-2.png differ diff --git a/docs/gradient_descent/gradient_descent.html b/docs/gradient_descent/gradient_descent.html index 467ee5fb..ed238d2c 100644 --- a/docs/gradient_descent/gradient_descent.html +++ b/docs/gradient_descent/gradient_descent.html @@ -106,7 +106,7 @@ require.undef("plotly"); requirejs.config({ paths: { - 'plotly': ['https://cdn.plot.ly/plotly-2.25.2.min'] + 'plotly': ['https://cdn.plot.ly/plotly-2.12.1.min'] } }); require(['plotly'], function(Plotly) { @@ -439,9 +439,9 @@

-