C1W1-03_supervised-ml-sentiment-analysis

视频链接

Jonas: Welcome and this week you’re going to learn about supervised machine learning and specifically you’re going to learn about logistic regression. In order for you to implement logistic regression, you need to take a few steps. In this video you will learn about the steps required in order to implement this algorithm, so let’s take a look.

Jonas: 欢迎大家,这周你们将会学习有监督的机器学习,特别是逻辑回归。为了你能够实现逻辑回归,你需要采取一些步骤。在这个视频中你将会了解到实现这个算法所需的步骤,所以看看下吧。

In supervised machine learning you have input features X and a set of labels Y. Now to make sure you’re getting the most accurate predictions based on your data, your goal is to minimize your error rates or cost as much as possible. And to do this, you’re going to run your prediction function which takes in parameter data to map your features to output labels Y hat. Now the best mapping from features to labels is achieved when the difference between the expected values Y and the predicted values Y hat is minimized. Which the cost function does by comparing how closely your output Y hat is to your label Y. Then you can update your parameters and repeat the whole process until your cost is minimized.

在监督机器学习中你要输入特征X和一组标签Y。现在为了确保基于你的数据能够得到最准确的预测,你的目标是尽可能减少错误率或成本。为了做到这一点,你要运行你的预测函数,它接受参数数据来映射你的特征到输出标签 Y ^ \hat{Y} ,现在,当期望值Y和预测值 Y ^ \hat{Y} 差值最小时从特征到标签实现最佳的映射。然后你更新你的参数,反复整个过程直到你的成本最小。

Supervised ML

So let’s take a look at the supervised machine learning classification task of sentiment analysis. In this example you have the tweet, let’s say, I’m happy because I’m learning NLP. And the objective in this task is to predict whether a tweeta has positive or a negative sentiment. And you’ll do this by starting with a training set where tweets with a positive sentiment have a label of one, and the tweets with a negative sentiment have a label of zero. For this task you will be using your logistic regression classifier which assigns its observations to two distinct classes. Next up I’ll show you how to do this.

所以让我们看下情感分析的监督机器学习分类任务。在这个例子中你有一条推特, 比如说:我很开心因为我正在学习NLP。这个任务的目标是预测这条推特是否有积极或消极的情绪。你可以从一个训练集开始,其中带有积极情绪的推特标签为1,带有消极情绪的推特标签为0。对于这个任务,你将使用逻辑回归分类器,它将观察值分配给两个不同的类。接下来我将给你展示如何做到这一点。
Sentiment analysis

So to get started building a logistic regression classifier that’s capable of predicting sentiments of an aritrary tweet. You will first process the raw tweets in your training sets and extract useful features. Then you will train your logistic regression classifier while minimizing the cost. And finally you’ll be able to make your predictions.

所以为了开始建立一个能够预测任意一条推特的逻辑回归分类器。你将首先处理训练集中的原始推特并特区有用的特征。然后你将训练你的逻辑回归分类器,同时最小化成本。最后你可以做出自己的预测了。

Sentiment analysis2

So in the video you learned about the steps required for you to classify a tweet. Given the tweet, you should classify it to either be positive or negative. In order for you to do so, you first have to extract the features. Then you have to train your model. And then you have to classify the tweet based off your trained model. In the next video, you’re going to learn how to extract these features. So let’s take a look at how you can do that.

因此,在视频中你学习了要求你分类一条推特的步骤。根据这条推特,你应该把它分类为正面或负面。为了做到这一点,首先必须要提取特征。然后你必须训练你的模型。然后你必须基于你的训练模型对这条推特分类。在下一个视频,你将会学习如何提取这些特征。我们来看看怎么做吧。

猜你喜欢

转载自blog.csdn.net/cymx66688/article/details/107190751