machine learning no mundo real - qconsp · prediÇÃo de salÁrios feature extraction vw-varinfo...

31
MACHINE LEARNING NO MUNDO REAL COM VOWPAL WABBIT

Upload: others

Post on 28-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

MACHINELEARNINGNOMUNDOREAL

COM

VOWPALWABBIT

Page 2: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

VOWPALWABBIT????

Implementaçãoopen-sourcedealgoritmosdeMachineLearning

Rápido(VorpalSword+Rabbit)Online(out-of-core)=>grandesconjuntosdedadosDesenvolvidaporJohnLangford(YahooResearch,MicrosoftResearch)OpenSource(BSDLicense)

Page 3: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PROBLEMA1:REGRESSÃO

Page 4: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DADOUMANÚNCIODEEMPREGO,PREDIZEROSALÁRIOCORRESPONDENTE

Cliente:agênciadeempregos.Motivação:

melhoraraexperiênciadousuárioreduzirtempodeprocuraporvaga.

Background:metadedasvagasanunciadasnãodeclaramosaláriooferecidodificuldadederealizaçãodepesquisas

SOLUÇÃO:CRIARUMMODELODEREGRESSÃO

Page 5: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

MODELOS

MODELOSSÃOSIMPLIFICAÇÕESDAREALIDADE

DadosBrutos=>Features,Label

F(features)=Label

Page 6: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

MODELOSExemplo:

"UmaZebraéumanimalquemedeaproximadamente1.5metrosdealturapordoismetrosdecomprimento.Possui4pataseélistrada".Features:Altura:1.5Comprimento:2.0NumeroDePernas:4.0PossuiListras:1.0

Label:Zebra

Page 7: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

APRENDENDOMODELOS

VWaproximaFdeformalinear:

F=c1*feature1+c2*feature2+c3*feature3...

Page 8: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

DADOSDISPONÍVEIS:

TítuloDescriçãoLocalizaçaoTipodeContrato(permanente/temporário)DuraçãodoContratoEmpresaCategoriaSalário

Page 9: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOSModelagem

VWpossuiumformatodeentradabastanteflexível:

[Label][Importance[Tag]]|NamespaceFeatures|NamespaceFeatures...|Namespace

ondeNamespace=String[:Value]Features=(String[:Value])*

Exemplos:2.0|PossuiListras=trueNumeroDePernas:4Altura:2.0Comprimento:1.53.0|RuntimeMins:165|TitleDjangoFree|DirectorQuentin_Tarantino

Page 10: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

DADOSBRUTOS

Id,Title,FullDescription,LocationRaw,LocationNormalized,ContractType,ContractTime,Company,Category,SalaryRaw,SalaryNormalized,SourceName

12612628,EngineeringSystemsAnalyst,"EngineeringSystemsAnalystDorkingSurreySalary****KOurclientislocatedinDorking,SurreyandarelookingforEngineeringSystemsAnalystourclientprovidesspecialistsoftwaredevelopmentKeywordsMathematicalModelling,RiskAnalysis,SystemModelling,Optimisation,MISER,PIONEEEREngineeringSystemsAnalystDorkingSurreySalary****K","Dorking,Surrey,Surrey",Dorking,,permanent,GregoryMartinInternational,EngineeringJobs,20000-30000/annum20-30K,

Page 11: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

MODELAGEM

10.126631103850338|category=engineering_jobs|Titleengineeringsystemsanalyst|Descriptionengineeringsystemsanalystdorkingsurreyourclientislocatedindorkingsurreyandarelookingforengineeringsystemsanalyst...|Locationdorking|Typepermanent|Companygregory_martin_international

Page 12: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

TREINANDOOMODELO:

VW-DDATA.TRAIN-C-K--PASSES20-FMODEL

[Demo]

Page 13: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

FEATUREEXTRACTION

vw-varinfoidentificaasfeaturesmaisrelevantes

Top10positivefeatures:

Type^contract13758903+3.2116100.00%Type^permanent8492139+3.151098.11%Type^null15155178+3.139897.76%^category=it_jobs28169692+1.224138.12%^category=legal_jobs22520512+1.204937.52%^category=energy__oil___gas_jobs2936406+1.200937.39%^category=accounting___finance_jobs5861867+1.179136.71%^category=engineering_jobs27357109+1.166036.31%^category=other_general_jobs1355204+1.159036.09%^category=trade___construction_jobs1018754+1.147435.72%

Page 14: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIÇÃODESALÁRIOS

FEATUREEXTRACTION

vw-varinfoidentificaasfeaturesmaisrelevantes

Top10negativefeatures:Description^carlyle12976919-0.3576-11.13%Description^stuttgart26299885-0.3588-11.17%Description^reablemenet11034468-0.3589-11.17%Company^qa_apprenticeships24833833-0.3627-11.29%Company^bt3952904-0.3696-11.51%Company^remit_group3484950-0.3856-12.01%Description^koharaeurolondon18160096-0.3951-12.30%Company^bv_recruitment9125445-0.4158-12.95%Company^metia15577492-0.4255-13.25%Company^source_recruitment_services16127781-0.4593-14.30%Title^apprentice32484796-0.6025-18.76%

Page 15: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PROBLEMA2:CLASSIFICAÇÃO

Page 16: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

