您的位置:首页 > 其它

LA 5009 (HDU 3714) Error Curves 翻译

2015-01-15 16:38 288 查看
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.

Josephina是一个聪明的女孩,她沉迷于机器学习最近。她关注一个方法称为线性判断分析,有很多有趣的性质

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.

为了检测算法的效率,她收集很多数据集。更重要的是,每个数据分为2对:训练数据和测试数据。获取训练数据的模型参数,测试数据的测试模型

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 formf(x) = ax2 + bx + c. The quadratic will degrade
to linear function ifa = 0.

令她吃惊的,她发现每个测试数据集测试误差曲线是抛物线曲线。抛物线曲线对应一个二次方程式曲线。在数学上,二次函数是多项式函数 f(x) = ax2 + bx + c,这个二次方程是降序线性函数 ifa = 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将有很多抛物线曲线

Josephina wants to get the tuned parameters that make the best performance on all datasets.

Josephina想调整参数,使最好的表现在所有数据集

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.

所以她应该考虑所有误差曲线,i.e,她不得不处理很多二次方程函数使新误差定义代表总误差。

Now, she focuses on the following new function's minimal which related to multiple quadric functions.

现成,她面对如下新函数的最小, 相关多个二次函数

The new function F(x) is defined as follow:

新函数F(x)定义如下

F(x) = max(Si(x)), i = 1...n. The domain of x is [0, 1000].Si(x) is a quadric function.

F(x) = max(Si(x)), i = 1...n. x的范围[0, 1000] ,Si(x)是二次函数

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?

Josephina惊奇最小F(x),不幸的是,她解决这个问题太难了,最为一个超级程序员,你能帮助她吗?

Input

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). Followingn lines, each line contains three integersa (0 ≤ a ≤ 100),b (|b| ≤ 5000), c (|c| ≤ 5000), which mean the corresponding
coefficients of a quadratic function.

输入包含多组测试案例。第一行是数字T(T<100),每个案例开始是一个数字n(n<=10000).随后n行。每行包含3个整数(0 ≤ a ≤ 100),b (|b| ≤ 5000), c (|c| ≤ 5000),意味着二次函数对应的系数

Output

For each test case, output the answer in a line. Round to 4 digits after the decimal point.

每个测试案例,输出答案。小数后有4个小数点
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: