Error Curves——錯誤曲線
描述
Josephina is a clever girl and addicted to Machine Learning recently. She
pays much attention to a method called Linear Discriminant Analysis, which
has many interesting properties.
In order to test the algorithm's efficiency, she collects many datasets.
What's more, each data is divided into two parts: training data and test
data. She gets the parameters of the model on training data and test the
model on test data. To her surprise, she finds each dataset's test error curve is just a parabolic curve. A parabolic curve corresponds to a quadratic function. In mathematics, a quadratic function is a polynomial function of the form f(x) = ax2 + bx + c. The quadratic will degrade to linear function if a = 0.
It's very easy to calculate the minimal error if there is only one test error curve. However, there are several datasets, which means Josephina will obtain many parabolic curves. Josephina wants to get the tuned parameters that make the best performance on all datasets. So she should take all error curves into account, i.e., she has to deal with many quadric functions and make a new error definition to represent the total error. Now, she focuses on the following new function's minimum which related to multiple quadric functions. The new function F(x) is defined as follows: F(x) = max(Si(x)), i = 1...n. The domain of x is [0, 1000]. Si(x) is a quadric function. Josephina wonders the minimum of F(x). Unfortunately, it's too hard for her to solve this problem. As a super programmer, can you help her?
輸入
The input contains multiple test cases. The first line is the number of cases T (T < 100). Each case begins with a number n (n ≤ 10000). Following n lines, each line contains three integers a (0 ≤ a ≤ 100), b (|b| ≤ 5000), c (|c| ≤ 5000), which mean the corresponding coefficients of a quadratic function.
輸出
For each test case, output the answer in a line. Round to 3 digits after the decimal point.
樣例輸入
2 1 2 0 0 2 2 0 0 2 -4 2
樣例輸出
0.000 0.500
描述
Josephina是一個聰明的女孩,最近沉迷於機器學習。她對一種叫做線性判別分析的方法進行了大量的研究。有很多有趣的特性。
為了測試演算法的效率,她收集了許多資料集。此外,每個資料被分為兩部分:培訓資料和測試資料。她在訓練資料上得到模型的引數並測試
測試資料模型.令她驚訝的是,她發現每個資料集的測試誤差曲線都只是一個拋物線曲線。拋物線曲線對應於二次函式。在數學中,二次函式是形式F(X)=ax^2+bx+c的多項式函式。二次型將退化為線性函式,如果a=0。
如果只有一條測試誤差曲線,那麼計算最小誤差是非常容易的。然而,有幾個資料集,這意味著Josephina將獲得許多拋物線曲線。Josephina希望得到調整後的引數,使所有資料集的效能最佳。因此,她應該考慮所有的誤差曲線,也就是說,她必須處理許多二次函式,並做一個新的誤差定義來表示總誤差。現在,她將重點放在以下與多個二次函式相關的新函式的最小值上。新函式f(X)定義如下:f(X)=Max(si(X)),i=1….X的域是[0,1000]。si(X)是一個二次函式。Josephina質疑f(X)的最小值。不幸的是,解決這個問題對她來說太難了。作為一個超級程式設計師,你能幫她嗎?
輸入
輸入包含多個測試用例。第一行是t(t<100)的案件數。每個情況都以一個數字N(N≤10000)開始。以下N行,每一行包含三個整數a(0≤a≤100)、B(|B|≤5000)、C(|C|≤5000),表示一個二次函式的對應係數。
輸出
對於每個測試用例,在一行中輸出答案。四捨五入到小數點後3位。
相關文章
- Flutter 動畫曲線Curves 效果一覽Flutter動畫
- Revit二次開發-曲線三連:對curves進行排序排序
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- MySQL error 錯 誤 碼MySqlError
- PostgreSQL error 錯誤碼SQLError
- Error page: / Error infos: DedeCms錯誤警告Error
- Angular 錯誤訊息:ERROR Error NullInjectorError No provider for XXAngularErrorNullIDE
- dedecms 搬家 / dedecms error warning!錯誤Error
- 15-錯誤處理(Error)Error
- Js錯誤Error物件詳解JSError物件
- Fatal NI connect error 12170 錯誤Error
- 執行SQL發生錯誤!錯誤:disk I/O errorSQLError
- HTTP 錯誤 500.19- Internal Server Error 錯誤解決方法HTTPServerError
- android 打包出現錯誤Error: ResourceNameAndroidError
- PHP curl error 60 錯誤解決PHPError
- Python錯誤:PyCharm 安裝出錯 Internal error,please。。。PythonPyCharmError
- 錯誤處理:如何通過 error、deferred、panic 等處理錯誤?Error
- Angular 依賴注入錯誤訊息:ERROR Error NullInjectorError No provider for XXAngular依賴注入ErrorNullIDE
- 【Jenkins】data stream error|Error cloning remote repo ‘origin‘ 錯誤解決JenkinsErrorREM
- Http failure response 0 Unknown error 錯誤分析HTTPAIError
- SAP Java Connector 錯誤 - JCO_ERROR_COMMUNICATIONJavaError
- 【ERROR】Oracle列印錯誤程式碼解釋ErrorOracle
- 【ERROR】ORA-8103錯誤分析處理Error
- mysql 索引長度 767 錯誤 ERROR 1071MySql索引Error
- 2、MySQL錯誤日誌(Error Log)詳解MySqlError
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- Golang 學習——error 錯誤處理淺談GolangError
- HTTP 錯誤 500.19 - Internal Server Error v4.0.30319HTTPServerError
- 記錄redis佇列read error on connection to錯誤Redis佇列Error
- DZ論壇MySQL Query Error Errno:1046錯誤MySqlError
- QT中error: xxx does not name a type xxx錯誤QTError
- 使用Boost庫報error C4996錯誤Error996
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- 【ERROR】su user報'This account is currently not available'錯誤 for linuxErrorAILinux
- PBOOTCMS網站程式提示“執行SQL發生錯誤!錯誤:DISK I/O ERROR”boot網站SQLError
- Camunda 流程執行錯誤處理ERROR BOUNDARY EVENTError
- SSL錯誤ssl connect error 35的解決方案Error
- React 高階應用 -- 錯誤邊界 Error BoundariesReactError