Current location: Homepage > kotlin > Artificial Intelligence Full Course 2024 _ AI Tutorial For Beginners _ AI Full Course_ Intellipaat - Ep69

Artificial Intelligence Full Course 2024 _ AI Tutorial For Beginners _ AI Full Course_ Intellipaat - Ep69

2025-07-11 13:39:54 [java] Source: MetaScripta
that thereare 64 cross 64 pixels in this imageright 64 into 64 pixels and science vs conspiracyeach andevery pixel will have a specific valueis that is thatcorrect right now let's assume that Istart writing something right let's sayI go ahead and write the digit sevenover hereright if I go ahead and if I write thedigit seven now what will happen all theall these pixels right all the ones thatare colored in Black Will they have asimilar pixel value all these the thepixel value will be same right exactlythesame right and all the ones which arelet's say not black so let's say thatthe background is white now if thebackground is white so all the rest ofthe pixels will have the same same valueit it might be let's sayzerocorrect now similarly if I take theseven away and let's say I go ahead andI write an eight if I writean8 what will happen this time do youthink that the pixels which have blackvalue will be different as compared tothe ones which have uh which we had forseven or will they be the same maybesome of them some of them will be commonso if I write both a seven and an8 maybesome pixels will be common right sothese pixels will be common these willbe common these will be common but ifyou see for majority of seven and 8 theEXs aredifferentcorrect now if you see right if I goahead and if I convert thistwo-dimensional data into aone-dimensional matrix right so let'ssay this two-dimensional data I go aheadand I convert this into aone-dimensionalarray right so let's say this is thedata this is the data for eight let'sassumeso for eight it might happen that mypixels are varying like this right solet's say first every pixel is zero thenlet's say this is I'm I'm just giving avalue of zero and one right to make itsimple so let's say this is then onceagain zero then one oneone right something likethis right so let's say for eight thisis what I get but if I do the same thingfor sevenmaybe I get a differentpattern right maybe for seven Iget mostly starting will be zerosbecause it will be blank let's say thenthisright does this make sense guys do youthink this will happen the pattern willbe different right now for most of thesevens the pattern will be very similarand for most of the eights the patternwill be very similaris everyone able to understand now seethis is the idea on which we actuallytry to work when we are working withimages right now if I go ahead and if Igive the label over here for this eightand for this as seven do you think mymathematical models will be able toidentify this patterneasily see if for every eight thepattern is almost similar if for everyseven the pattern is almost similar yourmodel should be able to uh uh find thisoutright is everyone able to understandthis anyquestions all right so if you see thisnow if I show you this dataright so what we'll do is that thatwe'll first read this data now thismist. load data you can go ahead and youcan look at the definition as well ifyou do if you just press a controlcontrol and click on this right you cango to the definition this will onlyhappen in Google collab right this willnot happen in your uh Jupiter notebooksand all so you can see that this this isthe load data function right and here ifyou see this load data is actuallyreturning four data frames X train ytrain X test and Ytest uh I'm using Mac forit so for me itis uh Control Plus click you can trythis on your system as well right if youjust go and I I think if you presscontrol and click on the function itshould open the definitionright so if you see this function isreturning four data frames so what I'mdoing is that I I am actually collectingwhen I call this function I'm collectingthe values in four data frames in anexactly similar manner right and when Icollect this so let's start from thestartuh right I will runthis now this what you're seeing is thatmy data that I have it has 28 rows and28 columns the image data that I haveright it is 28 cross 28 pixels the totalnumber of classes that I have in thisdata is 10 that is the total number ofdigits are 0 to 9 which will be 10 batsize and epox you can leave for nowright uh this is for the model only butwe have declared it over here then Ihave called this function this datasummary in this function I'm justpassing all of my data and all it thisfunction is doing is that it is printingthe shape of your train and test it isprinting the labels that your train uhdata has right and now if I call thisright if you see I'm saving this data toX train y train X test and white testand then I call the data summaryfunction now you can see that this ishow the data is splitted your trainingdata contains 60,000 images and yourtesting data contains 10,000 images theshape of the training data you can seeis 60,000 cross 28 cross 28 why becausethere are 60,000 images each images eachimage has the size of 28 cross 28pixel rightyour labels that is your target variablewill have only 6,000 values because thethese are digits in the range of 0 to 9right similarly my testing data has10,000 samples and my testing label has10,000 right and the train and testlabels you can see that these areactually digits that the imagescorrespond to so my first training dataright is the image five my secondtraining data is the image zero this isonly digit images right konal this mesdata is only for digitsall right now as Next Step let's try toplot this data and let's try to first ofall plot and see whether the imageswhatever we are getting is correct ornot right so what I'll do is that I'mdefining a variable which will just takethe index of which image I want to printright so I take a

(Editor: python)

Recommended articles
Hot reading