公式1与飞行员同盘速度

场合

几个月前,作为Amazon与一级方程式赛车合作的一部分,研究人员“利用云技术的力量”进行了一次历时与人类飞行速度的比较(链接)。自然,这种材料是宣传广告,它实现了目标。在整个方程式世界上持续了几天的时间,只有本着“为什么评级中没有飞行员N?”的精神进行讨论。和“如果在第L季K达到M,怎么会比K快?” 对我而言,或多或少重复这项研究变得很有趣,并且在可能的情况下,在没有“云技术的所有力量”的情况下也做到了。

原始评分
原始评分

一个任务

. . , , , , , . . AWS – . , . .

F1, – 10% , 90% - . - , .. , , . , , . , , .

. , , «» . , 2 , , « » - , . , . , , , .

. , , . «» , , 1. , , , .

, , kp, .

.. V = V0*kp*kc*Tr, kc – , Tr – , .

, ln(ki)-ln(kj)=ln(tj)-ln(ti) .

. m*(n+1), n – , m – . 1 -1 , , .

AWS, , , - . , , « » - , . .. «» 2 0 .

, F1. . , , , , . , , , - .

  , , 2 . 3 . 1 – , . , «». – . , . . – . , , .

, . , 1, 2 3 . , , .

import sys
import re
import urllib.request


def get_wikipedia_page(title, lang='en'):
    url = 'https://'+lang+'.wikipedia.org/wiki/'+(title.replace(' ', '_'))
    fp = urllib.request.urlopen(url)
    mybytes = fp.read()
    
    mystr = mybytes.decode("utf8")
    fp.close()
    return mystr

title = 'List of Formula One Grands Prix'

try:
    print('process: '+title)
    th = get_wikipedia_page(title)
    r1 = re.findall(r'href="/wiki/[\d][\d][\d][\d]_[\w]*_Grand_Prix"',th)
    list_of_GP = list(set(r1))
except:
    print("Unexpected error:", sys.exc_info()[0])

titles = list(map(lambda x: x[12: -1].replace('_', ' '), list_of_GP))


for title in titles:
    try:
        print('process: '+title)
        th = get_wikipedia_page(title)
        with open('texts/'+title+'.txt', 'w', encoding='utf8') as the_file:
            the_file.write(th)
            the_file.close()
    except:
        print("Unexpected error:", sys.exc_info()[0])

html . . ( ), ( ), «» . csv.

DataFrame. , :

+ . ,

+ – , 1 , 2

= + . , . , . - , .

qual_df = pd.read_csv('qual_results.csv')

qual_df['Track_pl_len'] = qual_df['Track'] + '_' +qual_df['Track_len'].apply(str)
qual_df['Car'] = qual_df['Constructor'] + '_' +qual_df['Year'].apply(str)
qual_df['Driver_pl_year'] = qual_df['Driver']+'_'+qual_df['Year'].apply(str)

qual_df_2 = qual_df.copy()
qual_df_2['Driver_pl_year'] = qual_df_2['Driver']+'_'+((qual_df_2['Year'].apply(int)-1)).apply(str)
double_df = pd.concat([qual_df, qual_df_2])
del qual_df2

. , . . , , . , , . .

. 2 , .

  • , ..

  • , 2 –

  • , «» «» - 6 2%. , «» 1 – , . ,

  • 2 One Hot Encoding , x = 1 , y -1

  • , . , – 1 , .. 1, 0. –

  • . ln(k) - .

, .

, , «» , .. , F1 Amazon.

, :

,

18 , . , + + , . , 10. , . . , .

– . 2019 , . , 1.

– . . , . , 1 . . 1, / .

, :

N

Driver

Total min

1

Ayrton Senna

-     0,435

2

Michael Schumacher

-     0,408

3

Alain Prost

-     0,289

4

Damon Hill

-     0,037

5

Lewis Hamilton

-     0,037

6

Charles Leclerc

       0,016

7

Rubens Barrichello

       0,024

8

Fernando Alonso

       0,067

9

Nico Rosberg

       0,081

10

Nigel Mansell

       0,102

11

Carlos Pace

       0,117

12

Mika Häkkinen

       0,145

13

Max Verstappen

       0,147

14

Valtteri Bottas

       0,153

15

Elio de Angelis

       0,164

16

Daniel Ricciardo

       0,165

17

Jarno Trulli

       0,172

18

Giancarlo Fisichella

       0,184

  ( , .. 1 ):

  , .

:

2020 – , ( – 1979 , ).

, Renault , . Racing Point, 2 , Alpha Tauri 2020, Red Bull 2019 Ferrari 2020, - 2018 .

, 2019 Mercedes, 10 , Red Bull . , , , , .

. , . - , . . , .

, ( , .. 2 , 1):

Driver

Car

 Time_predicted_sec

Lewis Hamilton

Mercedes

                        77,711

Valtteri Bottas

Mercedes

                        77,850

Max Verstappen

Red Bull Racing-Honda

                        78,252

Lando Norris

McLaren-Renault

                        78,324

Sergio Pérez

Racing Point-BWT Mercedes

                        78,345

Lance Stroll

Racing Point-BWT Mercedes

                        78,439

Daniel Ricciardo

Renault

                        78,451

Carlos Sainz Jr.

McLaren-Renault

                        78,549

Esteban Ocon

Renault

                        78,665

Alexander Albon

Red Bull Racing-Honda

                        78,878

Pierre Gasly

AlphaTauri-Honda

                        78,985

Daniil Kvyat

AlphaTauri-Honda

                        79,108

Charles Leclerc

Ferrari

                        79,116

Sebastian Vettel

Ferrari

                        79,531

Romain Grosjean

Haas-Ferrari

                        79,656

Kevin Magnussen

Haas-Ferrari

                        79,738

Kimi Räikkönen

Alfa Romeo Racing-Ferrari

                        80,399

Antonio Giovinazzi

Alfa Romeo Racing-Ferrari

                        80,658

1 Amazon . : .

, , , / , , .

, . , , – 70 1. , .

建立像样的回归是不可能的,看似没有问题的模型仍然会引发意想不到的结果。考虑到机器和飞行员的影响,构建统一模型的所有尝试都必须严格进行规范化。

我将带有原始数据和数据透视表的github附加到文章中以供自学,如果不感到羞耻,我会立即添加代码。

链接到Github




All Articles