Buckets:
bandaoo/StudyChat-bucket / assignment_text /studychat_f24_assignments /a4 /slime_sample_notebook.ipynb
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Imports section" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Part 1. Loading the dataset" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Using pandas load the dataset (load remotely, not locally)\n", | |
| "# Output the first 15 rows of the data\n", | |
| "# Display a summary of the table information (number of datapoints, etc.)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Part 2. Splitting the dataset" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Take the pandas dataset and split it into our features (X) and label (y)\n", | |
| "\n", | |
| "# Use sklearn to split the features and labels into a training/test set. (90% train, 10% test)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Part 3. Perform a Linear Regression" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 7, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Use sklearn to train a model on the training set\n", | |
| "\n", | |
| "# Create a sample datapoint and predict the output of that sample with the trained model\n", | |
| "\n", | |
| "# Report on the score for that model, in your own words (markdown, not code) explain what the score means\n", | |
| "\n", | |
| "# Extract the coefficents and intercept from the model and write an equation for your h(x) using LaTeX" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Sample equation: $E = mc^2$" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Part 4. Use Cross Validation" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 4, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Use the cross_val_score function to repeat your experiment across many shuffles of the data\n", | |
| "\n", | |
| "# Report on their finding and their significance" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Part 5. Using Polynomial Regression" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Using the PolynomialFeatures library perform another regression on an augmented dataset of degree 2\n", | |
| "\n", | |
| "# Report on the metrics and output the resultant equation as you did in Part 3." | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.7.4" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 4 | |
| } | |
Xet Storage Details
- Size:
- 3.04 kB
- Xet hash:
- 8397c1e9b5d53fc2eaa569fc2daefeaa58f96052540549f15551241186f7b075
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.