Docsity

Basi di dati distribuite - Vector Spaces, Dispense di Basi di Dati

Anteprima parziale del testo

Scarica Basi di dati distribuite - Vector Spaces e più Dispense in PDF di Basi di Dati solo su Docsity!

Corso di Basi di Dati Distribuite Algoritmi di Apprendimento avanzato per

l’Information Retrieval

Corso di Basi di Dati Distribuite Algoritmi di Apprendimento avanzato per

l’Information RetrievalAlessandro Moschitti

Dipartimento di Informatica Sistemi e produzione

Università di Roma “Tor Vergata”^ Email:

[email protected]

OutlineOutline

Vector Spaces

Definition Properties Norms Inner Product Vector Spaces

Definition (2)Definition (2)

For all

v^ in V, there exists an element

w^

in V, such that

v^ +

w^

=^^0

(Existence of additive inverses in V.) v^ +

w^

=^ w

+^

v.

(Commutativity of vector addition in V.) a^ *

v^ belongs to V. (Closure of V under scalar multiplication.) a^ * (

b^ *

v ) = (

ab

) *^

v.

(Associativity of scalar multiplication in V.) If 1 denotes the multiplicative identity of the field F, then 1 *

v^ =

v.

(Neutrality of one.) a^ * (

v^ +

w ) =

a^ *

v^ +

a^ *

w.

(Distributivity with respect to vector addition.) ( a^ +^ b

) *^

v^ =

a^ *

v^ +

b^ *

v.

(Distributivity with respect to field addition.)

EsempioEsempio

For all

n^

n R forms a vector space over

R , with component-wise

operations. Let

V^

be the set of all n-tuples, [v1,v2,v3,...,vn] where vi, for i={1,2,3,...n} is a member of

R ={real numbers}. Let the field be

R , as well.Define Vector Addition:For all v, w, in

V , define v+w=[v1+w1,v2+w2,v3+w3,...,vn+wn].

Define Scalar Multiplication:For all a in

F^

and v in

V , av=[av1,av2,av3,...,a*vn]. Then

V^

is

a Vector Space over

R.

Normed Vector SpacesNormed Vector Spaces If^ V

is a vector space over a field

K , a norm on

V^

is a function

from

V to

R

,

it associates to each vector

v^

in^

V^ a real number, ||

v ||.

The norm must satisfy the following conditions:

For all

a^ in

K^

and all

u^

and

v^ in

V ,

v ||^

≥^ 0 with equality if and only if

v^ =

^0.

a v || = |

a | ||

v ||.

u^ +

v ||

≤^ ||

u || + ||

v ||.

A useful consequence of the norm axioms is the inequality

|| u ±^ v

||^ ≥

u || - ||

v || |

for all vectors

u^

and

v.

Inner Product SpacesInner Product Spaces Let V be a vector space and

u ,

v , and

w

be vectors in V and c

be a constant. Then an

inner product

( , ) on V is a function with domain

consisting of pairs of vectors and range real numbers satisfyingthe following properties.

  1. (

u ,^

u ) >

0 with equality if and only if

u^

=^

0.

  1. (

u ,^

v ) = (

v ,^

u )

  1. (

u^ +

v ,

w

) = (

u ,^

w ) + (

v ,^

w )

  1. (c

u ,^

v ) = (

u , c

v ) = c(

u ,^

v )

Inner Product PropertiesInner Product Properties

( v ,

^0 ) =

0

If (

v ,^

u ) =

0,

v ,

u^

are called orthogonal

Schawrz Inequality:

[( v

,^ u

2 )]

≤^ (

v ,^ u

) ( v

,^ u

The classical scalar product is the component-wise product ( x^1

,^ x

,^ 2 …

, x n

) (y

,^ y 1

,^ 2 …

, y n

) = (

x^1 y^1

,^ x^2

y 2

,^ …

, x n

y n )

) , ( || ||^

v v

v^

=

|| || || ||

) , (

) ,

cos(

v

u

v u

v u^

⋅

=

Similarity MetricsSimilarity Metrics

Simplest for continuous

m

-dimensional instance space is

Euclidian distance

.

Simplest for

m

-dimensional binary instance space is

Hamming distance

(number of feature values that differ).

For text, cosine similarity is typically most effective.