‫What's going on, everyone?
‫Future Dan here once again.
‫And I realized going through the introduction to Psychic Loan section that there's a lot of warnings
‫that come up.
‫More specifically, let me show you what actually goes on.
‫So if we go here, we'll instantiate a random forest classifier.
‫Now, if you don't understand what's going on just yet, don't worry.
‫This is all covered in the psychic loan section.
‫But I thought I'd just show you what actually happens and different ways that we can fix it.
‫So when these things come up in your own work, you might have a way of approaching them.
‫So if I just shift on, enter on this cell shift and enter on this cell and then shift and enter on
‫this cell.
‫You see, I get this warning pop up.
‫So the reason why this warning pops up is because it's telling me the default value of an estimate is
‫will change from ten inversion, 0.20 to 100 and 0.22.
‫And now an estimate is is a parameter in random forest classifier.
‫So if we go here, this is one way to fix it.
‫If I set this to 100 because the default is ten, right?
‫That's the default.
‫I set this to 100.
‫This little warning, this red warning will go away.
‫There we go.
‫That goes away.
‫But if I set that back to what it was, the default.
‫So passing nothing.
‫And then I run it again.
‫The warning is going to come back.
‫Now, there's one way to fix this pretty quickly.
‫It's to do what the warning says.
‫We've just seen that the other way is if we come here now, this goes for all warning.
‫So aka anything that you see in red in Jupyter Notebook output, this is one way to solve all of them
‫or not solve all of them.
‫But you will see it happen.
‫So import warning.
‫So we'll import the python warnings module and then we go warnings.
‫Dot filter warnings.
‫We need to pass it some sort of variable.
‫Now, there's one we can do here, which is ignore.
‫So essentially what this is going to do is ignore all of the warnings that appear.
‫So if there's a warning like this red thing, it's going to just ignore it so it won't appear in our
‫Jupyter Notebook.
‫Ready?
‫Gone.
‫But that's kind of a Band-Aid solution, right?
‫Like if we're just ignoring the warnings, what if the warning was actually telling us something significant?
‫The reason why you use ignore is if you'd been through your notebook, if you're doing your work and
‫you figured, okay, these warnings aren't very helpful because I know what I'm doing works and I don't
‫need these warnings.
‫So that's where you might use warnings, not filter warnings and ignore them all.
‫If you want to reset this, you can set it back to default.
‫Shift and enter.
‫Now we'll get the warning back.
‫And so if we read here, the default value of an estimate is will change from ten in version 0.20 to
‫100 in version 0.22.
‫So what this is saying is that if we go here, we follow this follow this path, it goes cyclone ensemble,
‫forest, dot pie, future warning.
‫So this means from src learn ensemble import random forest classifier which is here cyclone ensemble,
‫random forests or forest dot pie.
‫That's where they write random forest classifier in that Python module.
‫And now this will be different depending on what warning you're getting.
‫Right?
‫We're getting this specific warning because we're dealing with random forest classifier.
‫And again, if this looks confusing, I understand it might be at this time, but when you go through
‫the introduction of cyclone section, you'll see these warnings come up.
‫What we're sort of going through here now goes for any type of warning so you can follow the path here
‫and it'll output some kind of warning.
‫These are all ways that you can approach it to fix it.
‫So what if if we check our cyclone version, so import cyclone and then we go cyclone, dot, get version.
‫Has no.
‫So if we go here, how to tell what version of socket loan you're running should be something like get
‫version.
‫Installing socket learn.
‫We check the socket loan documentation mac os conda.
‫So that's me here.
‫So I can learn or show versions.
‫I'm seeing what version of psychic loan I have.
‫So if you go show versions.
‫Wonderful.
‫So if we go through it, python dependencies.
‫So we're running python 3.75.
‫Yep.
‫And we have scaled down version 0.21.3.
‫And so.
‫Where this error is arising, where this warning is coming from is because inversion 0.2 up to 0.22
‫of cyclone.
‫It's going to raise this warning.
‫So in 0.22 of cyclone.
‫So version 0.22 above our version.
‫This warning will go away because the default number of estimates for random forest classifier will
‫be 100.
‫So how would we upgrade our version of cyclone and thus get rid of the warning?
‫Hmm.
‫So we've seen how to create a kinder environment, but how would we upgrade a package that's in our
‫kinder environment?
‫Well, let's go back to terminal.
‫So see here, we've got our notebook server running.
‫Going to open up a new terminal window.
‫What I'm going to do is I'm going to change directory.
‫So actually seed current project.
‫So my course sample project.
‫Wonderful.
‫And files there.
‫I can see all of the notebooks that I've been working on.
‫Wonderful.
‫And there's my environment folder there.
‫So what I'm going to do is because I want to upgrade something within the condo environment, I'm going
‫to activate Condor activate and it's going to be users for me.
‫Slash Daniel slash desktop.
‫Slash ML Course slash sample project slash env.
‫The uniform.
‫So now we've activated our environment.
‫We've seen this done before.
‫So if I go on the list, that's going to show me all the packages I currently have so I can't learn.
‫Version 0.21.3.
‫Now, how would I get that if we come back to The Notebook, how would I get that to version 0.22?
‫So what we might do is check out the kind of documentation conda package management.
‫Go here.
‫Managing package is beautiful.
‫So this is the kind of documentation for how we might manage our packages in our environment, which
‫is what we want to do in this case.
‫We want to see if we can upgrade, socket, learn and again, this will go for any package that you
‫run.
‫In this case specific case, we're just using psychic learn as an example.
‫So here's some documentation for managing packages is a fair bit here.
‫What we might do is go straight down to updating packages.
‫Beautiful.
‫So if we read the documentation now, this is again one of the first steps you might take is if you're
‫facing a problem like this, you might search something like this, future warning, Google search that.
‫And it might tell you something like you might need to upgrade your package and this is where you might
‫come after that is that you go to the code documentation.
‫These are all workflow steps that in the beginning they seem like a lot and they seem like, Whoa,
‫there's so much going on here.
‫But as you sort of practice and practice and practice, you get really good at searching for the answers
‫for yourself.
‫So to upgrade a specific package.
‫Conda update by Python.
‫So maybe we just try that.
‫In our case we want to upgrade socket loan.
‫So if we come back so if we go conda update socket loan and see what happens.
‫We'll let this run its thing.
‫Okay, so we'll expand this window so we get everything on the same line.
‫So it's going to be added slash updated specs so I could learn the following packages will be updated.
‫It doesn't list like it there.
‫Hmm.
‫That's interesting.
‫But let's run that with a y and see what happens.
‫Okay now if we go conda info I know we can just go contact list and if you want to see this specific
‫information about one package, you can just write its name.
‫We want to find out about cyclone.
‫We're still running version 0.21.3.
‫Hmm.
‫Now, what can we do with that?
‫Well, if we look in here, if we wanted to find more information about what cyclone packages are available
‫from Conda, we might go.
‫Conda And the reason why I know what to look for is because I've had practice with this.
‫But you might need to do a little bit more searching if you're not aware of this, but I'll just tell
‫you in this case.
‫So if we go searching for packages to see if a specific package such as Sai PY is available for installation,
‫run this.
‫Okay.
‫So Conda search side.
‫So what we might do is go conda search cyclone and what this will show us.
‫The Conda search function is what versions of cyclone are available from Conda.
‫Because what are we after?
‫We come back to our notebook, we're after version 0.22.
‫Let's figure out how to get that.
‫Whoa.
‫Okay, so we've got a whole bunch.
‫What we might do is there's a better way of finding this or if we go on to search psychic loan, we
‫want some info about that so we can pass it the info.
‫Tag Conduct.
‫Search Psychic Loan dash.
‫Dash info.
‫This will output the same thing, but with a bit more information.
‫So we can see here it's printed out Psychic Learn version 0.22 and that's the one we're after.
‫So what it's going to tell us here is a different dependency.
‫So what this version of psychic learn.
‫Relies on.
‫So unless our environment has these packages, we won't be able to install 0.22.
‫And in my case, I've figured out that my Python version.
‫So see here, what this is saying is you need to have a Python version greater than 3.6, but less than
‫3.7.
‫So if I check my current environment and I go on the list python.
‫I can see my version of Python is 3.7.5.
‫Hmm.
‫Okay.
‫So that is the reason why when I install cyclone using conda, i don't get version 0.22 because I'm
‫using a version of python that is incompatible with this version of cyclone.
‫Does that make sense?
‫So when you're setting up an environment, the way Conda works is it kind of makes sure behind the scenes,
‫all of the packages and dependencies, all of these tools that you install, work well with each other.
‫So it's really saving us here by not letting us install socket learn 0.22 because the developers of
‫Psychic Loan have uploaded it to Anaconda and said, Hey, these versions here between these two numbers
‫are the only versions that will work fully and properly with this version of Psychic Loan.
‫So one way we can do this is to uninstall some of the dependencies that psychic learn relies on and
‫then reinstall them with specific version numbers.
‫That's a fair bit of talking there, but let's see it in action.
‫So that's what we're going to do.
‫We're going to uninstall some of the things that psychic learn depends on.
‫So like NumPy and Python and then reinstall them with specific version numbers.
‫So Conda uninstall to uninstall a package, we go conduct, uninstall and then the package name.
‫So we're going to uninstall Cyclone and then we're going to uninstall Python and that should actually
‫be enough.
‫So Honda uninstall sidekick, learn uninstall Python.
‫Let's see what happens when we do that.
‫Yes.
‫Wonderful.
‫So what that's done is it's we can read up here so the following packages will be removed.
‫A fair few because we've removed python and cyclone at the same time.
‫So pandas gets removed, numpy umpire gets removed because as I said, Conda will behind the scenes
‫make sure that your dependencies all work with each other.
‫So if we remove python, we don't have access to numpy because numpy requires python.
‫Even though we didn't type in conda uninstall numpy, it gets removed because what it depends on got
‫removed.
‫So now we go back to our notebook and we try to run our import functions.
‫They still work because our kernel is still active.
‫But if we were to go here restart.
‫So basically just restarting our notebook from scratch.
‫And if we were to hit shift enter here, we're going to get some errors because our current active environment,
‫we've just uninstalled all of these numpy pandas, map, plot, lib, etc., etc..
‫So here we're getting a kernel error.
‫So what we'll do is we'll come back here and we'll go conda install.
‫Now we want a specific version of python.
‫We want to go conda install python 3.6.9.
‫Wonderful.
‫And we want psychic learn.
‫Version 0.22 and we want to re-install map plot lib numpy and pandas as well as Jupyter because a lot
‫of different packages got removed here.
‫So essentially we're rebuilding our environment with specific versions of packages that we want.
‫So we're going to hit.
‫Yes.
‫And again, this may take a little while while the environment condor installs these packages.
‫So it will fast for the video until this is done.
‫Wonderful.
‫So that's reinstalled certain packages with certain values.
‫So now what we'll do is if we go Condor List Psychic Learn, we'll check the version that we have.
‫Oh, even made a typo and kind of smart enough to realize what I was after.
‫Beautiful.
‫So now, because we've passed the version number that we wanted to install by setting psychic loan equal
‫to 0.22, Conda has installed version 0.22 for us, but the reason it did that was because we also did
‫the same thing for Python.
‫Now we installed a version of Python in our environment, 3.6.9 that was compatible with version 0.22.
‫And so the way to check this, we could come back to our notebook.
‫We'll see if we restart our kernel.
‫We may have to reactivate our Jupyter Notebook server because we've reset all the parameters, but actually
‫we might not.
‫We might get away with this.
‫So if we try to import all the standard inputs here might take a little while because we've uninstalled
‫them and reinstall them.
‫Beautiful.
‫So that took about a minute or so because we'd just reinstalled all of these packages.
‫So when you're first importing them into a Jupyter notebook, it'll take a little while.
‫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 going to go through this in the entire psychic loan section.
‫We don't want to filter any warnings, so we'll comment that out.
‫We want to import remember, we ran this cell before and this one again and we don't need to run this
‫cell anymore.
‫So we'll escape that and press X to remove it.
‫And now this is saved from before.
‫So previously when we ran this cell, it produced a warning.
‫But now since we've upgraded to version 0.22, we cross our fingers that warnings shouldn't be there.
‫And we're kind of waiting for these cells here to run.
‫So.
‫So if we run this one.
‫This is going to import the random forest classifier or we've set an estimate is equal to 100.
‫So we might have to delete that.
‫Okay.
‫So we're going to rerun these three cells.
‫As you can see, the warning is not there.
‫But we did run this one with an estimate is equal to 100.
‫So if we run this, you've passed nothing there, run this.
‫And now previously we would have got a warning if we ran this cell.
‫But we don't see because now we're using psychic learn version 0.22.
‫If we hit shift tab on this, we can see that in estimators has changed to equal 100.
‫That was a fairly in-depth video.
‫There was a fair few steps there.
‫But the takeaway is here to remember is that when you're experiencing warnings is a couple of different
‫ways you can deal with them.
‫You can use the warnings package and you can either ignore them hitting.
‫That will ensure that there's no warnings that pop up when you run your Jupyter Notebook cells.
‫But sometimes warnings can be helpful, so maybe you want to reset it back to default and then the warnings
‫will show up as they come in.
‫And then if you figure out maybe you need to upgrade or change some of the dependencies, the packages
‫that you're using within Conda, you can do that.
‫So managing packages in the Conda documentation, that's where you want to go next.
‫And if you run Conda update by Python or cyclone in our case and it doesn't work, it may be because
‫some of the other packages, the other tools that you're using in Conda are using different version
‫numbers and we saw that in here before when we checked the version of Python that we were using and
‫we had 3.7. something which was incompatible with version 0.22 of socket learn.
‫So the way to fix that was we did conda uninstall and then packages.
‫So whichever packages you wanted to remove and then to fix it, we did conda install package and then
‫set it to a specific version number.
‫So in our case it was socket learn and we wanted version 0.22.
‫So we set it to 0.22.
‫That's one of the workflows that you can use when you're running into dependency issues is first of
‫all, check the documentation, try it out, see if it works.
‫And then second of all, if it's not working, uninstall the package that's broken and reinstall it.
‫So now once you go through the introduction of a psychic loan section, if you come across warnings,
‫you'll know how they appear.
‫Why they appear is because something is going on.
‫You know how to filter them using the warnings module and you know how to upgrade and change different
‫packages using conduit if need be.