MY-ASSIGNMENTEXPERT™可以为您提供 courses.cs.washington.edu CSE446 Machine Learning机器学习的代写代考和辅导服务!
CSE446课程简介
Programming in Python
We will use Python for the programming portions of the assignments. Python is a powerful general-purpose programming language with excellent libraries for statistical computations and visualizations. During the first week of the quarter, we will provide a tutorial to jump-start your transition into working in Python.
Here are some Python related resources:
www.learnpython.org “Whether you are an experienced programmer or not, this website is intended for everyone who wishes to learn the Python programming language.”
Python tutorial
NumPy tutorial
NumPy for Matlab users
Prerequisites
We strongly encourage you to use Python 3 (versus Python 2) so that if code is provided on an assignment there are no compatibility issues. This also helps with debugging if everyone is on the same version.
Jupyter notebooks are a convenient way to write Python programs, especially for machine learning applications where you are actively exploring data. Therefore, you may complete your assignment using Jupyter notebooks but before you turn in your assignment, be sure to run all code blocks to make sure the current state reflects the code, if run. To be safe, dump the kernel to drop state and then rerun your code. If you use Jupyter notbooks, export your code into a *.py file before submitting it some editors call this “Export Notebook to Executable Script”.
CSE446 Machine Learning HELP(EXAM HELP, ONLINE TUTOR)
2 points (Bayes Rule, from Murphy exercise 2.4.) After your yearly checkup, the doctor has bad news and good news. The bad news is that you tested positive for a serious disease, and that the test is $99 \%$ accurate i.e., the probability of testing positive given that you have the disease is 0.99 , as is the probability of testing negative given that you dont have the disease. The good news is that this is a rare disease, striking only one in 10,000 people. What are the chances that you actually have the disease? Show your calculations as well as giving the final result.
Let $D$ be the event that you have the disease, and $T$ be the event that you tested positive for the disease. We want to find the probability $P(D \mid T)$, the probability that you have the disease given that you tested positive.
We can use Bayes’ rule to write:
$$P(D \mid T) = \frac{P(T \mid D)P(D)}{P(T)}$$
We know that $P(T \mid D) = 0.99$, the probability of testing positive given that you have the disease. We also know that $P(D) = 0.0001$, the probability of having the disease in the general population.
To find $P(T)$, the probability of testing positive, we can use the law of total probability:
\begin{align*} P(T) &= P(T \mid D)P(D) + P(T \mid \neg D)P(\neg D) \ &= 0.99 \times 0.0001 + 0.01 \times 0.9999 \ &= 0.010098 \end{align*}
where $\neg D$ is the event that you don’t have the disease, and $P(\neg D) = 1 – P(D) = 0.9999$.
Substituting these values into Bayes’ rule, we get:
\begin{align*} P(D \mid T) &= \frac{P(T \mid D)P(D)}{P(T)} \ &= \frac{0.99 \times 0.0001}{0.010098} \ &\approx \boxed{0.0098} \approx 0.98 % \end{align*}
So the chances that you actually have the disease given that you tested positive are only about 0.98%.
For any two random variables $X, Y$ the covariance is defined as $\operatorname{Cov}(X, Y)=\mathbb{E}[(X-\mathbb{E}[X])(Y-\mathbb{E}[Y])]$. You may assume $X$ and $Y$ take on a discrete values if you find that is easier to work with.
a. $\left[1\right.$ points] If $\mathbb{E}[Y \mid X=x]=x$ show that $\operatorname{Cov}(X, Y)=\mathbb{E}\left[(X-\mathbb{E}[X])^2\right]$.
Starting with the definition of the covariance:
\begin{align*} \operatorname{Cov}(X,Y) &= \mathbb{E}[(X-\mathbb{E}[X])(Y-\mathbb{E}[Y])] \ &= \mathbb{E}[XY – X\mathbb{E}[Y] – Y\mathbb{E}[X] + \mathbb{E}[X]\mathbb{E}[Y]] \ &= \mathbb{E}[XY] – \mathbb{E}[X]\mathbb{E}[Y] – \mathbb{E}[X]\mathbb{E}[Y] + \mathbb{E}[X]\mathbb{E}[Y] \ &= \mathbb{E}[XY] – \mathbb{E}[X]\mathbb{E}[Y] \end{align*}
We can simplify this expression if we can find $\mathbb{E}[XY]$. We have:
\begin{align*} \mathbb{E}[XY] &= \sum_x \sum_y xy \cdot P(X=x, Y=y) \ &= \sum_x \sum_y xy \cdot P(Y=y \mid X=x) \cdot P(X=x) \ &= \sum_x \sum_y xy \cdot x \cdot P(Y=y \mid X=x) \cdot P(X=x) \ &\qquad + \sum_x \sum_y xy \cdot (1-x) \cdot P(Y=y \mid X=x) \cdot P(X=x) \ &= \sum_x x^2 P(X=x) + \sum_x \sum_{y \neq x} xy \cdot P(Y=y \mid X=x) \cdot P(X=x) \ &\qquad + \sum_x \sum_{y \neq x} xy \cdot P(Y=y \mid X=x) \cdot P(X \neq x) \ &= \sum_x x^2 P(X=x) + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y=y \mid X=x) \cdot P(X=x) \ &\qquad + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y=y \mid X=x) \cdot P(X \neq x) \ &= \sum_x x^2 P(X=x) + \sum_x x \cdot \mathbb{E}[Y – X \mid X=x] \cdot P(X=x) \ &\qquad + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y=y \mid X=x) \cdot P(X \neq x) \ &= \sum_x x^2 P(X=x) + \sum_x x \cdot (\mathbb{E}[Y \mid X=x] – x) \cdot P(X=x) \ &\qquad + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y=y \mid X=x) \cdot P(X \neq x) \ &= \sum_x x^2 P(X=x) + \sum_x x \cdot (x – x) \cdot P(X=x) \ &\qquad + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y=y \mid X=x) \cdot P(X \neq x) \ &= \sum_x x^2 P(X=x) + \sum_x x \cdot \sum_{y \neq x} y \cdot P(Y
MY-ASSIGNMENTEXPERT™可以为您提供UNIVERSITY OF ILLINOIS URBANA-CHAMPAIGN MATH2940 linear algebra线性代数课程的代写代考和辅导服务! 请认准MY-ASSIGNMENTEXPERT™. MY-ASSIGNMENTEXPERT™为您的留学生涯保驾护航。