Buckets:
bandaoo/StudyChat-bucket / assignment_text /studychat_s25_assignments /a4 /sklearn_sample_notebook.ipynb
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "# Part 1. Equation of a Slime" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "How many late days are you using for this assignment?" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Imports section" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## 1. Loading the dataset" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Using pandas load the dataset\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": [ | |
| "## 2. Splitting the dataset" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "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)\n", | |
| "# For grading consistency use random_state=42 " | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## 3. Perform a Linear Regression" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "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 the score for that model using the default score function property of the SKLearn model, in your own words (markdown, not code) explain what the score means\n", | |
| "\n", | |
| "# Extract the coefficients and intercept from the model and write an equation for your h(x) using LaTeX" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Write the linear equation of a slime: (example equation: $E = mc^2$)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Report on score and explain meaning:" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## 4. Use Cross Validation" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Use the cross_val_score function to repeat your experiment across many shuffles of the data\n", | |
| "# For grading consistency use n_splits=5 and random_state=42\n", | |
| "\n", | |
| "# Report on their finding and their significance" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Write findings here:" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## 5. Using Polynomial Regression" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Using the PolynomialFeatures library perform another regression on an augmented dataset of degree 2\n", | |
| "# Perform k-fold cross validation (as above)\n", | |
| "\n", | |
| "# Report on the metrics and output the resultant equation as you did in Part 3." | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Write the polynomial equation of a slime: (example equation: $E = mc^2$)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Report on the score and interpret:" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "# Part 2. Chronic Kidney Disease Prediction via Classification" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "Create code and markdown cells as needed to perform classification and report on your results" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Load the dataset. Then train and evaluate the classification models." | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Results and Conclusion for Classification Experiments" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# Experiments with Neural Network." | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "## Results and Conclusion for Neural Network Experiments" | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3.10.1 64-bit ('3.10.1')", | |
| "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.10.1" | |
| }, | |
| "vscode": { | |
| "interpreter": { | |
| "hash": "15c08c500de846551a823f21c815b569e6d6d220d844c218035c389d317fd55b" | |
| } | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 4 | |
| } | |
Xet Storage Details
- Size:
- 5.12 kB
- Xet hash:
- 4ba64928ad319fedba23d3831f914e82f00035db9bb3beab3e41fe4ab3abeaff
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.