SENTIMENTANALYSISDECOMENTÁRIOSEMREDESSOCIAIS

Cliente:e-commerce.Motivação:

monitoramentoautomáticodecomentáriosnaWebsobreprodutoscomercializados.

Background:detectarautomaticamenteclientesinsatisfeitose-commercepodeagirparaevitarqueainsatisfaçãosepropague

SOLUÇÃO:CRIARUMMODELODECLASSIFICAÇÃO

Page 17: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

CLASSIFICAÇÃONOVW

FacilmenteresolvidosnoVWatravésdeReduções:

problemamaiscomplexo->problemamaissimples

Opções:

ErrorCorrectingTournment(--ect)OneAgainstAllMulticlass(--oaa)

Page 18: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

SENTIMENTANALYSIS

Dadosdeentrada:34milhõesdereviewsdeprodutosdaAmazon.com

product/productId:B0001Z3TLQproduct/title:BytheSea[VHS]product/price:unknownreview/userId:A3421LTBSWSPXKreview/profileName:KMLreview/helpfulness:5/6review/score:4.0review/time:1089417600review/summary:Aromanticzenbaseballcomedyreview/text:Whenyouhearfolkssaythattheydon'tmake'emlikethatanymore,theymightbetalkingabout"BYTHESEA".ThisisaverycoolstoryaboutayoungCubangirlsearchingforidenitywhostumblesintoacoastalresortkitchengigwithazenmotorcyclemaintenanceman,threehystericalItalianchefsandaLatinofireballingrighthandedpitcherwhoplaysontheteamsponsoredby...

Page 19: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

SENTIMENTANALYSIS

Modelagem

Objetivo:criarmodelocapazdedetectarsatisfaçãoapartirdecomentáriosParaestefim,usaremosapenasasfeaturestextuais:títuloetextoComolabelusaremosanotadadaaoproduto

4.0|Summaryaromanticzenbaseballcomedy|Textwhenyouhearfolkssaythattheydon

Page 20: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

SENTIMENTANALYSIS

[Demo]

Page 21: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PROBLEMA3:FILTRAGEMCOLABORATIVA

Page 22: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

PREDIZERANOTADEUMUSUÁRIOPARAUMITEM

Cliente:e-commercedefilmesMotivação:recomendarparaumusuáriofilmesnãovistosquesejaminteressantesdeformapersonalizada.Background:ouniversodefilmesexistentesémuitogrande.Umsistemaderecomendaçãopodemelhoraraexperiênciadousuário.

Solução:criarummodelobaseadoemdecomposição

dematrizes

Page 23: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Associaçãousuário-itempodeserrepresentadacomoumamatrizesparsa

Page 24: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Dadoumvolumesuficientededados,algunspadrõespodemcomeçarasurgir

Page 25: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Padrõesdotipo"quemgostadissogostatambémdaquilo"sãochamadosfatoreslatentes.DecomposiçãodematrizesvisaaproximaramatrizoriginalatravésdaidentificaçãodeKfatoreslatentes

Page 26: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Umavezdescobertas,asmatrizesXeYpodemserusadasparaaproximaranotadeitemsnãovistos(i.e.preencherascolunasvaziasdeP)

Problema:dadoP,aprenderXeY

Page 27: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Dadosdeentrada:5.5milhõesdereviewsdefilmesdaAmazon.com

product/productId:B0001Z3TLQproduct/title:BytheSea[VHS]product/price:unknownreview/userId:A3421LTBSWSPXKreview/profileName:KMLreview/helpfulness:5/6review/score:4.0review/time:1089417600review/summary:Aromanticzenbaseballcomedyreview/text:Whenyouhearfolkssaythattheydon'tmake'emlikethatanymore,theymightbetalkingabout"BYTHESEA".ThisisaverycoolstoryaboutayoungCubangirlsearchingforidenitywhostumblesintoacoastalresortkitchengigwithazenmotorcyclemaintenanceman,threehystericalItalianchefsandaLatinofireballingrighthandedpitcherwhoplaysontheteam...

Page 28: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Modelagem

4.0|USERA3421LTBSWSPXK|ITEMB0001Z3TLQ5.0|USERA1B8X446EXNZBF|ITEMB0001Z3TLQ5.0|USERA3SVRX0U6ZGAXL|ITEMB0001Z3TLQ1.0|USERA3MJIXDIQT5S16|ITEMB001GE2CDM3.0|USERA2FSEZ7KWU3MIY|ITEMB004H9ZQ681.0|USERA1QAULZ03WCAEO|ITEMB004H9ZQ685.0|USERA11ES13Y64903L|ITEMB000XUOLVQ4.0|USERAZ9JWGE1UGKZA|ITEMB000XUOLVQ4.0|USERA2HUDDEJCGH18R|ITEMB000XUOLVQ5.0|USERAJO845T34ONT0|ITEMB000XUOLVQ

Page 29: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Treinamento

[DEMO]

VW-QUI-DMOVIES.TRAIN--RANK10-FMOVIES.VW

Page 30: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle

DECOMPOSIÇÃODEMATRIZES

Page 31: MACHINE LEARNING NO MUNDO REAL - QConSP · PREDIÇÃO DE SALÁRIOS FEATURE EXTRACTION vw-varinfo identifica as features mais relevantes Top 10 negative features: Description^carlyle