Wykład 1 - web.sgh.waw.plweb.sgh.waw.pl/~mantosi/SRD_sn/Wyklad1.pdf · Wykład 1 Bogumił...

Post on 14-Jul-2020

9 views 0 download

Transcript of Wykład 1 - web.sgh.waw.plweb.sgh.waw.pl/~mantosi/SRD_sn/Wyklad1.pdf · Wykład 1 Bogumił...

Statystyczne Reguły Decyzyjne[223490-0286]

Wykład 1

Bogumił Kamiński

www.bogumilkaminski.pl

Bogumił Kamiński 2

Wiedza

Umiejętności

• GNU R, Python, Julia

• SQL, NoSQL

• Excel

• Prezentacja

• Raporty

• Implementacja

• Optymalizacja

• Symulacja

• Analiza danych

• Ekonomia

• Zarządzanie

• Finanse

Domeny Metody

NarzędziaKomunikacja

Typy sytuacji decyzyjnych

SRD, SGH 4

• Indywidualna

– Deterministyczne

– Z niepewnością

– Ryzyko

• Strategiczne interakcje

Typy sytuacji decyzyjnych

SRD, SGH 5

• Indywidualna

– Deterministyczne (np. Nieklasyczne metody optymalizacji)

– Z niepewnością (np. Zaawansowane modelowanie symulacyjne)

–Ryzyko

• Strategiczne interakcje (np. Ekonomia gałęziowa, Modelowanie wieloagentowe)

Informacje potrzebne dla managerów

SRD, SGH 6

• Prawdopodobieństwo odejścia klienta (churn) w ciągu miesiąca od dokonania prognozy …

• Uporządkowanie produktów pod względem przyrostu prawdopodobieństwa zakupu w przypadku wysłania do klienta oferty (w stosunku do zakupu samorzutnego) …

• Wartość oczekiwana popytu klienta w ciągu najbliższego miesiąca …

… jako funkcja atrybutów klienta

Evidence based management

SRD, SGH 7

„Man won’t fly for a thousand years.”

Wilbur Wright, to brother Orville after a disappointing flying experiment, 1901

„The war in Vietnam is going well and will succeed.”

Robert McNamara, U.S. Secretary of Defence, 1963

„Everything that can be invented has been invented.”

C. H. Duell, Patent Office Director, urging President McKinley to abolish the office, 1899

„I cannot conceive of anything more ridiculous, more absurd, and more affrontive to sober

judgment that the cry that we are profiting by the acquisition of New Mexico and California.”

U.S. Senator Daniel Webster, 1848

„I cannot imagine any condition which could cause this ship to founder. I cannot conceive

of any vital disaster happening to the vessel. Modern shipbuilding has gone beyond that.”

E.J. Smith, captain of the Titanic, 1912

„I think there is a world market for about five computers.”

Thomas J. Watson, IBM, 1958

Evidence based management

SRD, SGH 8

Evidence based management

SRD, SGH 9

„Man won’t fly for a thousand years.”

Wilbur Wright, to brother Orville after a disappointing flying experiment, 1901

„The war in Vietnam is going well and will succeed.”

Robert McNamara, U.S. Secretary of Defence, 1963

„Everything that can be invented has been invented.”

C. H. Duell, Patent Office Director, urging President McKinley to abolish the office, 1899

„I cannot conceive of anything more ridiculous, more absurd, and more affrontive to sober

judgment that the cry that we are profiting by the acquisition of New Mexico and California.”

U.S. Senator Daniel Webster, 1848

„I cannot imagine any condition which could cause this ship to founder. I cannot conceive

of any vital disaster happening to the vessel. Modern shipbuilding has gone beyond that.”

E.J. Smith, captain of the Titanic, 1912

„I think there is a world market for about five computers.”

Thomas J. Watson, IBM, 1958

Założenie: Niedaleką przyszłość można opisywać na

podstawie obserwacji niedawnej przeszłości

Proces analityczny

SRD, SGH 10

Proces analityczny

SRD, SGH 11

Niepewność R2

SRD, SGH 12

Niepewność R2 (kod)

SRD, SGH 13

sizes <- seq(from = 10, to = 200, by = 10); reps <- 2^10sim.r.squared <- function(n) {

x <- rnorm(n); y <- x + rnorm(n); model <- lm(y ~ x)return(summary(model)$r.squared)

}r.squared.q95 <- r.squared.q5 <- r.squared.mean <- numeric(length(sizes))for (i in 1:length(sizes)) {

result <- replicate(reps, sim.r.squared(sizes[i]))r.squared.mean[i] <- mean(result)r.squared.q5[i] <- quantile(result, 0.05)r.squared.q95[i] <- quantile(result, 0.95)

}plot(sizes, r.squared.mean,

ylim=c(min(r.squared.q5), max(r.squared.q95)),xlab="wielkość próby", ylab=expression(R^2))

lines(sizes, r.squared.q5); lines(sizes, r.squared.q95)

Niepewność R2 – dziewięć zmiennych

SRD, SGH 14

Przykład modelu prognostycznego

SRD, SGH 15

• Zmienne objaśniające:

– X1 do X5, losowe

• Zmienna objaśniana (proces generacji nieznany dla analityka)

– Y=X1+X2+1+

• Symulowany proces:

– Zebrano dane historyczne

– Zbudowano model

– Zastosowano model do prognozy na nowych danych

– Zebrano rzeczywiste realizacje Y dla nowych danych

Przykład modelu prognostycznego

SRD, SGH 16

• Zmienne objaśniające:

– X1 do X5, losowe

• Zmienna objaśniana (proces generacji nieznany dla analityka)

– Y=X1+X2+1+

Wyniki

Model MSE Historyczne MSE Prognozowane

Zmienne X1-X5 1.39 1.45

Zmienne X1-X2 1.41 1.42

Cel zajęć

SRD, SGH 17

Jak budować modele

prognostyczne, które dają dobre

prognozy?

Źródła danych do analiz

• Hurtownia danych:– zintegrowana

– historyzowana

– niezmienna

• Data lake

• Analytical data set (ADS) / analytical base table (ABT)– Zapytanie do hurtowni danych

– Cele:• Budowa modelu

• Scoring modelu

– Musi uwzględniać zależności czasowe

18