Dab tsi yog tus qauv hauv Python?
Dab tsi yog tus qauv hauv Python?

Video: Dab tsi yog tus qauv hauv Python?

Video: Dab tsi yog tus qauv hauv Python?
Video: Data Science with Python! Joining Tables Without a Common Column 2024, Kaum ib hlis
Anonim

numpy.linalg. kev cai . Yog tias axis yog 2-tuple, nws qhia cov axes uas tuav 2-D matrices, thiab matrix cov cai ntawm no matrices yog xam. Yog tias axis tsis muaj ces yog vector kev cai (thaum x yog 1-D) lossis matrix kev cai (thaum x yog 2-D) rov qab.

Ib yam li ntawd, dab tsi yog tus qauv ntawm kev ua haujlwm?

Hauv linear algebra, functional analysis, and related areas of lej, a kev cai yog a muaj nuj nqi uas txaus siab rau tej yam khoom muaj feem xyuam rau scalability thiab additivity, thiab muab ib tug nruj me ntsis zoo tus naj npawb tiag tiag rau txhua vector nyob rau hauv ib tug vector qhov chaw nyob rau hauv lub teb ntawm tiag los yog complex tooj-tsuas yog rau xoom vector, Ib sab saum toj no, Norm tshuab kev kawm yog dab tsi? Taw qhia. Peb yuav pom ib lub tswv yim tseem ceeb rau tshuab kev kawm thiab tob kev kawm . Cov cai yog qhov feem ntau siv los ntsuas qhov yuam kev ntawm tus qauv. Piv txwv li, nws yog siv los xam qhov yuam kev ntawm qhov tso zis ntawm lub neural network thiab qhov xav tau (qhov tseeb daim ntawv lo lossis tus nqi).

Ntxiv mus, Python suav li cas l2 tus qauv?

Cov L2 norm yog xam raws li lub hauv paus square ntawm cov sum ntawm cov squared vector qhov tseem ceeb. Cov L2 norm ntawm ib vector tuaj yeem yog xam hauv NumPy siv lub kev cai () muaj nuj nqi nrog lub neej ntawd tsis. Ua ntej, ib tug 1 × 3 vector yog txhais, ces tus L2 norm ntawm vector yog xam.

L1 l2 thiab L infinity norm yog dab tsi?

L1 Norm : Kuj hu ua Manhattan Distance lossis Taxicab kev cai . L1 Norm yog qhov sib npaug ntawm qhov loj ntawm cov vectors hauv qhov chaw. Nws yog txoj hauv kev zoo tshaj plaws ntawm kev ntsuas qhov deb ntawm vectors, uas yog qhov sib txawv ntawm qhov sib txawv ntawm cov khoom ntawm vectors.

Pom zoo: