1 00:00:00,750 --> 00:00:01,950 What's gone on everyone. 2 00:00:01,950 --> 00:00:08,280 Future Dan here once again and I realized going through the introduction to psychic Loan Section that 3 00:00:08,310 --> 00:00:10,680 there's a lot of warnings that come up. 4 00:00:10,830 --> 00:00:15,720 More specifically let me show you what actually goes on so if we go here we'll instantiate a random 5 00:00:15,720 --> 00:00:17,710 forest classifier CSF. 6 00:00:17,720 --> 00:00:21,810 Now if you don't understand what's going on just yet don't worry this is all covered in the psychic 7 00:00:21,810 --> 00:00:22,770 loan section. 8 00:00:22,890 --> 00:00:27,390 But I thought I'd just show you what actually happens and different ways that we can fix it. 9 00:00:27,420 --> 00:00:32,100 So when these things come up in your own work you might have a way of approaching them. 10 00:00:32,160 --> 00:00:37,680 So if I just shift on enter on this cell shift and enter in this cell and then shift and enter on this 11 00:00:37,680 --> 00:00:41,870 cell you see I get this warning pop up. 12 00:00:41,930 --> 00:00:47,990 So the reason why this warning pops up is because it's telling me the default value of an estimate is 13 00:00:48,290 --> 00:00:57,770 will change from ten inversion zero point to 0 to 100 and zero point to two and now an estimate is is 14 00:00:57,770 --> 00:01:01,090 a parameter in random forest classifier. 15 00:01:01,110 --> 00:01:07,780 So if we go here this is one way to fix it if I set this to 100 because the default is 10. 16 00:01:08,100 --> 00:01:08,550 Right. 17 00:01:08,550 --> 00:01:09,690 That's the default. 18 00:01:09,690 --> 00:01:11,110 I set this to 100. 19 00:01:11,250 --> 00:01:15,410 This little warning this red warning will go away. 20 00:01:15,430 --> 00:01:16,060 There we go. 21 00:01:16,060 --> 00:01:16,990 That goes away. 22 00:01:17,590 --> 00:01:24,360 But if I set that back to what it was the default so passing nothing and then I run it again. 23 00:01:24,360 --> 00:01:25,880 The warnings are going to come back. 24 00:01:25,890 --> 00:01:27,720 Now there's one way to fix this pretty quickly. 25 00:01:27,840 --> 00:01:32,140 It's to do what the warning says we just saying that the other way is if we come here. 26 00:01:32,220 --> 00:01:38,060 Now this goes for all warning so a.k.a. anything that you see in red in Jupiter notebook output. 27 00:01:38,190 --> 00:01:42,390 This is one way to solve all of them will not solve all of them but you will see it happen. 28 00:01:42,410 --> 00:01:50,070 So import warnings so we'll import the python warnings module and then we go warnings dot filter warnings 29 00:01:52,650 --> 00:01:55,420 what we need to pass it some sort of variable. 30 00:01:55,420 --> 00:01:58,310 Now there's one we can do here which is ignore. 31 00:01:58,330 --> 00:02:02,460 So essentially what this is going to do is ignore all of the warnings that appear. 32 00:02:02,560 --> 00:02:05,120 So there's a warning like this red thing's going to just ignore it. 33 00:02:05,140 --> 00:02:11,920 So it won't appear in our Jupiter no book ready gone but that's kind of a Band-Aid solution right. 34 00:02:11,910 --> 00:02:17,190 Like if we're just ignoring the warnings what if the warning was actually telling us something significant 35 00:02:17,670 --> 00:02:22,200 the reason where you use ignore is if you'd been through your notebook if you're doing your work and 36 00:02:22,200 --> 00:02:27,030 you figured okay these warnings aren't very helpful because I know what I'm doing works and I don't 37 00:02:27,030 --> 00:02:27,960 need these warnings. 38 00:02:27,960 --> 00:02:32,900 So that's where you might use warnings not filter warnings and ignore them all. 39 00:02:33,060 --> 00:02:38,590 If you want to reset this you can set it back to default shift and into shift and enter. 40 00:02:39,420 --> 00:02:41,380 Now we'll get the warning back. 41 00:02:41,410 --> 00:02:47,850 So if we read here the default value of an estimate is will change from 10 inversion zero point 2 0 42 00:02:48,030 --> 00:02:51,080 to 100 inversion zero point to two. 43 00:02:51,090 --> 00:02:58,980 So what this is saying is that if we go here we follow this follow this path it goes S.K. loan ensemble 44 00:02:59,370 --> 00:03:02,250 forest stop pi future warning. 45 00:03:02,250 --> 00:03:09,600 So this means from S.K. lone ensemble import random forest classifier which is here S.K. lone ensemble 46 00:03:09,990 --> 00:03:12,000 Random Forests or forest pine. 47 00:03:12,030 --> 00:03:15,750 That's where they write random forest classifier in that python module. 48 00:03:15,810 --> 00:03:18,990 And now this will be different depending on what warning you're getting right. 49 00:03:19,080 --> 00:03:24,080 We're getting this specific warning because we're dealing with random forest classifier. 50 00:03:24,450 --> 00:03:29,070 And again if this looks confusing I understand it might be at this time. 51 00:03:29,160 --> 00:03:33,930 But when you go through the introduction of psychic loan section you'll see these warnings come up. 52 00:03:34,020 --> 00:03:37,950 What we're sort of going through here now goes for any type of warning. 53 00:03:37,990 --> 00:03:41,920 So you can follow the path here and or output some kind of warning. 54 00:03:41,940 --> 00:03:44,700 These are all ways that you can approach it to fix it. 55 00:03:44,730 --> 00:03:53,240 So what if if we check our psychic learn version so import SBA loan and then we go SBA loan dot get 56 00:03:53,250 --> 00:03:53,850 version 57 00:03:56,580 --> 00:03:59,710 has no name. 58 00:03:59,920 --> 00:04:07,820 So if we get here how to tell what version of socket loan you're running should be something like get 59 00:04:07,820 --> 00:04:08,270 version 60 00:04:10,770 --> 00:04:17,520 installing socket learn check the socket loan documentation Mac OS conduct. 61 00:04:17,670 --> 00:04:19,370 So that's me here. 62 00:04:19,370 --> 00:04:26,570 So like it loan or show versions I'm seeing what version of psychic loan I have so if you guys show 63 00:04:27,170 --> 00:04:33,950 versions wonderful so if we go through it Python dependencies. 64 00:04:34,150 --> 00:04:36,900 So we're running Python three point seventy five. 65 00:04:36,910 --> 00:04:37,710 Yep. 66 00:04:37,840 --> 00:04:46,080 And we have SBA loan version zero point two one point three and so where this error is arising where 67 00:04:46,080 --> 00:04:53,290 this warning is coming from is because inversion zero point two up to zero point to two of psychic loan. 68 00:04:53,520 --> 00:04:55,070 It's going to raise this warning. 69 00:04:55,110 --> 00:05:01,050 So in zero point two two of psychic loans a version zero point to two above our version. 70 00:05:01,050 --> 00:05:07,680 This warning will go away because the default number of an estimate is for random forest classifier 71 00:05:08,340 --> 00:05:09,610 will be 100. 72 00:05:09,660 --> 00:05:16,490 So how would we upgrade our version of psychic loan and thus get rid of the warning. 73 00:05:16,520 --> 00:05:17,110 Mm hmm. 74 00:05:18,270 --> 00:05:23,640 So we've seen how to create a condo environment but how would we upgrade a package that's in our condo 75 00:05:23,640 --> 00:05:24,210 environment. 76 00:05:24,930 --> 00:05:26,540 Well let's go back to terminal. 77 00:05:26,610 --> 00:05:31,810 So see here we've got our notebook server running going to open up a new terminal window. 78 00:05:31,980 --> 00:05:36,940 What I'm going to do is I'm going to change directory so actually see a current project. 79 00:05:36,960 --> 00:05:41,400 So a middle course sample project. 80 00:05:41,460 --> 00:05:42,120 Wonderful. 81 00:05:42,120 --> 00:05:46,620 And if I ls there I can see all of the notebooks that I've been working on. 82 00:05:46,650 --> 00:05:47,700 Wonderful. 83 00:05:47,700 --> 00:05:49,320 And there's my environment folder there. 84 00:05:49,320 --> 00:05:53,850 So what I'm going to do is because I want to upgrade something within the content environment I'm going 85 00:05:53,850 --> 00:05:59,100 to activate com to activate and it's gonna be uses for me. 86 00:05:59,100 --> 00:06:11,070 Slash Daniel slash desktop slash MLK course slash sample project slash and uniform. 87 00:06:11,070 --> 00:06:15,720 So now we've activated our environment we've seen this done before so if going on the list that's gonna 88 00:06:15,740 --> 00:06:22,610 show me all the packages I currently have psychic learn version zero point two one point three. 89 00:06:22,610 --> 00:06:26,550 Now how would I get that if we come back to the notebook. 90 00:06:26,630 --> 00:06:32,840 How would I get that to version zero point two to so what we might do is check out the of documentation 91 00:06:33,680 --> 00:06:43,800 condo package management guy here managing packages beautiful so this is the condo documentation for 92 00:06:43,800 --> 00:06:49,170 how we might manage our packages in our environment which is what we want to do in this case we want 93 00:06:49,170 --> 00:06:54,240 to see if we can upgrade socket learn and again this will go for any package that you run in this case 94 00:06:54,240 --> 00:07:01,100 specific case we're just using psychic loan as an example so here's some documentation for managing 95 00:07:01,100 --> 00:07:06,710 packages there's a fair bit here what we might do is go straight down to updating packages beautiful 96 00:07:07,430 --> 00:07:12,920 so if we read the documentation now this is again one of the first steps you might take is if you're 97 00:07:12,920 --> 00:07:19,210 facing a problem like this you might search something like this future warning Google search that and 98 00:07:19,220 --> 00:07:23,210 it might tell you something like you might need to upgrade your package and this is where you might 99 00:07:23,210 --> 00:07:29,270 come after that is that you'd go to the con documentation these are all workflow steps that in the beginning 100 00:07:29,360 --> 00:07:34,400 they seem like a lot and they seem like wall there's so much going on here but as you sort of practice 101 00:07:34,400 --> 00:07:40,530 and practice and practice you get really good at searching for the answers for yourself so to upgrade 102 00:07:40,610 --> 00:07:46,790 a specific package kinda update by a python so maybe we just try that in our case we want to upgrade 103 00:07:47,200 --> 00:07:55,100 socket learn so if we come back so if we go condo update sidekick learn and see what happens 104 00:07:58,430 --> 00:08:04,890 let this run its thing Okay so we'll expand this window so we get everything on the same lines that's 105 00:08:04,890 --> 00:08:11,830 gonna be added slash updated specs socket learn the following packages will be updated it doesn't list 106 00:08:11,840 --> 00:08:18,020 socket learn there that's interesting but let's run that with a Y and see what happens 107 00:08:22,670 --> 00:08:28,040 okay now if we go condo info know we can just go conduct list. 108 00:08:28,040 --> 00:08:32,060 And if you want to see the specific information about one package you can just write its name. 109 00:08:32,110 --> 00:08:34,430 We want to find out about psychic loan. 110 00:08:34,480 --> 00:08:38,690 We're still running version zero point two one point three. 111 00:08:39,080 --> 00:08:40,360 Mm hmm. 112 00:08:40,400 --> 00:08:41,710 Now what could we do with that. 113 00:08:42,190 --> 00:08:44,200 Well we're looking here. 114 00:08:44,310 --> 00:08:49,390 If we wanted to find more information about what psychic loan packages are available from condo we might 115 00:08:49,390 --> 00:08:51,130 go condo. 116 00:08:51,160 --> 00:08:56,560 And the reason why I know what to look for is because I've had practice with this but you might need 117 00:08:56,560 --> 00:08:58,780 to do a little bit more searching if you're not aware of this. 118 00:08:58,810 --> 00:09:00,250 But I'll just tell you in this case. 119 00:09:01,000 --> 00:09:08,470 So if we go searching for packages to see if a specific package such as PSI pi is available for installation 120 00:09:08,860 --> 00:09:09,770 run this. 121 00:09:09,940 --> 00:09:17,260 Okay to conduct search Cypress what we might do is go conduct a search psychic line and what this will 122 00:09:17,260 --> 00:09:23,770 show us the condo search function is what versions of psychic loan are available from condo because 123 00:09:23,770 --> 00:09:30,550 what are we after we come back to our notebook we're after version zero point two two let's figure out 124 00:09:30,550 --> 00:09:34,890 how to get that wall. 125 00:09:35,010 --> 00:09:35,480 Okay. 126 00:09:35,520 --> 00:09:42,390 So we've got a whole bunch what we might do is there's a better way of finding this severe condensed 127 00:09:42,470 --> 00:09:44,040 search psychic line. 128 00:09:44,040 --> 00:09:51,020 We want some info about that so we can pass it the info tag conduct search psychic line dash dash info 129 00:09:52,110 --> 00:09:58,070 diesel output the same thing but with a bit more information so we can see here it's printed out psychic 130 00:09:58,100 --> 00:10:01,520 learn version zero point to two and that's the one we're after. 131 00:10:01,520 --> 00:10:05,660 So what it's going to tell us here is a different dependency. 132 00:10:05,660 --> 00:10:10,240 So what this version of psychic learn relies on. 133 00:10:10,720 --> 00:10:18,260 So unless our environment has these packages we won't be able to install zero point to two. 134 00:10:18,430 --> 00:10:22,870 And in my case I've figured out that my python version. 135 00:10:22,870 --> 00:10:26,920 So see here what this is saying is that you need to have the python version greater than three point 136 00:10:26,920 --> 00:10:29,440 six but less than three point seven. 137 00:10:29,440 --> 00:10:37,510 So if I check my current environment and I go conduct the list python I can see my version of Python 138 00:10:37,950 --> 00:10:41,690 is three point seven point five. 139 00:10:42,000 --> 00:10:42,630 Okay. 140 00:10:42,850 --> 00:10:49,420 So that is the reason why when I install psychic learn using Conda I don't get version zero point to 141 00:10:49,420 --> 00:10:57,280 two because I'm using a version of Python that is incompatible with this version of psychic learn does 142 00:10:57,410 --> 00:10:58,760 that make sense. 143 00:10:58,760 --> 00:11:06,050 So when you're setting up an environment the way Conda works is it kind of makes sure behind the scenes 144 00:11:06,230 --> 00:11:12,680 all of the packages and dependencies all of these tools that you install work well with each other. 145 00:11:12,740 --> 00:11:19,610 So it's really saving us here by not letting us install psychic learn zero point to two because the 146 00:11:19,610 --> 00:11:25,400 developers of psychic line of upload it to Anaconda and said hey these versions here between these two 147 00:11:25,400 --> 00:11:31,610 numbers are the only versions that will work fully and properly with this version of cyclone. 148 00:11:32,180 --> 00:11:41,180 So one way we can do this is to uninstall some of the dependencies that cyclone relies on and then reinstall 149 00:11:41,180 --> 00:11:44,000 them with specific version numbers. 150 00:11:44,000 --> 00:11:47,120 That's a fair bit of talking there but let's see it in action. 151 00:11:47,120 --> 00:11:48,020 So that's what we're going to do. 152 00:11:48,020 --> 00:11:51,910 We're going to uninstall some of the things that cyclone depends on. 153 00:11:51,920 --> 00:12:00,040 So like none py in Python and then reinstall them with specific version numbers so conduct uninstall 154 00:12:00,040 --> 00:12:05,080 to uninstall the package we go conduct uninstall and then the package name so we're gonna uninstall 155 00:12:05,080 --> 00:12:09,070 site get learn and then we're going to uninstall python. 156 00:12:09,070 --> 00:12:11,560 And that should actually be enough. 157 00:12:11,590 --> 00:12:15,540 So Honda and install socket learn uninstall python. 158 00:12:15,550 --> 00:12:22,260 Let's see what happens when we do that. 159 00:12:22,470 --> 00:12:22,890 Yes 160 00:12:26,110 --> 00:12:27,190 wonderful. 161 00:12:27,190 --> 00:12:30,990 So what that's done is it's we can read up here. 162 00:12:31,090 --> 00:12:36,280 So the following packages will be removed a fair few because we've removed python and cyclone at the 163 00:12:36,280 --> 00:12:37,100 same time. 164 00:12:37,240 --> 00:12:44,110 So panders gets removed Nan pi gets removed because as I said Conda will behind the scenes make sure 165 00:12:44,110 --> 00:12:47,140 that your dependencies all work with each other. 166 00:12:47,140 --> 00:12:52,930 So if we remove Python we don't have access to num PI because num pi requires Python even though we 167 00:12:52,930 --> 00:12:59,780 didn't type in conduct uninstall num pi it gets removed because what it depends on got removed. 168 00:13:00,340 --> 00:13:08,600 So now we go back to our notebook and we try to run our import functions they still work because our 169 00:13:08,600 --> 00:13:12,720 kernel is still active but if we were to go here restart. 170 00:13:13,040 --> 00:13:18,840 So basically just restarting our notebook from scratch and if we would hit shift enter here we're gonna 171 00:13:18,860 --> 00:13:25,840 get some errors because our current active environment we've just uninstalled all of these num pi Pande 172 00:13:25,880 --> 00:13:31,250 is mapped plot lib etc et cetera so here we're getting a kernel error. 173 00:13:31,520 --> 00:13:35,690 So what we'll do is we'll come back here and we'll go conduct install. 174 00:13:35,750 --> 00:13:38,320 Now we want a specific version of Python. 175 00:13:38,720 --> 00:13:43,550 We want to go condo install Python 3.0 six point nine. 176 00:13:43,820 --> 00:13:44,520 Wonderful. 177 00:13:44,570 --> 00:13:49,880 And we want sidekick loan version zero point two 2. 178 00:13:50,090 --> 00:13:58,310 And we want to reinstall that plot lib num pine pandas as well as Jupiter because a lot of different 179 00:13:58,310 --> 00:14:00,030 packages got removed here. 180 00:14:00,170 --> 00:14:04,850 So essentially we're rebuilding our environment with specific versions of packages that we want 181 00:14:08,520 --> 00:14:10,430 so we're gonna hit yes. 182 00:14:10,560 --> 00:14:14,840 And again this may take a little while while the environment Condor installs these packages so we'll 183 00:14:14,910 --> 00:14:16,710 fast for the video until this is done 184 00:14:20,140 --> 00:14:20,980 wonderful. 185 00:14:21,160 --> 00:14:24,880 So that's reinstalled certain packages with certain values. 186 00:14:24,880 --> 00:14:31,330 So now what we'll do is if we go conduct list psychic learn we'll check the version that we have not 187 00:14:32,260 --> 00:14:39,230 even made a typo and kinda smart enough to realize what I was after beautiful so now because we've passed 188 00:14:39,230 --> 00:14:46,070 the version number that we wanted to install by setting cyclone equal to zero point two to Conda has 189 00:14:46,070 --> 00:14:48,470 installed version point to two for us. 190 00:14:48,590 --> 00:14:55,650 But the reason it did that was because we also did the same thing for python. 191 00:14:55,810 --> 00:15:01,840 Now we installed a version of Python in our environment 3.0 six point nine that was compatible with 192 00:15:01,840 --> 00:15:03,980 version zero point to two. 193 00:15:04,150 --> 00:15:06,720 And so the way to check this we can come back to our notebook. 194 00:15:06,910 --> 00:15:11,700 We'll see if we restart our kernel. 195 00:15:11,850 --> 00:15:17,580 We may have to reactivate our Jupiter notebook server because we've reset all the parameters for actually 196 00:15:17,580 --> 00:15:22,440 we might know we might get away with this so if we try to import all the standard inputs here might 197 00:15:22,440 --> 00:15:26,810 take a little while because we've uninstalled them and reinstall them beautiful. 198 00:15:26,880 --> 00:15:30,780 So that took about a minute or so because we just reinstalled all of these packages. 199 00:15:30,780 --> 00:15:34,770 So when you're first importing them into a given notebook it would take a little while. 200 00:15:34,800 --> 00:15:38,760 So then if we run these cells for now don't worry too much if you don't know what's going on we're gonna 201 00:15:38,760 --> 00:15:41,820 go through this in the entire cycle loan section. 202 00:15:41,820 --> 00:15:47,340 We don't want to filter any warnings so we'll comment that out we want to import. 203 00:15:47,340 --> 00:15:53,460 Remember we ran this cell before and this one again and we don't need to run this cell anymore so we'll 204 00:15:53,460 --> 00:15:55,750 escape that and press x to remove it. 205 00:15:55,890 --> 00:16:03,510 And now this is saved from before so previously when we ran this cell it produced a warning. 206 00:16:03,510 --> 00:16:10,140 But now since we've upgraded to version zero point two to cross our fingers that warning shouldn't be 207 00:16:10,140 --> 00:16:12,560 there and we're kind of waiting for these cells here to run. 208 00:16:12,560 --> 00:16:13,090 So. 209 00:16:13,220 --> 00:16:14,400 So if we run this one 210 00:16:17,840 --> 00:16:23,560 this is going to import the random forest classifier or we've set an estimate is equal to one hundreds 211 00:16:23,560 --> 00:16:27,130 and might have to delete that okay. 212 00:16:27,170 --> 00:16:31,490 So we're gonna rerun these three cells as you can see the warning is not there but we did run this one 213 00:16:31,490 --> 00:16:33,230 with an estimate is equal to 100. 214 00:16:33,860 --> 00:16:39,440 So if we run this past nothing there run this and now previously we would have got a warning if we ran 215 00:16:39,440 --> 00:16:48,090 this cell but we don't see because now we're using psychic lone version zero point to two if we hit 216 00:16:48,090 --> 00:16:55,670 shift tab on this we can see that an estimate is has changed to equal 100 it was a fairly in depth video 217 00:16:55,680 --> 00:17:01,830 there's a fair few steps there but the takeaways here to remember is that when you're experiencing warnings 218 00:17:01,860 --> 00:17:03,910 a couple of different ways you can deal with them. 219 00:17:03,960 --> 00:17:11,070 You can use the warnings package and you can either ignore them hitting that will ensure that there's 220 00:17:11,070 --> 00:17:15,630 no warnings that pop up when you run you do it a notebook sells but sometimes warnings can be helpful 221 00:17:15,630 --> 00:17:20,040 so maybe you want to reset it back to default and then the warnings will show up as they come in. 222 00:17:20,730 --> 00:17:25,470 And then if you figure out maybe you need to upgrade or change some of the dependencies the packages 223 00:17:25,470 --> 00:17:29,200 that you're using within conduct you can do that. 224 00:17:29,220 --> 00:17:33,050 So managing packages in the kind of documentation that's where you want to go next. 225 00:17:33,300 --> 00:17:40,020 And if you run condo update bio Python or cyclone in our case and it doesn't work it may be because 226 00:17:40,260 --> 00:17:45,900 some of the other packages the other tools that you're using and Conda are using different version numbers 227 00:17:46,230 --> 00:17:52,350 and we saw that in here before when we checked the version of Python that we were using and we had three 228 00:17:52,350 --> 00:17:58,540 point seven point something which was incompatible with version zero point to two of psychic learn. 229 00:17:59,070 --> 00:18:06,120 So the way to fix that was we did conduct uninstall and then packages. 230 00:18:06,120 --> 00:18:13,650 So whichever packages you wanted to remove and then to fix it we did conduct install package and then 231 00:18:13,650 --> 00:18:15,490 set it to a specific version number. 232 00:18:15,780 --> 00:18:21,690 So in our case it was psychic line and we wanted version zero point to two. 233 00:18:21,720 --> 00:18:24,210 So we set it to zero point to two. 234 00:18:24,240 --> 00:18:29,280 That's one of the workflows that you can use when you're running into dependency issues is first of 235 00:18:29,280 --> 00:18:31,380 all check the documentation. 236 00:18:31,380 --> 00:18:33,080 Try it out see if it works. 237 00:18:33,150 --> 00:18:39,850 And then second of all it's not working uninstall the package that's broken and reinstall it. 238 00:18:39,930 --> 00:18:44,910 So now once you go through the introduction a like it loan section if you come across warnings you know 239 00:18:45,000 --> 00:18:49,770 how they appear why they appears because something is going on you know how to filter them using the 240 00:18:49,770 --> 00:18:57,060 warnings module and you know how to upgrade and change different packages using conduct if need be.