ee.Reducer.linearRegression
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างตัวลดที่คำนวณการถดถอยแบบกำลังสองน้อยที่สุดเชิงเส้นที่มีตัวแปรอิสระ numX และตัวแปรตาม numY
แต่ละทูเพิลอินพุตจะมีค่าสำหรับตัวแปรอิสระตามด้วยตัวแปรที่ขึ้นต่อกัน
เอาต์พุตแรกคืออาร์เรย์สัมประสิทธิ์ที่มีมิติข้อมูล (numX, numY) แต่ละคอลัมน์มีสัมประสิทธิ์สำหรับตัวแปรตามที่เกี่ยวข้อง เอาต์พุตที่ 2 คือเวกเตอร์ของค่าเฉลี่ยกำลังสองของส่วนที่เหลือของตัวแปรตามแต่ละตัว เอาต์พุตทั้ง 2 จะเป็น Null หากระบบมีข้อมูลไม่เพียงพอ เช่น จำนวนอินพุตน้อยกว่าหรือเท่ากับ numX
การใช้งาน | การคืนสินค้า |
---|
ee.Reducer.linearRegression(numX, numY) | ตัวลดตำแหน่ง |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
numX | จำนวนเต็ม | จํานวนมิติข้อมูลอินพุต |
numY | จำนวนเต็ม ค่าเริ่มต้น: 1 | จํานวนมิติข้อมูลเอาต์พุต |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eComputes a linear least squares regression with user-defined independent and dependent variables.\u003c/p\u003e\n"],["\u003cp\u003eEach input to the reducer should contain values for independent variables followed by dependent variables.\u003c/p\u003e\n"],["\u003cp\u003eOutputs a coefficients array and a root mean square error vector, or null if the system is underdetermined.\u003c/p\u003e\n"],["\u003cp\u003eThe coefficients array provides coefficients for each dependent variable, organized in columns.\u003c/p\u003e\n"],["\u003cp\u003eThe root mean square error vector quantifies the residual error for each dependent variable.\u003c/p\u003e\n"]]],[],null,["# ee.Reducer.linearRegression\n\nCreates a reducer that computes a linear least squares regression with numX independent variables and numY dependent variables.\n\n\u003cbr /\u003e\n\nEach input tuple will have values for the independent variables followed by the dependent variables.\n\nThe first output is a coefficients array with dimensions (numX, numY); each column contains the coefficients for the corresponding dependent variable. The second output is a vector of the root mean square of the residuals of each dependent variable. Both outputs are null if the system is underdetermined, e.g., the number of inputs is less than or equal to numX.\n\n| Usage | Returns |\n|-----------------------------------------------|---------|\n| `ee.Reducer.linearRegression(numX, `*numY*`)` | Reducer |\n\n| Argument | Type | Details |\n|----------|---------------------|----------------------------------|\n| `numX` | Integer | The number of input dimensions. |\n| `numY` | Integer, default: 1 | The number of output dimensions. |"]]