Current location: Homepage > ai > Harvard CS50’s Artificial Intelligence with Python – Full University Course - Ep78

Harvard CS50’s Artificial Intelligence with Python – Full University Course - Ep78

2025-07-11 11:58:35 [article] Source: ByteGenius
younext time[Music]all right welcome back everyone to anintroduction to artificial intelligencewith python now so far in this classwe've used AI to solve a number ofdifferent problems giving the AIinstructions for how to search for asolution or intelligence vs consciousnesshow to satisfy certainconstraints in order to find its wayfrom some input point to some outputpoint in order to solve some sort ofproblem today we're going to turn to theworld of learning in particular the ideaof machine learning which generallyrefers to the idea where we are notgoing to give the computer explicitinstructions for how to perform a taskbut rather we are going to give thecomputer access to information in theform of data or patterns that it canlearn from and let the computer try andfigure out what those patterns are tryand understand that data to be able toperform a task on its own now machinelearning comes in a number of differentforms and it's a very wide field sotoday we'll explore some of thefoundational algorithms and ideas thatare behind a of the different areaswithin machine learning and one of themost popular is the idea of supervisedmachine learning or just supervisedlearning and supervised learning is aparticular type of task it refers to thetask where we give the computer accessto a data set where that data setconsists of input output Pairs and whatwe would like the computer to do is wewould like our AI to be able to figureout some function that Maps inputs tooutputs so we have a whole bunch of datathat generally consists of some kind ofinput some evidence of information thatthe computer will have access to and wewould like the computer based on thatinput information to predict what someoutput is going to be and we'll give itsome data so that the computer can trainits model on to begin to understand howit is this information works and how itis that the inputs and outputs relate toeach other but ultimately we hope thatour computer will be able to figure outsome function that given those inputs isable to get those outputs there are acouple of different tasks withinsupervised learning the one we'll focuson and start with is known asclassification and classification is theproblem where if I give you a wholebunch of inputs you need to figure outsome way to map those inputs intodiscrete categories where you can decidewhat those categories are and it's thejob of the computer to predict whatthose categories are going to be so thatmight be for example I give youinformation about a bank note like a USdollar and I'm asking you to predict forme does it belong to the category ofauthentic Bank notes or does it belongto the category of counterfeit Banknotes you need to categorize theand we want to train the computer tofigure out some function to be able todo thatcalculation another example might be thecase of weather something we've talkedabout a little bit so far in this classwhere we would like to predict on agiven day you know is it going to rainon that day is it going to be cloudy onthat day and before we've seen how wecould do this if we really give thecomputer all the exact probabilities foryou know if these are the conditionswhat's the probability of rain oftentimes we don't have access to thatinformation though but what we do haveaccess to is a whole bunch of data so ifwe wanted to be able to predictsomething like is it going to rain or isit not going to rain we would give thecomputer historical information aboutdays when it was raining and days whenit was not raining and ask the computerto look for patterns in that data sowhat might that data look like well wecould structure that data in a tablelike this this might be what our tablelooks like where for any particular daygoing back we have information aboutlike that day's humidity that day's airpressure and then importantly we have alabel something where the human has saidthat on this particular dayit was raining or it was not raining soyou could fill in this table with awhole bunch of data and what makes thiswhat we would call a supervised learningexcise is that a human has gone in andlabeled each of these data points saidthat on this day when these were thevalues for the humidity and pressurethat day was a rainy day and this daywas a not rainy day and what we wouldlike the computer to be able to do thenis to be able to figure out given theseinputs given like the humidity and thepressure can the computer predict whatlabel should be associated with that daydoes that day look more like it's goingto be a day that rains or does it lookmore like a day when it's not going torain put a little bit moremathematically you can think of this asa function that takes two inputs theinputs being the data points that ourcomputer will have access to things likehumidity and pressure so we could writea function f that takes as input bothhumidity and pressure and then theoutput is going to be what category wewould ascribe to these particular inputpoints what label we would associatewith that input so we've seen a coupleof examples data points here we giventhis value for humidity and this valuefor pressure we predict is it going torain or is it not going to rain andthat's information that we just gatheredfrom the world we measured on variousdifferent days what the humidity andpressure were we observed whether or notwe saw rain or no rain on thatparticular day and this function f iswhat we would like to approximate nowthe computer and we humans don't reallyknow exactly how this function f worksit's probably quite a complex functionso what we're going to do instead isattempt to estimatewe would like to come up with ahypothesis function H which is going totry to approximate what F does we wantto come up with some function H thatwill also take the same inputs and willalso produce an output rain or no rainand ideally we'd like these twofunctions to agree as much as possibleso the goal then of these supervisedlearning classification

(Editor: web3)

Recommended articles
Hot reading