1. (Jupyter) Consider the function $f(x) = \frac{1}{2}x^2$. Write a simple Python program to optimize this objective function with gradient descent. Show that the function is a minimum at $x^* = 0$. 2. (Jupyter) Generate N data points \{$(y_i, x_i)$\} where $y = mx + b$ and add Gaussian noise. (a) Plot the data. (b) Fit a linear model and print the coefficients $m$ and $b$. (c) Plot the optimal model together with the data.
Added by Kayla C.
Close
Your feedback will help us improve your experience
Vincenzo Zaccaro and 50 other Intro Stats / AP Statistics educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
2. Create a function that, given a basis B and a vector [x]B, computes the vector x. Use functions from numpy, scipy, and/or sympy. Create a function comment header that summarizes your approach. In the same file, compute the the vector x given B and [x]B below and print the result. Save your code as problem2.py.
Vincenzo Z.
Show me the RStudio or Python code to solve the following problem:
Areen D.
Write a python program that reads the data.csv file and plots the y variable and perform the following tasks: a. How many samples exists in the dataset? Use the len() function. b. Find the mean of the dataset and display on the console. c. Find the minimum of the dataset and display on the console. d. Find the maximum of the dataset and display on the console. e. Find the variance of the dataset and display on the console. f. Find the median of the dataset and display on the console. g. Find the standard deviation of the dataset and display on the console.
Akash M.
Recommended Textbooks
Elementary Statistics a Step by Step Approach
The Practice of Statistics for AP
Introductory Statistics
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD