Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
AI Builder - Binary Classification
1. Binary classification
Binaryclassificationuseshistorical datatopredictwhethernew datafallsintoone of twocategories.
You can use these insightstodevelopactionable intelligence foryourbusiness.
In thislab,we will buildandtraina binaryclassificationmodel. We will alsoreview the level of influence
of the selectedcriteria. Finally,we will make amodel-drivenapplicationto review thisdataprediction.
The data usedhere will helpuspredictonlineshopperintentions. We have detailsof ashopper’ssite
visitaswell asif thatvisitresultedinasale (revenue). Once we have the predictioninformation,we can
use that to helpguide marketingplans,websiteupdates,promotional communications,andmore.
Note: If you are buildingthe firstmodel inanenvironment,clickonExplore Templatestogetstarted.
Exercise 1
In the firstexercise youwillbuildandtrainyourmodel.
1. From the leftnavigation,expandAIBuilderandselectBuild.
2. 2. SelectBinaryClassification.
3. Name yourmodel. Because youare workingina sharedenvironmentmake sure toinclude your
name as part of the model name. Thiswill make iteasiertofindlater. Clickcreate.
4. 6. You will see Quicktipsonthe right.
7. In the centerwe will buildourmodel. Clickinthe EntityfieldandselectOnline Shopper
Intention. Thisisacustomentitythat collectsthe datawe are storingregardingthe online
shopper’svisittooursite.
5. 8. From the selectedentitywe willnow see availablebinaryfieldsforprediction. The onlyfields
we will see here are of type “Twooption.” SelectRevenue.ClickNext.
9. The nextscreenwill showusavailable fieldsonthe entity. Eachfieldselectedwill be evaluated
by the model forthe fieldsinfluence onthe endresult. Bydefault,all fieldswill be selected,do
not remove anyfields. ClickNext.
10. Notice our progress indicatorhasmovedtothe nextitem. ClickTrain.
6. 11. Your Binary Classificationmodel will now train. Goto Models.
12. Locate andopenyour savedmodel. If youneedhelpfindingit,type yourname intothe search
box.
13. Aftereachtraining,AI Builderusesthe testdatasetto evaluate the qualityandaccuracyof the
newmodel.A summarypage foryour model showsyourmodel trainingresult,includinga
Performance score.The score we have is 65% and we shouldexpectittochange overtime. And
now we can viewsome detailsaboutourtrainedmodel. ClickonView Details.
7. 14. Our detailsreportwill show the datainfluencersandhow muchinfluencethatdatahas on our
predictionmodel. Close the details.
15. Publishyourmodel. Once publishedthe datawill getscored,andscoringwill happendailyfora
publishedmodel.
8. About that score:
Performance score calculations
AI Buildercalculatesthe performance score foryourmodel basedonthe precisionandrecall of the
predictionresults:
Performance score: Thisis the harmonicmeanof precisionandrecall.Itbalancesbothfor an
imbalancedclassdistribution.Performance score valuesare between0 - 100. Generally,the higherthe
performance score,the betteryourmodel performs.
Precision:The fractionof correct predictionsamongall the positive predictions.
Recall: The fractionof correct predictionsamongall true positive cases.
Exercise 2
We will make asmall model drivenapplicationtoview the data. Thisapproachallowsusa quicklookat
the data. You couldalsomake a canvasapp that allowsuserstointeractwiththe data froma mobile
device.
For thepurposesof this lab,we havetaken someshortcutsin the interest of time.
In general,you should alwaysbeworking in a specific solution,you should rename
items with smartnamesforbetter teamdevelopmentand more. A full lesson on
customization and solution strategy isbeyond thescopeof theselabs. However,
Microsofthasmany learning choicesavailable. Please askyourinstructorif you’d
like moreinformation.
1. In yourPowerAppsmakerportal,fromthe leftside navigation,navigatetoAppsandselectCreate
an app and selectModel-driven.
9. 2. If this isyourfirsttime connectingtoa canvas app inthisenvironment,youmightbe promptedto
choose yourregion. Selectthe default.
3. Give yourapp a name,remembertoinclude yourownname aspart of it. Leave all otheroptionsas
theyare andclick Done.
4. You shouldsee somethinglikethe image below.
10. 5. We will nowaddouronline shopperintention entitytothe site map. Clickthe editicononthe Site
Map.
6. Withfocus seton the Areagive the area a name such as Online ShopperIntentions. Selectand
name the Group as well.
11. 7. Withthe NewSubareaselected selectType of EntityandOnline ShopperIntentionasthe entity.
Leave otherfieldsasdefaults.
8. Save your Site Map and go backto the AppDesigner.
9. You shouldnowsee the assetsneededforthe OnlineShopperIntentionentityare includedinour
model-drivenapp.
10. Let’sadd a viewtoour app so we can bettersee the predictiondata. ClickonViewsandthenCreate
New.
12. 11. If promptedwithunsavedchanges,youcandismiss byclickingOK (assumingyou’ve followedour
stepsso far!).
12. ClickColumnAttributesPrimaryEntity.
13. Drag and drop the followingfieldstothe view: revenue-predicted(modelname);revenue-
probability(modelname);andrevenue.
Note:You will see fields added forthemodelsof all of thestudentsworking in the same
environment,lookfortheoneswith yourmodelnamein thefield name.
13. 14. Adjustcolumnwidthstomake themwiderandeasiertoview. With the columnselected,increase
the widthusingthe optionsonthe rightside of the view designer.
15. Save your view,remembertoinclude yourname aspart of the view name.
14. 16. Returnto AppDesigner. Save yourappand publishit.
17. Playyour app.
18. You shouldnowbe inyour newmodel-drivenapp. Selectthe view youjustcreated.
15. 19. Viewthe data. You can see the predictionscore,andthe predictionthatfollows. Withthis
informationyoucancreate automationsuchas a flow that wouldtrigger basedona customer’s
expectedrevenueandsenddiscountemailstocustomerslikelytocompleteapurchase. Creating
such automationisbeyondthe scope of thisworkshop.