sql 线性回归_SQL Server中的Microsoft线性回归

sql 线性回归

In this article, we will be discussing Microsoft Linear Regression in SQL Server. This is the next data mining topic in our SQL Server Data mining techniques series. Naïve Bayes, Decision Trees, Time Series, Association Rules, and Clustering are the other techniques that we discussed until today.

在本文中,我们将讨论SQL Server中的Microsoft线性回归。 这是我们SQL Server数据挖掘技术系列中的下一个数据挖掘主题。 到目前为止,朴素贝叶斯,决策树,时间序列,关联规则和聚类是我们讨论的其他技术。

Microsoft Linear Regression is a forecasting technique. In this type of technique, there are multiple independent variables from which the dependent variable is predicted. For example, if you want to predict the house prices, you need to know the number of rooms, the area of the house, and other features of the house.

Microsoft线性回归是一种预测技术。 在这种技术中,存在多个自变量,从中可以预测因变量。 例如,如果要预测房价,则需要知道房间数量,房屋面积以及房屋的其他特征。

This means that the linear regression model can be represented as follows:

这意味着线性回归模型可以表示如下:

Let us see how we can use linear regression in the Microsoft SQL Server platform. As in the previous examples, today also, we will be using the vTargetMail view in the AdventureWorksDW sample database.

让我们看看如何在Microsoft SQL Server平台中使用线性回归。 和前面的示例一样,今天,我们还将在AdventureWorksDW示例数据库中使用vTargetMail视图。

As we did for other data mining techniques, first, we need to create a data source and the Data Source View. The Data source is chosen as AdventureWorksDW and vTargetMail view is selected as the data source views.

正如我们对其他数据挖掘技术所做的一样,首先,我们需要创建一个数据源和数据源视图。 选择数据源作为AdventureWorksDW,并选择vTargetMail视图作为数据源视图。

We choose the Microsoft Linear Regression as the data mining technique, as shown in the below screenshot.

我们选择Microsoft线性回归作为数据挖掘技术,如下面的屏幕快照所示。

Choosing Microsoft Liner Regression as the data mining technique.

In this technique, the Microsoft decision trees algorithm is used. Unlike in the decision trees, linear regression will have only one node, and we will verify the results for linear regression with the decision trees at the end of the article.

在此技术中,使用了Microsoft决策树算法。 与决策树不同,线性回归将只有一个节点,我们将在本文结尾处使用决策树验证线性回归的结果。

The vTargetMail will be the Case table and let us choose relevant attributes, as shown in the below screenshot.

vTargetMail将成为Case表,让我们选择相关属性,如下面的屏幕快照所示。

Specify the Input and predicted attributes for Linear regression.

The Customer Key is chosen as the Key from the algorithm from the above screen. In Microsoft Linear regression, all the inputs should be numerical; the text column should not be selected. Therefore, in the above selection, Age, BikeBuyer, HouseOwnerFlag, NumberCarsOwned, NumberChildrenatHome, TotalChildren are selected as input attributes. This is a major limitation in the Microsoft Linear Regression, which is not in the standard Linear Regression techniques.

从以上屏幕的算法中,将客户密钥选择为密钥。 在Microsoft线性回归中,所有输入都应为数字; 不应选择文本列。 因此,在上述选择中,选择了Age,BikeBuyer,HouseOwnerFlag,NumberCarsOwned,NumberChildrenatHome,TotalChildren作为输入属性。 这是Microsoft线性回归中的主要限制,而标准线性回归技术中则没有。

In the previous examples, we have selected Bike Buyer as the predicted column. However, in the Microsoft Linear Regression, we are to predict YearlyIncome.

在前面的示例中,我们选择了“自行车购买者”作为预测列。 但是,在Microsoft线性回归中,我们将预测YearlyIncome。

Though there are default Content types, there are instances where you need to change the content types. Content types can be modified from the following screenshot.

尽管存在默认的内容类型,但是在某些情况下您需要更改内容类型。 可以从以下屏幕截图中修改内容类型。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值