C# 与输出不直接成比例的变量的线性回归
我一直在努力学习coursera上的机器学习课程。到目前为止,引入的大多数线性回归模型都使用其数值与输出呈正相关的变量C# 与输出不直接成比例的变量的线性回归,c#,machine-learning,linear-regression,C#,Machine Learning,Linear Regression,我一直在努力学习coursera上的机器学习课程。到目前为止,引入的大多数线性回归模型都使用其数值与输出呈正相关的变量 Input: square feet of the house Output: house price. Inputs: -what day is it (Mon,Tues..), -what holiday is it (NewYear,Xmas..), -what month is it(Jan,Feb), -what time is it(0100,1300.
Input: square feet of the house
Output: house price.
Inputs:
-what day is it (Mon,Tues..),
-what holiday is it (NewYear,Xmas..),
-what month is it(Jan,Feb),
-what time is it(0100,1300..)
Output:
-Number of visitors.
然而,我试图实现一个多元回归模型,其中的一些变量是数值,与输出不成正比
Input: square feet of the house
Output: house price.
Inputs:
-what day is it (Mon,Tues..),
-what holiday is it (NewYear,Xmas..),
-what month is it(Jan,Feb),
-what time is it(0100,1300..)
Output:
-Number of visitors.
问题:
你不应该这样想,你不应该手工拟合powers,你应该给模型一个灵活性,以便自己拟合高阶(见上一点)。对于第1点,这是否意味着我需要一个代表每个假期的变量列表,以及表示每个月/星期几的变量列表?那么,我是否必须走到一天中的某个时刻?对于我提到的情景,线性回归是一个好的模型吗?如果不是,你会建议其他的模式吗?每个假期都有自己的变量。编码时间总是很棘手,但最安全的方法是将它们也作为isMonday、isJanuary等处理。我还建议将一天分为几个部分(如isMorning、isMidday等),并使用这些变量。我怀疑实际的数字小时会有多大帮助。在您尝试之前,无法判断任何模型是好是坏。线性回归是一种基本的方法,当且仅当关系非常简单时才有效。