Machine Learning with Complete Python(A-Z) | Aakash Singh | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Machine Learning with Complete Python(A-Z)

teacher avatar Aakash Singh, Hey! I'm Aakash and I'm a programmer i

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

46 Lessons (4h 52m)
    • 1. ML with PYTHON skillshare


    • 3. Variables Of Python

    • 4. What are Operators in Python?







    • 11. Data stucture and Number data type

    • 12. STRING

    • 13. LIST

    • 14. TUPLE

    • 15. DICTONARY

    • 16. FUNCTION I 1

    • 17. FUNCTION 2

    • 18. MODULE 1

    • 19. MODULE 2



    • 22. FILE HANDLING 1

    • 23. FILE HANDLING 2






    • 29. How machine learns ?

    • 30. Introduction to Pandas








    • 38. KNN ALGORITHM 1

    • 39. KNN ALGORITHM 2

    • 40. DECISION TREE 1

    • 41. DECISION TREE 2

    • 42. NAIVE BAYES 1

    • 43. NAIVE BAYES 1

    • 44. RANDOM FOREST 1

    • 45. RANDOM FOREST 2


  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Are there any course requirements or pre-requisites ?

  • A working computer (with Windows)
  • Basics of python programming
  • Just some high school mathematics level
  • Anaconda software


This course your complete guide to both supervised & unsupervised learning using Python. This means, this course covers all the main aspects of practical data science and if you take this course, you can do away with taking other courses or buying books on Python based data science.

In this age of big data, companies across the globe use Python to sift through the avalanche of information at their disposal..

By becoming proficient in unsupervised & supervised learning in Python, you can give your company a competitive edge and boost your career to the next level.


My name is Aakash Singh andĀ  I had also recently published my Research paper in an International journal IJSR on Machine Learning dataset.

This course will give you a robust grounding in the main aspects of machine learning- clustering & classification.

What Students will learn in this course ?

  • Learn OOPS(object-oriented programming )
  • Learn about every major topics ,working with python 3
  • Learn the basics using real world examples
  • Basics of machine learning on python
  • Fundamental of machine learning
  • Learn about different types of Machine Learning Algorithms
  • Make accurate prediction On different data-sets by using machine learning.
  • Make powerful analysis
  • Know which machine learning model to choose for each type of problem
  • Create Complex Visualization with Matplotlib
  • Linear Regression,Logistic Regression,KNN,Decision Tree,Naive Bayes,Random Forest

Who are our Targeted students ?

  • Those who don't know where to start with python and MachineĀ  learning
  • Those who need a complete guide on how to start and continue their career with python
  • Anyone who wants to learn concept of machine learning
  • student who haveĀ  at least high school knowledge in math and who want to start learning Machine Learning
  • Any student in college who want to start career in data science
  • Any data analysts who want to level up in Machine Learning

Meet Your Teacher

Teacher Profile Image

Aakash Singh

Hey! I'm Aakash and I'm a programmer i


Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. ML with PYTHON skillshare: Hello everyone, welcome to this class. Firstly, thank you for your interest in this course. I really do appreciate it. I'm working on python for two years. I had also mean radius project on Machine Learning. The chunky, my research paper got published in international Jindal IG SR. Before starting this course, you should have some basic mathematical knowledge of end class-level. Now pushing which comes in your mind, vital and Python by the UN agenda programming language. It is high-level, easy to learn an interpreted language. It is useful multipurpose programming language. No questions. What is machine learning? You must learn from the past experience where it is, which he follows instruction given by human. But what would happen if human can train the machine from the data? Then that's called machine learning. Some of the applications of machine learning on Facebook's facial recognition, Google Map, Amazon's recommendation system, tesla self-driving car. All these works by using machine learning algorithms. In this course, you're going to learn both supervised as well as unsupervised machine learning algorithms. Off me anytime, whenever you stick, anyway, I will reply you as soon as possible. You can't learn machine learning by simply observing. You have to do more practice. So let's not waste any more time. Let's get started. Thanks for listening. And I will see you in the next lecture. 2. INSTALLATION OF LAB: In this video, we're going to see how to install Anaconda. First scorn Google in Silicon and conduct freedom. After that, click on the first DO link base will be opened after, let's scroll down and click on the download. No, show me or you can select operating system, any of the three. Now here I am going to select Windows 64-bit. You were to click on it. When you click conic downloading with stock. Here the I'm canceling it as I already installed. Now next or do going download. After that, click on the set of file price. I'll set up this opening after that click on Nest. And after that, click on Next. Now you go to select here. You can select your browsing fault and offer that venue. Click on here next, then the installation will be stopped. I'm not clicking on next because I had already installed Anaconda. After finishing of insulation, it may take some time. You are doubling search Manual field windows. There, Jupiter, G, u, v by d, t. After that, click on Jupiter. One window will be opened here. It may take some time to stock. You have pervade folder here. It may take some time after that. When local host will be opened. After this, you have to select new and mixed. Select Python three. After Jupiter notebook has been started. Not you may proceed your coding. Here. 3. Variables Of Python: Variables in Python. First of all, we have to understood what a variable is. A variable is like a memory liquidation value store and not the value you had stored. You will make RMA no change in future. Now, vegetable discredited as soon as you assign a value to it. It does not need any command. Unlike other programming language. Now let's see how to declare variables in Python. Let two variables, a and b. Here we are assigning equals to five and b equals to Python. This is how you can create variables in Python. When I will print a and b, we get output as 5k and Python. Let's see some more examples through Jupyter Notebook. First, I am going to declare a variable without assigning value to it. Here, a. Let us see what will happen when I will run. Here it is showing name a is not defined. So let's try after giving it a value equals to phi. Now, run the code. Now, it does not show edit. Let me declare one more variable, b equals to 12. Now you can see again, here it is not showing any other, this is how you can create variable in Python. One more thing, I want to tell you about variable declaration, that variables in Python are case sensitive, which means uppercase letter is not going to be same as lowercase letter. They are going to be two different variables. Let me show you a. First. I will run the code. It is showing an error. Name is not defined because we had not assigned value to uppercase a. Now we had assigned value equals to seven. Run the underscore. Now it is not showing any l. So we have declared two variables, lowercase value a and uppercase value a, which are going to be two different variables. Hope you have understood how we can declare variables in Python. 4. What are Operators in Python?: Let see what is N operator? Operators are used to perform operation between variables or values. Values that we use between openings. Operators are special symbol values that I use to manipulate the values of the operands. Let's see what our offerings value that we use during operation are known as operants. Let's take an example. Here. A and B are two openings. Then we had an operator. Between them. We get result according to the type of operator V are using. Pin figure. We had used operator as addition symbol. So we can get the output as addition of two variables. Let see what are the different types of operators which are using Python up. First is arithmetic operator. Secondaries, relational operators and tardies assignment operators, forties logical operators. Set this bitwise operator and sectors membership operator, seventies, identity operators. Let's see, one by one, all adore pretentious. 5. ARITHMETIC OPERATORS: So this all are the operators different, which we are using Phyton, additional operator, subtraction operator, multiplication operator, division, operator, flow divisional proton, and mandalas operator. Let see the example to Jupiter notebook. Let's create two variable equals to phi b equals 215. To understand this concept of arithmetic operator, I will perform the addition of these two variables, a plus B. Let's run the code v get edition as output null. To perform subtraction, I am going to use subtraction operator E minus b. Render good, it will give you the value of subtraction over here. Similarly, for multiplication, you can see I'll put in 75 note to perform explanation I will use to strict strip struct B. You can see output in 3-0, 5-0, 7578125. So it will give the value as output. Now to perform division over here, we had used this command. So it will give you the value of division over here. Next floor division. It will use to provide you the only integer value over here. It will not give you the output in decimal form. You can see here result as three integer value, not provide you the decimal value during the flow division. Now, one model for the modulus operator. It will provide you only the remainder value. Let's run the code c here, the remainder value is 0. Now you can easily use this operator to perform addition, division, subtraction, multiplication, modulus through our division, etc. Very easily. 6. ASSIGNMENT OPERATORS: Assignment or produce. These operators are used to assign the right side value to the left side variable. Here are the different examples of variable which we are using biotin. Assign as adding unsigned, subtract and assign divided, assigned, multiply and assign mandalas and assign exponent and assign. Jordi was in an assignment. Let's see the other example to the Jupiter notebook. Late spring C. It will show edit SV had not assigned any value in the sea. Let's assign the value to the C, S 20. After the print c. There does bring c. It is not showing any error, which means we had assigned the value to the C. Then B died. This c plus equals 20. After dark prints C. To understand this output. So what is going here? Then? I use c plus 20, which is same as C equals to c plus 20. So the value of c to 20 plus 20, which is output F, 40. Now next, we are using c p, c minus equals to 20. After that. But see, and see the output. Now this time here is also same as earlier. Here. C minus equal to 20 is same as C equals to c minus 22. Value of C is 20. Then we put 20, then c equals to 20 minus 20 villages on put F. Similarly, we can perform other assignment operators. Hope you had understood the assignment operators clearly. 7. RELATIONAL OPERATORS: Relational operator, which is also known as comparison operators. We are using these operators to compare two values. Here, different relational operators are given below. Let's see. Check less than, equal to, greater than, greater than or equal to, less than or equal to, not equal to. Basic difference between assignment operators and equal operator is that we are going to use double equal to yn equal operator. Let see some example to Jupiter and not look. Let variable p equals to ten and variable q equals to 20. Next, another variable. Check in which we are passing condition p equally post-war too. Here we are comparing this two values. Then I will bring check. I get output in Boolean form. Let's run the code that are put as false because p is not equal to q s. You can see P equals to ten, q equals to 20, so output will be false. Similarly, I can check another operators. Check equals to P greater than Q. We are comparing whether p is greater than q naught. After that, Brent check and run the code. Let's see output. Here. Output is false. P is not greater than q. Similarly, check equals to P less than Q, which means q greater than p. Let's print the check and see output. Here. Output is true as value of q is greater than p. Similarly, you can check that operators also. So these are relational operators which can compare two values. 8. LOGICAL OPERATORS: Logical operators are used to combine conditional statements. Here different type of logical operators are and operator, not operative or operated. These all are the different types of logical operators. First, legacy, what are conditional statement? As? Logical operators are used to combine conditional statement. Let see what are conditional statements to Jupiter notebook. There are three types of kinesin statement in Python. If statement, elif statement, l statement. Let us see through an example for better understanding. Let go variable equals to N, v equals to 20. Yet if a equal to b, then it will print both r equals n is greater than b. Then it will print is greater than P. Otherwise it will move to else condition is smaller than v. Let's run the code and see the output. Let see what is happening here. Let see voters have Bunia, flawless execution, CTO, if statement. If this statement is true, it will going through print both are equal. If it is false, then it will move to next condition of else-if statement. It will check if this condition problem, it will print this statement a is greater than b, otherwise it will move to our jumped to the else condition and then it will print a is smaller than p. Here both first, second condition are folds because your value of b is greater than a. So here is smaller than p dx phi, it is sprinting as output is smaller than b. Now, let see logical operators. We are discuss conditional operators here as they are used to a combined conditional statements. You know, beheld three types of logical operators. Logical AND logical, OR, and you know, it's not. Let's see some examples. Here. Equals to plan it via pausing it. Condition p is greater than k And he is going to then send good end is the symbol off logical operator here. Let's run the code. First off, look, if both of this is true, then it will you reserved S2. If one of these statement is false, then output will be false. Let's run the code NC outlook. As yet, output is false because here Bs greater than seven is true. But these greater than 12 is fourth DEX file. Yet output is false because one of the statement is result is false. Let's next. Please, greater than 11 and Bs greater than seven. Here both of these statements are true. P is greater than 11 and p is greater than seven. So the output will be true. Next, insert off and operator via using open it up and see what is happening. B equals 12 Ps greater than 11, or p is greater than seven, then it's run the code and see output. Its output is true because if we use logical auto Brita, if any one statement is true, anneal, this worth condition, if any of both conditions one is true, then the output will be true. Here. Both the condition onto Sawyer output will be two next year. One of the condition here we had past false. Let's see what will be output. Here also, output will be two because N, All State audit, if any old this statement, once it meant 2N one statement false, then output will be true. Dex file yet outlook is true. Now next equals to two l not involved for not logical operator. And via, via passing p is greater than two, L and p is greater than seven. This is a statement that we had used before in an operator, a linear output was false. You can see here seems a condition. Aliyah, output was false. So let's see if we are going to use logical NOT operator. What will be the output? Here? Output is true because stay went off and operator is negative over here by using NOT operator. So we are getting opposite value here of logical operators. This is the purpose of logical NOT operator. We will discuss membership, operator, industry sorted. It would be easier for you to understand. 9. BITWISE OPERATORS: Bitwise operator. These are the symbols used for bitwise operator. Bitwise operators are used to compare binary numbers. Let's see some examples of bitwise operators through Jupiter Notebooks sorted. You will be understood easily. Here, 10, 21st, I will run the code, then explain you forties happening here. Here, output is it. But it is not clear why we are getting output here. It ten in binary number is 1010. That is two. L in binary number is 1100. Now beyond using logical and operator here, if the both the beds are true, then the output will be true. So in this case, only first bit r sin, so output will be 1000. Now, if we convert this decimal, then it will be eight. So output is it. Similarly, we can use ten or, well, this symbol is representing an OR gate. Now let's run the court and see the output. Here. Output is 14. Here. We had used 1010 in binary number is 1010 versus dwell in binary number is v11 00. Think OR gate. If any of the bits are true, then the output will be, if any of the books are true, then the output will be true. Then here output is 1111, which is in decimal form is 14. So output will be 14. Next year. This symbol is used to right shift, then right shift to the trend. The code NC output here, output is two. In binary, ten is 1010. Then I shift it two times. V get shifted to times right side. V get 1-0, which is in decimal, value is two. So your output is two. Similarly, we have to use the next left shift value of ten. First I will run the code and explain you. Here. Output is 40, value of ten in binary is 1010. We are shifting it two times to the left side here, then. So it becomes 101000, which is in decimal form, is 40, so the output is 40. This is the concept of bitwise operator. I hope you are clear with the concept of bitwise operator. 10. LOOPING IN PYTHON: Looping and fight. And there are two types of looping possible in Phyton plus this four loop. And second is Y loop. For loop is used when we know ven villa looked stock and when it will be going to n, that is a while loop is used when we know when to start our loop. And loop will repeat itself as long as the condition remains true. Let see some example to Jupiter notebook so that you can understand looping concept easily. Let's see first for loop. Here we are taking input from user to print table. By taking input from user, input must be integer Soviet typecasting as it here in pigeon. So that user can only enter in digital value, would not accept any float value. For creating four loop. Syntax. For i in range. Heel is starting in next. And here 11 is the ending index value. Whatever value you are using. Here, it will consider as n minus one value. If an index this 11, it will consider as n minus one. So n minus one will be n. First I will run it and then explain you so that you can understand it conveniently. It will ask, enter the number. Suppose I will enter here number ten. It will print multiplication table of ten. As I had used. Print. There, it will print the statement. Now, see the last line here, print and compare from the output. Here is the value which we have taken from the user, which is ten. And here x is the symbol for multiplication. And here i is the value of the for loop. For loop will start from one to ten. So here are the, all the values of i, of for loop. And here this assignment symbol is used after dark. Here is the main logic of our program. Into here, value of AB here taken from user risk, pain, and value of IB will start from one to 10. First when the loop i is one, then ten into one, which is equal to ten. After that value of IT in just 2210 into two, which is equal to 20. Similarly. I, value of i next changes to three. Then value of i will become three and often multiply it by ten. It will becomes 2P for next, 40506070809000 end zone. Here. In for loop. If you don't pass any incremental value, then by default it will increment the loop by one times. So here, value of loop is incrementing by one. You can see here starting value is one. And after that it has incrementing to 256. As we heard no, provided here the sizeof incrementation. So by default it will increment by one. This is how we can print table off any number using photo. Next is while loop. Loop till the pit itself, as long as condition remains true. Syntax for a while loop is used here at, in starting. You had to provide its value. Let here equals two when one our next. During the inside by Look, you've had to pass the condition. If condition two, then it will print the value of a. After that, it will increment the value of a equals to one. And starting this condition to it will print a equals to 1. First, I will run the code and then explain you clearly. As you can see, outputs are 147. First-year value of is, one. Condition is true, is less than ten, then it will print. After that, it will increment its value. Here, value of a is one, so it will take value from starting. Now, value of B becomes equals to one plus three, which is equals to four. Now next value for evil become for, now is 44 is less than ten, condition again two, then it will print the value of a which is four. Next, lw will again increment the value of a is 44 plus 37. Then it will change the value of eight S7. Now again, value of a seven-note redundant check condition i is less than ten, condition two. Now it will print the value of seven. After that value of k will be incremented. Now, value of a equals seven plus three participles took ten. Now 18 stooping. Now again, it will check condition. Then is less than ten. Now condition becomes false. Then it will stop till seven after that loop will terminate. And output for this program will be one full sin. Now you next use of break statement. If condition is true, here we are using for loop i in fitness for use as a string thickness. I will explain you later. What is string here? If condition is true, then programmed in and for the condition of brick, let's print and see the output here. First. The output is FID. To understand this output, let's see what is happening here. Here. For loop is used in fitness. Here. F is at index 0 and I at index one, and P at index two and index three, 0s at index four, S at index five. And last, as is at index six. Condition given here is if i equals, equals to n, which means if the for loop when index is at and then throw Granville and then it will only print the value of I. So here in this code, then it will print the elements of string before and after n, or it will not select and then IE, which is two n, then the program will break and the final output will be f t. It will not consider all elements often and N, So the output will be F. Now let see again next use of continuous treatment. We will use continuous statement when we evolved to skip polit particular value. Here in for loop. Starting index is one and indexes it. And he'll VR incrementing by one. If you don't provide one, then by default, for loop will increment by one. Here. And the end index is n minus one off it. Then loop will end at seven. At last, first, I will print the code in the nucleus. Here you can see here I'll put 1234. The skipping the loop will start from one to seven. It is only skipping the value phi. If i equals, equals to five, then continue statement will appear, which means it will skip the value of only i equals to five and print all the values. Starting from one to m. It will skip only the particular condition which is provided here at i equals equals to five soya, i equals to phi condition on skipped layer and all are printed. Hope you understand the condition of looping. 11. Data stucture and Number data type: They're just suggests in Python, there are five types of data such as available in Python. String, list and dictionary. Lets see one by one all of them. First is numbers. Nonetheless, on numerical linear type, merely him numerical values. In numbers. We had fought datatypes, credits, integer, float, complex, and Boolean. Now, Indigenous takes the volume well values without any decimal point. If I add decimal point value to the number, then it becomes fruit. Complex views. G has an imaginary part and added to the number four Boolean true then only true or false. So we use Boolean for categorical output. Now, try to understand them in Jupyter Notebook. First 3D grid of variable a, and then give it value as full. Now to check the type of variable, I'm going to use type function here. It is going to zoom me the type of variable. Let us see a first, then this code, and then I will explain you what discipline you know, it does displaying as integer output. Now you can see here equals to four voyages integer value. And by using type function, we get output as in d1. Now next, we are assigning decimal point value to the eighth now equals to 4.24. Now check the type of value E. Run the code. Now you can see here it displays output as fruit. Now to make the number complex, I'm just going to add imaginary part now equals to 4G. Now check the type of value of a. Run the code. You can see here, output is displayed as complex. Now to understand Boolean variable, let me take another variable, p. Now, I'm going to check three is greater than phi or not. Now I'm going to check the type of variable. First, I will run the code. Then you can see here output is displayed as Boolean. Then I'm going to print p. Then it will print true or false. Let's run the value of P. You can see here output a dispute as false, since three is not greater than five, so output will be false. In the next video, we will discuss about string. 12. STRING: Strings are created by using single quotes as well as double-quotes. They are immutable, which means value of the elements can't be changed. Square brackets are used to assess elements of string, which within which we can see two examples in the Jupyter notebook. First see examples of string. How they are represented SDR equals to ALU. You can use single quotes as well as w course. Here, START's variable name in which field pulsing Hello aspirin. Now let's see, indexing can be done in string into is left to right and right to left. First, left-to-right. Red dots from left side, vet index value 0 at one, at the index value at L, three L. And lastly index value for o. Similarly now see indexing from right to left side. Indexing starts from the right side minus 140. And next video, minus2 for L, minus three for l and minus four for E, And lastly minus five for H. Let's see some examples through Jupyter Notebook. Sorted, you can understand string easily. How to print any string by using command SDR equals two, Hello. But do consider elements within single quotes as SDR. Let's put it and see the output of STL. As I run the code, it will display output S ALU, hello, which are which are the value of string SDR. Next, see how the index slicing can be done in Python. We are considering here STR equals to hello seem from the above. Where h is 0, ie at index e, e at index one and index two, L at index three. And lastly, o at index four. Legs. But under cool first and then I will explain you what is happening here. Here this command, STLs, will display element at index value 0. You can see STI element at index value 0 is x, so it will display. And the output. Next li, this command SDLC tree. It will display element of index value three. You can see here in STI element at index 3013, at index three, element is l. So it will display as next, this command will display you return this value to all the string values from starting to, and you can see in output protests as being all the elements from starting to end. And the next command is used. It will print the string off or vole elements of STL string. But here minus1 shoes indexing from last element. So here output will be start from last index, O, L, L E H. So you can see how it put it o and n e at n plus ammonia STR S1. This command will display you output from starting all elements except the last element. You can see here output as H e l, l. It will not display the last value of string element. Next, see, first I will run this block and then explain you. This command is used. It will display from index value one. We'll treat as output. You can see here output is e. Let's see the string SDI one again. And what are the values at index 1-2-3? From at index one element is a0 and index two element is L. At index three element is. And so you can see the output ERS E, L, L. And now the next command is used. It will display from starting index to all the elements. You can see here output starting indexes from L to all the elements. It will display Nordau. Next command is used. It will print the elements of the SDR three times. So you can see our Puja Hello is printed two times. Next, commodity zoos, where STR plus Python. You can see here it will print the element of SDR along with Python. So you can see I'll put them vitamins displayed. Though. Let's move followed. Now consider string name, STR, one, in which it stalls string S versus the other. The length function will calculate number of strings in SDR V1. First, I will run the code and explain you clearly. So length of SDR, number of lmfit will display number of elements in S, T i1. So number of elements in SDL file. Minimum function will calculate small x alphabet according to the ascii value from the SDI one. So the minimum that you can see, I'll put here S B, which is the smallest alphabet in STI, one according to a scale. Cool. Next command here is Max. Function is used, which will display maximum alphabet according to the ascii value from the SDR been. So here, maximum value according in STI one according to a Sky code is the sole interval displayed. I'll pose it as the use of membership operators in string. We had not discussed Don't membership operator allele in the operators because it's applications are using string. So let's see what are the use of membership proper data in string. It'll be hard to create a Variable STR n1 with having string s. Now, this command is used. Basically two types of operators are there in membership operator, not in an in, not in VR display will check first the word here, Python. Verdi's present in SDR one or not. It will check not in STR when Python bodies not in SDL over. So let's run the code in C output. It has just claim true as Python, string is not there in SDF one, so output will be two after that next line. While in STR one, it will take string will is present in STI one or node. If it is present in SDI one, then it will display to. Otherwise, it will display here false. No. As you know that strings are immutable means you can't change any values of string elements by using its index value. Let us see one example here. Sdr phi equals two vertical, no, STR at index 0, we are replacing G and print STR. Lexie what will be output as we are replacing the value at index 0 by g. So the output would be D in place of W. But the string, it is not possible, so it varied display you add a string object does not support item assignment. Next, see splitting functioning SDRAM. Here we are considering STR t2 is a string which stores, I loved my India. Now we are using here split function in SDR by using this command. There, it's run the code and see the output. It will split the whole string into small, small string. You can see here, I is a separate thing. Love is three separate string in my separate thing. And India is in a separate string. So this is all about string. Hope you have enjoyed the string. 13. LIST: List. Lists are mutable objects, which means value of elements can be changed inside the list. Data is not safe, hence the processing speed is slow. First see example of list. For displaying list usually present elements within the square record, as you can see here, which consist at index 0, element at index 0 is 0, and element at index one is, one. Element at index two is due, and so on. Now let see some example of list to Jupiter notebook so that you can understand it. List. Here list considers element as sham Roy. List1, consider element as 1234. L2 considers elements in B, C, D. If you want to simply see output but int list. But in list1, list2, output elements of list along shown in the form of list and next elements of list one also. And similarly you can see elements of L2. Also. Let us see how to assess list element from the list as element at index 0. List is here, long Shell Royal, and index 0. It is lesser than the chord C output. You can see output ridges at index value 0 of list. You can see that our MSAG and takes value 0 and list1. Next, list one. This command is used to access element at index minus one of list one. List 21 at index minus one is four. So I'll put will be followed. Next is this command is used to access element at index, to enlist, to enlist to element at index two is C 012. So output will be c. You can see your output is C. Next command, print list one element at index minus two. So you can see enlist one, index value minus two, minus two is minus one, and next is minus two and minus two. And next element is 320, output will be three. Next, next slicing, doting, slicing off list within square bracket plus this starting index and offer that end index. And at last step size. Here we are considering two lists. List and list one. List consider elements as large, 114332 and chump list one considers what hard until such as and after debt. This command is used. Plus I will run the code and then explain you so that you clearly understand this. This command is used. It will select elements of lists from index value of 123, all elements of list one. So you can see that it start from an x value of one in list one and list one element at index value of one is one. And at 2148333. So it will select all elements starting from index one to three. So output will be 11433. After that, this command is used to display elements starting from index v1 to all elements. You can see output yet to displaying starting index of list1 to all the elements. You can see here 11433 to stem from list, it is displaying. Next, this command is used to display element from starting index is 0 and end index is for year, but n minus one value is three. Nafta that step size is two. So it will start from index values 0, which is version. And it will skip one step sizes too. So it will move to until An after debt. No other elements because it was skipped one element and then move to next. So output will be work n until, as your step size is two. So it will consider first element and skipped. Second, third will consider. And fourth, Willoughby skip and no fifth element is present. So this will be output. No, next, see, first I will then the good. So did I can explain you clearly. Know this command is used to display all the elements in reverse order of list. Elements of lists are one for ten degree 2m, so it will display in the reverse order. So you can see here output in reverse order. Now this command I use so that it will, it will display the element of list to either time. So you can see output of list. This is considering Raj 114327. So it will print by the time all the elements in the single list. Now this command is used. Sorry. Lastly, this command is used to add two strings, lists and lists. One. Both are added in a single list and the spaces output less than list when both elements of lists are simultaneously printed in a single list. No Nexi, some built-in methods of list. Here TO list. We had used list and list1. By using the length function. First, I will run the code and display you output. You can see outputs here. Firstly, length function is used to count the number of element in the given list. Here, given list is a list. So it will count all the elements of list. Here, list is considering 123456 elements, so output will be six. Next, Maximum of list1. Maximum function is used to display the maximum value from the list. And the maximum of list one is seven. So I'll put a little bit. Next. Minimal list one, it will display the minimum value from the list. One, minimum value in list1 is one. So output will be one after death. But some of list one, this function is used to add all the elements of list one. So it will display output S 20, S sum of all elements of list1 is 28. No. We can insert any element in the list as the lists are mutable. First, I will run the code and then explain. Here we had used command C, list considers element as Roy, 1-2-3-4-5 and addressee will. This command is used to insert the element. If four is the index value and two is the value which you want to insert at that particular index, which is four. Now you can see here an output at index 42 is added, 01234 at index four. Now your list is teens. Index for your list is having phi between 451 new element, who is Adam? Now next, if you want to remove any element from the list, you have to use command list you ought to remove. And in parentheses you had to pass the element. Let us run the currency output C. So here we are removing, I'll meant for from the list. You can see I'll put in the new list element forests to move. Next. If we want to append any element in the index in the list, list dot append is commodity. Let's run the code and see output. Here. 14 is added at the end of list. So you can see here the list is having elements 12345 and the new less blisters having element 14 at the end. So this is the use of append command, which is used to add the element at the end of the index. Now next, if you want to search any element, elements index in the list. So you can use command list dot index. Here phi is the element whose index you want to search. Let's run the code and see the output. So it will display the index value of element phi. So you can see here 01234. So index value of element phi is both. So it will display this for next. If you want to count number of occurrence of a particular element. So we can use command Listers having List is used from the earlier list. Same Reuven predictably for phi. Via counting here. Phi. It will display number of occurrence of phi in list. So output will be v1 as phi is one times according the list. Now next command, reverse families we had USA and list dot reverse command is used to reverse the element. Here we are. This command is used to reverse the particular list. And here lists as the name of the list which you want to reverse. Let's run the code and see output. So you can see here output as all the elements of a list are in reverse order. Now next, if you want to remove element of list, that particular index. So you can use command pop. Now via removing an element at index 0. Your list is the name of list. And via removing from index 0 of the list, let's run the core MC output that will remove the element in the list which is having at index value 0. So you can see here, new list has been created. Now next, if you wanted to short the element of list. So use command list dot short. First we had used list equals to a, B, C, D, E. First I will run the code and then explain UK linearly. Lists or dork short. First it will display list in the unsorted order. You can see here a, B, D, C, E. And after using command list two dots short, I am displaying once again lists sorted. You can see how the list has been changed. Now the output of the list by using command list door shortest, a, B, C, D, E. Now your list has been changed in sorted form in ascending order. Now next command is used to find the value add even index only. Here, consider list S35, 811121618. And we are creating new list, sorry, new command for printing the finding even elements from the list. P for P enlist if P modulus two equally close to 0. Here, lists is the name of this node. This is the condition for event index. Now after that, I am printing list. Now first let us see this command. What is happening here? Here, this new list I'm displaying here. The list is having elementary phi 811121680. Now new list which I am forming is which we'll consider all elements of the list at even index only. And I am printing finally the list. And it will display element at even index. So element at index are 012. So a developer selected 34 at even index four is 12. So it will consider in the new list. And after that phi, it will not select 16 and index value F6, it will select as it is at even index, so it will select in the new list. Now let see, splitting in list. X equals to legitimise my life. Here, x is the string. Come on two split string in the list. Y equals two, X dot split. Here, X is the name of string which you want to split. And after that I am printing by. Let's run the code and see the output. Output as Zim as my life. Here. Vole string is converted into, into small strings. Dilemmas, converted table. First string is, is in second string towards string fulfilling. So this is how you can split any list. 14. TUPLE: Tuples. Let's see some examples of double elements of representated within parenthesis. As you can see here, at index value, 0 is having elements 0, index value of one, it is having the limit of one, and so on. Doubles are immutable, which means value of element can't be changed. Data is moved safer as you can't change its value. So data will be more safe. So it's processing speed, stability faster as compared to a string and list. Now let's see some examples of doubles and the Jupiter notebook. Here are the examples of the tuple contains numeric form, w1 contains in string form, and considered elements in alphabet form. Now print all the 32 plus can see output in the form of double L. Next, the next slicing into the LBL considering to double the APOL1 as bicep, tricep four arms and legs, and W2 having element k and g and f dot dat. This command is used to display elements from index value v1, T. And it will consider n minus 1 elements. So it will display elements from one to two. Then the currency output from tupple one, the next value at one. And so output will be tricep pen forums. Next, this command is used to display all the elements starting from index one from the pelvis. So you can see here, starting from index one to call events will be the space that output. Next. This command is used to display only value at index 0 of double. So element at index 0 of W2 is key. So output will be good. Now next, this command, first I will run the code and then explain nucleoli. Not this command is used to display element starting from index 0 to minus two. But is it will allow n minus 1 elements. So it will consider all elements starting from up to minus three. As you know already, it will display n minus one value. Now, see the output is bicep and tricep starting in reverse order. You can see here starting from From starting, it will display all elements del minus three, minus one, minus two, minus three. So it will display bicep and tricep boat as output. Now next, this command is used to display of twice the time element of the ball2 is k, g, and f, and print display visor time in a single tuple. Now next, this command is used to add two tables. Now it will display as output in the new tuple form. So both the elements of w, I did. And then your list, sorry, in new tuple, you can see your output bicep, tricep, forearm, legs, k, g and f, and then mutable form. Now next, burden but also dot-dot. Know we had used bicep, tricep 11, one to two to four arms, legs, and biceps. Come on to count number of elements in it. We're going to call BICEP2. It will display the number of occurrence of bicep from tupple one. So let's run the code and see output. Or does displaying two S into Bicep a good wiser times in a single tuple. So I'll put, we'll whip to know next year do tupples are shown. First, I will run the code and then explain Nuclear live what is going on here. Then lend function is used to calculate the total number of number of elements into 123456 and so on. Portability seven. Next, maximum of maximum function is used to calculate maximum value of the ball2 into part two, you can see here maximum value is 55, so output will be 255. No minimum function is used. To read ten minimum value from the point 2. We can see minimum value in double two is 0, so output will be 0. Now some function is used to calculate sum of all the elements from the upper to the sum of all elements from WVD 128, which is displays it output. No. Next see, you can also check the index value of any element in tuple. Now come on, use this double one dot index and 11 one is the name of element whose index value you are going to check. And APOL1 is the name of w less than the court. And CDA output. Index value of 11 is displayed as. The next value of 11 is, let's see, element at index 0, 1. Ooh. So you can see all parties correct. Index value of 11 is to know next zip function. What is the role of zip function, the inverse function in Python? It takes item in sequence from a number of collection to make a list of tuples. Each tuple contains one item from each collection. This function is often used to group items from a list which has the same index. The list contains a, b, c contains PQR, and zed contains Street Fighter II. Print list zip x, y here via using zip function only on x. Invite. First lesson, the Korean see output. You can see here output first element of x is a second element of, first element of soil via a speed boat are represented in a form of w. Next, second element of x and second element of y are represented in new tuple and so on. Similarly, you can use here, we're zipping all the elements of x, y, and z. We are using this time XYZ simultaneously. So you can see here in output, it will go in first value of Ws, the first index value of X, Y, and Z, you can see here in a form of tuple. Now next, it will consider the second index value of x. Index score is B. Similarly, at index value, second element is 0, y is 2, and second element of five. And so this is all about. 15. DICTONARY: Big story in Python that we already created a variable, by the way, in which we are having two items are separated by comma. 1 is key. And whereas at police value for V1. Next two is t and one plus is the value for t. And the values of dictionary are the present text stored in curly braces. Now, dictionaries, mutable, which mean we can change the values of the element. They're enclosed within curly braces. As you can see here. It does unordered set of key value pair. Now, let's see some examples of dictionary. To the Jupyter Notebooks folder. You can understand that excited concept of dictionary properly. Now let's see how to create a dictionary. Here. D, D equals two curly braces that this represent the empty beach study. First I will undergo and then experiment this command, the present BR, creating empty dictionary. After that, this common is used. Name is the key and I usually is the value for name key. Similarly, we are creating another key which, whose name is IID and value for ideas one 19 period. Next, we have created another key, written name branch and having value MB. Now let's sprint B2 and see what is output. As you can see here, one dictionary is, has been created with name as first key. And it's venues, IOC. And ID is a second key. And its value is when, when 98 and branch is it's Turkey width value and no see examples of the extended here is show. Dictionary contains element name IOC. Launch him down next. Print dictionary dot keys. It will display. Let's run the code and see what the display. It will display all the keys of dictionary. As you can see output. All the keys are the spirit name, ID badge of dictionary. Know similarly, you can also print all the values of the name dictionary. You can see here, values are our USU when one minute and NP. Now next, we heard use for dictionaries as shown here. Not operator. Not equal to operator returns true if the item within dictionary are not same. And equal equals two operators is used to test if two dictionaries contain same item or not. No next command and run and see the board is output. No first command is displaying two to x. N by boat are not the same dictionary. And the last not equal to which means both naught same. So the output will be two. And next command is x equal equals to y, which means both the degrees are equal. So output will be false. Next, here we had created our dictionary with name D. And having this items, you can see first key-value name. First key is named, second is id and 30s stream. And all the keys are having some values. Now let's print d dot keys. There's an accordion. See output. It will display the keys valuable dictionary. And after that, I'm displaying here values of victory be, as you can see here, very little control, 300 to it, an ID. And next, lastly, I heard this big D dot items. It will display the dictionary in the form of item. You can see here. Name is the name of the first item with key-value name and our culture is the value. Similarly, you can display all the items. Now next, V dot, you get this. First, I will end the poll and then explain you what is happening here. Not this command, D dot get, and we're passing your name, will display value at key name. You can see here, value egg keys name and value is a gotcha. So it will display output as a gunshot, which is the space. Now next, d dot pop stream. This command will remove the key string and its value. Now, you can see here, I'll put this, IT, this has been removed from the dictionary. String. Key has been stream key and its value has been removed from dictionary know, bring. This command is used to check whether the key N values of our deleted or node. So you can see output with digitally having only two items. First, second, and the third item has been deleted. The name with key-value scheme and value IoT. Know next to the last command, D dot clear is used to clear the whole dictionary. And after that, bring d is used for display output. And you can see here, output is displayed in the form of empty dictionary. So this is all about dictionary. 16. FUNCTION I 1: In this video, we are going to discuss about function. So let's see libc function. Let us consider an example. If you want to perform addition of whole numbers. Here we are taking two numbers as input from the user. Let's create a variable sum in which we are taking two variables, sum equals to a plus b. The logic to perform addition. After that, we're printing sum. So now we got sum of numbers. This is good. We got output as addition of two numbers once. But what would happen if you had to perform this tradition multiple times? If you have to perform this addition of two numbers one times, then it is really easy. If you are to perform this addition thousands of times in real time. You don't want to repeat this same line of code. So Python functions are the really solution for this type of problems. Now you know that via, via using function, Let's see what our functions, functions providers of VA to break the program or process down into smaller chunks. And independent blocks of code. Function is a block of organized, reusable code that is used to perform some task. Here depth is the keyword used before function name. Then my function is the name of function and its name is to be followed by parenthesis. Pay for quality. Let's see types of function. There are two types of function, built-in function, user-defined function. Built-in function includes libraries of Python which are already present, and user-defined functions that are created by the user. Let's see some examples of built-in functions of Python. Minimum function. It will return the item with the lowest value length. Then return the total number of elements present. Maximum function. We'll return the item with the maximum value. Sorted function will return the sorted list of specified iterable object. There are also many other inbuilt libraries present in function. But we had discussed this much already. Now, let's see user-defined function. Now foresee how to create a function. Def school. The depth is the key values for function. And he is cool is the name of function after it via printing. Welcome to our school. He would this statement is the body of function. I want to print. Welcome to our school. After that, let's see how to call a function that these two lines and same as previous, previous, hear the changes only school. This isn't how we can call a function. We had to use the name of function, function name after dark parenthesis. So this is how we can create a user-defined function. Now, let's see some of the advantages of function. It reduces the duplication of code. It also reduces the complexity of our program. Improve the clarity of code. User can be able to relate to food easily. We can use whenever we want of a core. In next video, we will discuss examples of function to the two predominant mode. 17. FUNCTION 2: Let's see some examples of function to round to check greatest of three numbers and then find average or dead three numbers. First I will run the code and then explain nucleoli for this happening here. When I will run the code, it will ask me first, enter the first number, lead the first number to be one. Next, it will ask you enter the second number, so I will. Next second number is two. Let's see. It will ask you enter tournaments because here we are taking three input from user and VIA checking greatest of the animal and offered it, we are finding the average of three numbers. So it will ask you, enter the third number. Next. It will display you average of three numbers to the greatest number is three. Averages. To end the greatest number is three among the three number which we're entered from the user. Now let's see what is happening behind the code. We had created function with the name greatest. And we are passing a parameter a, b, c. In this if statement we are passing condition is greater than b. Then we are using your operator, logical operator. And and next statement is, is greater than c. If this condition is true, then it will print greatest number. It is a. If this condition is false, then it will move to the next statement, elif statement. Here it will take condition. If this condition is true, then it will print greatest number is B. Otherwise, it will move to the next statement, else statement, and it will print greatest somebodys. Known. Moving again here. Second function we had created with name, average and passing parameter ABC. Here p is a variable in which we are doing sum of all the three input divide by three, which is the core logic core for averaging three numbers. After that, we are printing statement average of three numbers, p, which we had stored in the variable p. Now we are taking input from the user. So here we had created three variable for three numbers. A, b, c, and d are type casting it to the integer soldered user can enter only the integer value. And we are asking from user in variable a, enter the first number. It's similarly in B variable we're asking enter second number and in C, enter the total number. Then lastly we are calling function. Here is the name of function average and greatest is the name of function greatest. And we'll calling here function both the function average function and greatest function. And we're passing here the arguments as VI, taking input from the user. So we had to pass here the argument. So this is all about the program to check liters of the image and find a vigil debt timbers. Let's move a little DOM to check some of given a month and also check Velez sum is even or odd. Now first I will run the court, then explain you what is happening here. It will ask you, enter the starting range of for loop. So I will take here starting range to be one. And after that, it will ask you enter the ending range. So let the ending range to be five. And after that, it will display you the sum of all the numbers between one to five, which is 15. And if it will check whether this semester or this even here, the sum of one to five numbers is 15 witches or so. It will display, you ordered a verdict. Even, then it will display you sum is even. Now let's see what is happening behind the court. He had reared created function name, some in which B equals to 0, which means initially somewhat values which are stored in p are garbage values. And here we had used for loop in which m is the input, which we are taken from user, which is the starting range of for loop. N is the ending range of for loop. Now after that, the ideals P equals to P plus when it develops some, this command is summed all numbers from m to n. Then after that, it will return the user value of b via another function with the name tick and Bosnia, Parramatta pin. It will pick the value of b from another function as a sum, and it will check whether this sum is even or odd. Now first condition of the if, if this sum is divisible by equally close to 0, it will check the condition. If this condition is true, then it will bring some miss, even, identify it very displayed debt, some miss or. And after that. Here we haven't called the function sum. We had used variable to call the function sum. Then. Sum of all numbers and the bees buzzed as this function, we'll check the sum of all value from the previous function. Now v, Similarly called the function check also. And this is all about program to check some of given a MAC and also check whether the sum is even or odd. You had understood this quote. Null. Next see an anonymous function which is also known as lambda in Python. This type of function and not born to the names. It means an inverse function does not have a name. They are created by lemma. It takes them one argument and returns evaluated expression. Lambda is created without using def keyword. So let's see an example. Here. Function that fusion is square equals to lambda, X1 equals to X1 and X2 X1. Let's call the function with the mean squared. Here you can call the function in some different way. Let's see this statement. Brink, square root of number is squared in parentheses, value then is paused. I will run the code and then you will clear about this. This is displaying squared off number is a 100. Then we had boss this value of Talmud or 10. Then value of this will move to the Lambda x when it is Buddha calculation here, X1, X2, X1. The value of X1 here is ten, so ten into ten. So output will be 100. So let's see difference between normal function n and all must function. Have a look over to our example, sorted. You can see the difference between normal functioning. I don't list function. Normal function. Function definition. Def name of the function is squared and we had Bosnia bottom or duck x. It will return x into x. After that, we are calling the function by printing the state main square of number is. And he had via bar has the value of parameter s. Then I will run the code and then display you output square of number is n. Similarly, you can see by using anonymous function lambda, the basic difference between the anonymous function and normal function is dead kid. You have to use the keyword def. And here you have to use the logic like this statement. Here you can, you had to use more than four lines, but by using an anonymous function, you can use two or three lines and you can display your output. Hope you read, understand the basic difference between normal functioning and all must function. 18. MODULE 1: What is module modulus, simply a Python file, very classes, functions, variables are defined. Grouping similar goals into a single file, make it easy to assess. Modules are used to categorize Python code into smaller parts. For example, if the content of book is not indexed or categorized into individual chapters, then the book might have been done putting and hectic. Hence, dividing books into molar chapter makes it easy to understand easily. In the same sense, by 10 models are the file which has similar code. Let's see what are the advantages of using Python module. Reusability. Module can be used in some other Python code. Hence, it provides the facility of code reusability. Next, categorization. Similar type of attributes can be placed in one. What do you now? How to use four do. You can use modules in three different ways using impulse statement, using from import statement. And lastly, do import module. Nosy. Some of examples of built-in modules in Python. There are many built-in modules in Python. Some of them are met but is used to perform mathematical operation in Python. Next is random. This function is used to generate a random integer values. And next is TK window, which is used for GUI operation. Each module has a number of built-in function which can be used to perform various functions. This is all about volumes of Python. In the next video, we will see some examples to a Jupiter notebook. 19. MODULE 2: Firstly, the math module, when you can use different mathematical functions. Import command to import math module from the library's. Let a equals to 4.6. Next, print RAD dot c. And we are passing a parameter a, which had been used to basically see the function. Field function will return next integer number of a. And where is your function will return the previous integer number of past parameter. So let's see the output. By using C function. We can get the next integer value of 1.6, which is five. By using float function, we can get the previous function, previous value of the digit venue for 16, which is 4. Now v equals to nine. Let's see. Mats dot SQRT, american square root of v, which is C. You can see the output here. Square root of nine is three. Now met vote exponential of three. Well repel natural logarithm e, raise to given number, which you are providing here. Let's see the output e to the power three is 20.0855. And next, match dot log of 2. Then return the natural logarithm of number. See the output a 0.693 logo and the value is 0.869. You can check in the calculator or in your Android phone also. The same value you can compare anywhere. Now next, what pow1, 2.043. Here, base value is two and the exponential value is 3 to the power three, which is known then another, then 8 multiplied by 2, multiplied by 2 is 8. Next, math.pi sine of 0, it returns a sign of radians 0, which is sine of 0, and the output will be 0. And similarly, match dot cos of 0 is one. And then know 45 is 1.619. You can check the values by using calculator also. Next, then the module. It is used to generate random numbers. Let's see some examples. Import random amount to import the random module. Link. Got 9 random dot random. This function, this command will motels random numbers vector then 0 to 1.01 is the exclusive. And this command, random dot, random INT from 0 to read the, it will return the random numbers between o feet. Let's see the output here first. Random values between 0.6810 and random integer between 0. And it is you'd ever done when you run the code, the values are being changed with time 0.003 for this and this command, for this command. Here, random integer is two. And you can see every time when I run and values are changing, it doesn't have constrained to the new edge by its name is random. Values are changing every time. Let's see another example. Example to guess the number. Jew had. To guess the number. Here we are importing than and equal to random.random integer. It will create random numbers between 0 and 99. Lousy equals 2, 3, 4, three chances. And now for I in range of zeros, 2, 3 j equals 2, j minus 1, b equals 2. Integer. Input. Guess any number 19. And we are asking this value from user. Now. When John's left, it will pull the Johnson left after it. We'll compare. If a is greater than b, it will print your number is to know if your number is low. Plus it will calculate the value between 0 to 99. And then it will compare by the user, which the user has guessed is the value for b. And it will print, if it is low, then it will print, try again. And otherwise, if your value is greater than a, then it will print your number is too high, dry again, and otherwise it will save your, if your number is correct, then it will say your number is correct and the foreground will break immediately. And after that, I belive last print random value is three. You might be still confused. I will run the code and then explain Nuclear view. It is asking, yes, any number between 0 colliding with your taking from user legs, I will input particle. Let us printing. You had left foot out. Your number is 2 Pi, which means the number which you had entered is greater. Then the random value neck. Now, you had another challenge. You can try again. Means you had to enter the value lower than 45. Now it's 33. Your number is too high. No. So your number is too high and you had only single jumps? If you can answer correct. Then it's okay. Otherwise you have no chance. The edge gets the lumber any Let's see, how is your luck? Is we are able to guess the correct answer or not. No, tells you your number is too low, which means the value is between 20 to 22, 33. At last it is printing. Random value is incremented, which means the guests we had made is incorrect and the correct value is 28. So hope you enjoyed this course. In the next video, we will discuss about exceptional learning. Python. 20. EXCEPTIONAL HANDLING 1: Exceptional handling in Phyton. Why we need exceptional handling in Python? Let us consider a case dividing by 0. Can you divide a number by 0? Let's see how this molecule will approach to this problem. He would think that he can do regular division to divide something by 0. So you are dividing something by 0. So it stays. See, later, killed realize that this is all. Now let's see how programmers would oppose to the thing. Established that dividing a number by 0 is mathematically not possible. So as programmer vino, that does not cut it. So this basically leads to the 2k is either exceptionally odd edit. So Python program terminate as soon as it. And gum that I'm at a in Phyton at again, via syntax edit or exceptional item. For fun, let's divide a number by 0. So this is what happened with Python. It doesn't add up Message. See the newspaper display 0 division atom by running this code. Now, later this example I will show you in Jupyter Notebook. What is exception handling. To get good picture of what is exception handling, we need to start with understanding the definition for both exceptions and exception handling. Perceive what is M exception. And the exception is an event which occurs during the execution of a program that disrupts the normal flow of programs instruction. So instead of program executing evenly and night's sleep, that is truly disruption in between code. So this recall is an exception. Now let's see what isn't exception handling. This is the process of responding to an occurrence of an exception during compiling of acceptance statement, which requires spatial processing. It is actually what n exception handling. It is very simply concept and I am sure that you guys will agree. Now, let's see what is the process of an exception handling. For example, let's use a made an edit for depth. And next user will find oil Phyton vary. Then you have what is the edit is. Once you know what the error is and you know that it can basically start analyzing it. I don't know it is fixable or not. If it is not done by the MOOC, fix it. If it is fixable, how can we handle the exception? So we need to first find the, find an editor. If you can't do it by 10, will find for us. Well next, sure to take caution. While coding if you think there is an error in the particular piece of code, well remember, try at this point. Later, we will fix this and call it s catch. Now let's see some more important terms that you should note down. First is try. Then try is basically give all used to keep the pole segments under check. Next is exception. That exception is segment that is used to handle the exception after catching it. Next else, but else's basically run when no exception exist. Lastly, finally, finally, we'll run even if there is an exception. And finally, builder. If there isn't not exception, I want you guys to know this point. It will help you in next video and I will show you some examples to Jupiter Notebook. 21. EXCEPTIONAL HANDLING 2: Next up channeling mostly use dipole acceptor minus 0 division error. It is also known as integer division or modulo by 0. Now first of all, you have to understand what are the syntax for ZeroDivisionError? It start with by block. And this all understatement paused within food. And after deck except statement is the time in which the type of error is mentioned. And if condition two, then it will print the statement. Otherwise, else condition will be called. Now let's see this program. Here. A equals to 10 divided by 0, equals to 10, divide by the number is divided by 0. This type of error is known as arithmetic at a no brainer, a exception statement. At a particular risk past. If condition two then it will print statement is raising an exception. Otherwise, condition that we passed. It will bring, welcome. Now let's run the code and the output. Better it is printing. This statement is raising an exception. Why this is showing this? Because your n divided by 0 condition is true. It is showing arithmetic at a. So debts were here. This statement is going to know, see next example. Enrich. In place of a equals to 10, divide by 0. We had frequent simply 10. Now here, ben is not any type of atom. So output will be welcome. According to me, lecture on the choreography. Here it is showing ten and welcome. As here, it is not any arithmetic added. This condition becomes false and it would automatically pass to the else condition and it will print welcome. Now next example, creating quiz using exception handling. And yet you had only to life, which means you had poor towns to answer this question. If you had two times in correctly, and then you will not able to answer the next question. And you will be out of this quiz. Initially. G equals to two, which means only do life. Question 1 equals 2 integer input. 2 plus 2 equals 2. Here, we had typed costed into impedance. Here, user can enter. Only integer value only if you'll push in one equal equals 24, which means if the user enters the answer correct, correct answer for, then it will print correct answer. There is white. It will bring in correct answer. And after that, it will print life left equals to j minus one. Initially value of J and J minus 1, which means two minus one equals to one, then it will show life left is one, and the value of g will be decremented. Now, if j equal equals to 0, which means if you had answered incorrectly, then it will raise arithmetic Adam and print new line. Similarly question to ask, Who divide by two and same condition. If answer is one correct, then it will follow the precision. And next questioning here. If sine Theta, it will ask value of sine 0. If your answer is 0, correct, then it will print correct answer. Otherwise, it will follow as a live questions in the question. And see. It will ask hopeless to. If by mistake. You had typed wrong answer in place of four, you had Type 3, and then it will show incorrect answer. Your life left is 1. As I had told in this course. If you enter correct answer, your answer is four, then it will print correct answer. If your answer is wrong. Here, I had written three, then it will move to the else part and it will print in correct answer and live Leptis one. If similarly, next time also you would answer incorrect answer. Then it will show a value of j becomes 0, and then it will shape between the show, you know, life. Led see two, divide by two. Here. Answer is one. So let's see what will be output showing correct answer. Now, it is asking the next question. Value of sine 0. Value of sine 0 is 0. Let's check what is output. It is showing correct answer. And then the next question is it, it is showing value of L. L equals to length is 4, and b equals 2, breadth equals 24. And it is asking what would be the area of a rectangle? Formula for calculating area of a rectangle is length into bit. So length and breadth will be both multiplying. The correct answer is 44 cells 16. If by mistake, I will. If I write 16, then it will show correct answer. By mistake I had written Year 2 and let's see what will be output. Showing George answer is incorrect, life left 0. And as it, it is raising arithmetic error, which means you can't proceed for the breeding arithmetic. No life. In the next video, we will discuss about file handling in Python. 22. FILE HANDLING 1: Before starting File Handling, let's see vibing in fight handling. Let's start from basic, how we can take and put something into Python. First way keyboard input. Then there is another case as well as maybe even command-line arguments to input some parameter into code. What would happen if you had to read lots and lots of data, which is not practically to typing every point of time. Even though it does not make sense to type at all time, the easiest free out of this is actually stored whatever input you want in one place and keep using as long as your requirement is met. So what is the answer? Answer is file handling guys. This concept is very easy. Next, we will take a look at types of files available in Python. Let's recall the type of file. You may know. There are images, videos, use text, script and so on. Windows support for load these files which I had taught and much more. That is, python supports two types of files are binary and text. So whatever is not in text is binary. Binary file contains in the formula 01. Text files are structured in sequence of lines, whereas each lines is consist of sequence of character. Novae know that photo the type of files five. Now we can move on to what is file handling. And handling is an important part of any web application. Operations which we can do on files up, ride, append. There are many other operations like copying a file, changing property of file sector. Let us see file handling capacity of Python. The key function for working with files in Python is the open function. See this lower diagram to understand what we need to first create a file. Later, we will open file. That file we work on file. Well, working on it basically reading, writing, or anything else for that matter. And lastly, p close the file after we had computed our task. Now let's see how to open a file in Python. It is very simple. We had in their function called open function. It takes two parameter. First is phi limb and another is mooc. Let's see syntax to open a file. First you were to pass urine. Finally, after the mode of opening phi, there are different modes for opening a file. First is read. There, it doesn't default value. It opens a file for reading. It will show if the file does not exist. Next is append. It will open a file for appending. It. It will create the file if it does not exist. And next is should I? It will open a file for writing. And here's the file. If it does not exist. See some more examples to Jupyter notebook in next video. 23. FILE HANDLING 2: No first example, API calls to open. No PT dot p2 dot IP by NB is the extension for Jupiter Notebook saved five is the name of file, which we are going to prove one. And R is the mode of opening, which we are going to read the file. And S equals to app.vue. Reading. This command is necessary if you want to read any file. This is for opening. Now you are going to read the file. It will read the text. Know if it will read. Next you how to bring. If it has lead, then you are to print to file data. And it will rank higher than data has been cooperate. If you're successfully it has read, then it will bring file data has been copied. No, F2 equals to 0, but it is a finally. And it is opening in tight mood. If this file name does not exist, then by default it will create another file with this name. Though. My see Jupiter textbook. You can see here pd dot IP y and v is present. And finally M P 29 dot ENV is not present. You can see and more pressing. And well, I will run the code. It will by default create a 15 limbs with this. And it will copy all the details which has been present in this file which he wrote IT. And you can see more digitized presenting this file and open this file. Once again, I'm opening this file. So you can see that how to open this file, P2 dot IP by NB, it is having this statement print hello and welcome to the Python. Know this files bold text when we go into copied in this file, F2 dot right here, the whole text which has been present in this file will be copied in this file. Now we are closing the file, go to File Upload close, which is used for this file. And Ecuador close for this file. Well, let's run the code and see the output. A goal. This all codes which are not necessary for us. If it end at the end of the output, it has been it in a file has been copied. Then your program and your P2 got IP by ENV. File is copied successfully in P cotinine dot IP by Andy if at the last test steroid, next page has been copied. Now you can see right here, new file has been created with name. 39 dot IP by eNB. Open this and see the output. It is printing the bold text from P2P file to be 39 five. This is what the output of this code. You can copy from one file to another file. Here you are opening this file in read mode. And the year you are operating, writing function, writing function in this file. Reading IF function has been the low, Let's see some more examples. Move to the Example 2 equals to empty. This is empty list. We had, we had created will empty list for I in range of 0 to three. A dot append. And don't fully. This command is used to append the empty list. This is empty list and we are finding all the values without taking from user and appending to the ableist. And upper deck range the value of list. Let's dive. We run the code and then explain you in DD. It is asking and got a fluid in which I add and dead region which will be going day from user plus n nodes or fluid. Suppose I'm anchoring it. Cosh thing around. And the same formative, how to enter their names. Next? It is asking another name because we had used for loop three times. Another names. Suppose I'm angering Jones. For example, any name you can identity. And next, I am a dream growing up. Current. See, we had also used here split function. You can see here split function. What is the use of split function? Uses split function if we consider, firstly, consider first full M, S, this full lemmas in the list, and this will emit another list and this name, full name also consider as another list. You can see one list as created three element plus second didn't thought element. Now let's move to the code here it is printing finance Win Cmd, F equals to o dot TXT. Yet I put, this is the name of five. If it is not present, then it will create the new file. And you can write, move another S equals to one file, to another file is created. And next t equals to o, f z o dot 3 Pi has been created. All Our in write mode for loop for all three names in the list, b equals to a node split. This is used to split the names in a form of list. Now, here's in starting value phi is 0. Then it will consider first fully know F dot dr, F dot dr v of 0 plus n on firstName. Plus fully firstName plus pooling. First full Les Mis, alcohols, singers, good. And the firstname, cash, will going to be print in file F. F is F. And show here our costs will be going to print in the filename fn. And sing will be going to bring in the file, which is FM dot TXT and arch. Both will be going to drink in the filename F0 dot TXT, which mean firstName is going to printing file name Fn dot TXT. And middle name is going to print in the phylum at them DO TXT. And lastly, we'll go into present and the file name f o dot TXT. Similarly, for this two means also basically all the first few links are going to be print, f, n got PhD, and all the middle names which are in the list, going to shrink E, Fn dot TXT. And all the last name, Raj cool Jones. And color will be going to print n f o dot TXT. I'd run the code. It is saying that file has been saved. Let's check the output. The output will be saved in the tree files. First file, fn, append will be considered our college premium curl. Let's see what is considered. Plus this F and it is having data Akash here in conquering. Close this tab. Let's move to the code in the file FM. It will consider all the middle names. Seeing Joppa and couple legs. See the file wasn't the needle file, F and F M thing, Joe payout, couple of c Once again. What is the last name? Knowledge would Joel's income there'll be printed in finally f, dxdy, Dead Sea at all, nor dxdy. Relish boot. Calling Joel's when detailed and rich. So if you're thinking that I heard and save this file limb, so for your Shorty, I'm deleting this file. We once again, I will show all this will be printed. I've deleted this file. I will go into window once again. And I will show you is the same output printed out mode. It's in the cold name. Cosh, string. Second name. Way. To draw. His last name is why it has been sealed. You can check once again, the output has been seen in the file here. While the file has been created, first, f n, cosh be ingrained going up. And at el cinco crackable and Apple watch, we don't know. I think you can sustain this. What is file handling consent. And hope you have enjoyed this course. And the less we'll either going to explain, oops, concept. 24. OOP CONCEPT THEORY : In this video, we are going to discuss about, oops, concept. It is basically stands for object oriented programming. It is widely used concept in programming and almost all modern language X sub C language follows, oops, concept. It is working. It is programming style which is associated with the concept of classes and objects. It also include various other concepts like inheritance, polymorphism, abstraction, and encapsulation. If you are starting with programming language like C plus plus or Python, you will soon introduced to class and in no time the word object will start falling Gulag sharing. Let's take a simple example to understand about these concepts. First is class. It is a design or blueprint of any entity which defines the core properties and function. For example, we take human being as a class. You can see here the syntax of class. Here class is the keyword used to define a class. And you have class name is the name of class which you can write any type of name. Now after that, you can then DO statement. Now let's see what our inheritance. In. Oops, the meaning of inheritance is very close to its actual meaning in English. Considering human being as a class which has properties like hands, legs, etc. And functions like vote TO see. Million female are also classes where most of the properties and functions are included in already in the human being class. Then VC, hence male and female are inherited. Everything from the class human beings using concept of inheritance. Then VC, male and female. Both inheritance class human being, which means as they have some common features which we have already implemented in human being. Hence, we don't help to implement, again in male and female. They can simply enter them from class human being. So this is the concept of inheritance. Nexi object. Object is an instance of class which has physical existence. For example, My name is and I am the object of the class mill. When DC, human being male or female, we just mean, uh, kind, you, you offend me. All are the forms of classes. We have a physical existence while the class is just logical definition, V are the objects. So male is the class of which IN object Whitney, Akash, Nexi, abstraction, which means hiding the details from the outside word, which means showing only the required things to the outside world while hiding details. For example, human beings can walk dogs, C, etc. But duties are hidden from the outside world. We can also take skin as an abstraction factor in lowercase, hiding inside mechanism from the outside world. Next see encapsulation. It refers to the binding property that function. Body parts such as hand to hold things and our legs are bound to help us for. This binding property to function is called encapsulation. And next, seawater Polymorphism. Polymorphism means many forms. It allows us to define more than one ways to do something, either by using different process for it or by using different parts to do it. For example, we need to collect a shape. There are multiple shapes like a rectangle or square or circle. However, we could use some methods to color an issue, this concept called polymorphism. In next video, we'll see some more examples to Jupiter node. 25. OOPS CONCEPT CODE1: In this video, we are going to discuss some of examples of, oops. Let's see some first example. Before starting this code. I will run the code and then explain you what is happening here. First, it will ask you, enter the ID, for example, that I've used to be one. After that it will ask you until the name that any name let alcohol. After that. It will ask until the post lead post be a tough. Next Celery lead, an ECG, and then after that it will ask and done next ID lead to enter name, any name let route. After that, it will ask you and tell the post this time led post to be manager. Next, it will ask you sell, reenter the salary, let any salary randomly. After that next ID, they're taught ID to be. And in a moment for our dealers, 32. And I enter the name leg this time name to be woven. Afternoon it will ask you enter the post, lead the pulse to be this time clerk. And after that it will ask you celery LED salary to be an even number we send you after what is happening and see here offer you would enter the third person said, it will display you sell we offer increment. You can see first ID when I had been dope and the name Post said we often read, it will display your salary optimum command. Here we are incrementing the eat celery by 10 percent. So after the incrementation cylinder by 10 percent, it will begun it dynein Thompson, 589334, second ID when I had entered the salary. Now the new salary after increment will become more right after that. Similarly for the third ID, weird entered, ask the user to enter the cell body and after did read increment the salary by 10%. Now finally, it will calculate the total salary of all employee by adding the salary of 70 after increment of all the three uses. Employee. Now, let's see code behind it. What is happening here? To understand it clear, first year, we had created a class. You can see here, to create a class you had to use keyword class. After that you have to pass the name of plus. So here we are taking the name of class to be employed. After that, we are going to create two function. First written him get detail and second with name increment. In the first function, VR, asking user to enter the details. In second function, VR going to increment the salary of employee by 10 percent. Suv had to take value of salary from first function sorted, we can get a lot of new salary by using variable a for in green ID and get using variable p for Anthony. And similarly c variable for enter post. Now search dot d for entered the CLV. Here we are using Salvatore Di instead of B, as we had to pass here the value of salary from this function to this function. You can see here we are passing the value of self dot d from first function to another function. So we had to declare variable cell thought D instead of D. So did we can get the value from one function to another function. Now we're in this function, self dot e is the new salary. And here self dot d is already know salary. And we have the logic for incrementing salary. And then plus M is self dot D into 0.1. So new cell rebuilt become original salary plus 10 plus an increment after that. But in the value of self dot e as a new surgery. Now, if you have to repeat this same procedure for three employee, then we need to create three different object. Here. Y1 is the first object for creating objects to help you pass the name of the class here. Now you can see here if all the values off this E1 dot get details in E1 dot increment are the arguments. Get E1 dot get Italy is the first attribute. Then get feudalism, name of first function. Similarly, you can see it even incrementally the secondary review here. And increment is the name of second function. Similarly, you had to create E2 object for second employee and you have to pause that this two attributes. And similarly for tardy employee after debt, Let's see how to calculate the total salary of all the employees. Now a let a variable x to store the values of all employees salary, NORDIET E1 dot E. Here, y1 is the object of first employs new Saudi. And here dot E. Dot E is the value of self dot e. Here, no need to require you to use self.age. By using dot e, you can get the value of first employees. Use LD. Similarly, you can get the second employs new cell. And after deck taught employees new survey. After that, bring the totals salary of all employees. So you can see that this is how we can calculate the salary of all three employees. And after that, we can increment their salary by 10% for all the t is employed. And finally, we can calculate the total salary of all employee by using, oops, concept. 26. OOPS CONCEPT CODE 2: In this video, we are going to discuss Python constructor is a special type of function which is used to initialize the instance member of class. It executes. Then we create an object of class. Basically there are two types of constructor in Python. Non parameterized, parameterized constructor. Let's see. First, non-fatal MI tried constructor using program to create security login. Here, you can't login more than three times. Let's see. First I will run the core and then I will explain you what is happening here. First year, I had created class width name login. And here keyword used for constructors. You can see here death underscore in it and after it underscore and you hold two in parentheses, positive value of S itself. Upper deck here in lead user to be our cause and password to be 12345678. Now let's run the code and see what is happening here. It will ask you, first, enter their username like that and then me, any username, for example, DJ, to bevel and direct. And it will ask you, enter the password. Let password to be 000 seven. Let's see what is happening here. Then I will press Enter, then it will display you. Your login failed. In John's left is 2, which means if you put your username or password, anything wrong, then you can login. Again. After deck, you can't login. Now, it is asking you enter username. So this time we are going to that the username and password correct? Leg. Username to be our costs and password to be 1, 2, 3, 4, 5, 6, 7, 8. When I press Enter, then it will display login successfully. You had only three John's upgraded. You will not be able to login again. Let's see what is happening here and see what is called behind this output. We are d equals to three for three towns. And now here we are creating new 4D. Here, luke, Phil start from three to 10 for displaying the Charles left, it will obviously go into decrease venue, username and password will be wrong in variable if we are taking user input S, enter name. And in variable B, we are taking user input, enter password. If, check if username, if condition then check if your username, which is JIRA as quote, is equal to a. The input you are taking from user. First-time I had taken input from user S. Use an MS, DJ bravo. If this DJ bravo is equals to Alcazar did output, then again it will check another condition. Boss would equally pleased to be. Here. Password equals to 1, 2, 3, 4, 5, 6, 7, 8. And bees enter password. If this password 000 712345678 is volt, this conditions are true. Then it will print login successfully. After that, it will bake, which bake condition appears, which means the programmed in big terminated. And if your login is not such as full, which means you have entered the wrong password, then it will going to check the else condition. Rarely it very display login thing. And it will print John's left equals to two j minus 1. At last. Debug equals to login. You need to only create object of class. By using constructor. You don't need to pass its attributes. It will automatically call all the function. So this is the advantage of constructor parameter. You need not to pass the attributes of the class only by creating object, you can call all its attributes. Now Nexi, example of parameterized constructor. First, I will run the code and then explain you what is happening here. It will ask you. And then MY let the name to be John pheno knowledge when displaying you, John Snow in the form of list. Let's see more discord behind it and how this output has been displaying. Let the name of class to be abbreviation. And here define death, underscore, init, underscore, self coma l. This is the syntax for parameterized constructor. Let here. After that, print L. I will explain you what is this L. Now. See vortices L. Here. L is the empty list. Now we are going to append the value into list by taking input from user add. I had run the court at starting it is asking user enter the name. The name which you are going to enter will be appended in the empty list. No, Nick C. You have to create the object of class abbreviation, which is y1 equals to abbreviation. And here we had PaaS L, which is the value of pedometer. Now with the basic difference between parametrized constructor and non parametrized constructor is dead. In parametrized constructor, you had to pass the value of parameter, which is your list inside the object of object. And you have to also pass the name of function. If you had to pass the name of parameter inside the function, varies in non parameterized. It is not required. You can see in non parameterized function, you have to not, you know, not to pass in any parameter in function. Also balancing parametrized constructor, you have to pass the baton written inside WMO function and inside the object also. So this is all about the concept of rights constructor then on parameterized constructor. 27. OOPS INHERITANCE: In this video, we are going to see some examples of inheritance. Let's see first example. You'll be able to create it a first-class with name Father. In second class with names sudden. Now the sun class will inherit all the properties from the base class. Father, his father is base class. Some is derived class. Now this derived class will inherit all the properties from base class Father. Now in class Father, we had first function with name. Get one, in which it will go into take input from user in variable self dot ey, as in their father's theme. In variable self-taught be, it will ask enter their age. Now, let's move to the class sun, which is derived class from base class Father. Now, in this class, we had created function with named get to, in which self dot C is a variable in which we are taking input from user, enters son's name by self dot d is a variable limb in which we are taking input from user, enter the age. After that in class son. Second function is displayed in which we are going to display all the details of father's name. It's eight since name and it's eight. Now, create the object of only derived class which is sent. Here. No need to create objects of base class by using object of class. Son. Who had to pass all the function names. Get one, get two, and display ads attributes. Now we're this by calling the object of the derived class, it will inherit the older properties of base class we just send. Now let's run the code and see what is happening here. It is asking first, enter the father's name. Let the father's name to be royal. It will ask you enter the lead H2B 50. Now it will ask you enter the son's name. Let the sense name to be Raj. And it will ask you enter the age. Let the age of sand to be 20. Now you can see here at the end of output, it is displaying all the details. First is Roy, father's name, it's age 50. And next son's name rot. With age 20. So you can see more need to create objects of base class fathered by simply creating the object of sun, which is derived class. You are able to inherit all the data's off basically this class as well as derived class. The next example in which we are going to calculate the employer is saving. Here. First is employee. It is the base class in which we had created a function with name gates in which we are going to take input from users and Tony enter designation and that basic salary. And after that, next classes with name income, which is the derived class from class. Employee. Employee is the base class and income is the derived class of employee. Now you'll be greeted function, get one in which we are taking input from user. Their percentage VRE was a bit jarring. And after that, here percentage, DRA and HRE, we are taking input as an input. So we have to declare first typecast it, float value, sorted. User may enter it until the percentage VR in presented a data value in float type. So we had typecast it as floor after their self dot IE equals to sell dot c plus self dot c into self dot d divided by 10 plus cell dot s2 self.view divided by 10. So let's see what is this core. Here's self dot I is a new variable, which is the total salary. And your self dot c is the basic salary. You can see, which we are taking from user input, basics, at least set.seed. And after that, this is cell to cell body. The cell body is basic salary into server DES, percentage, DRM, basics, LD into percentage, BOD divided by a 100. Now, to convert percentages DRE into numeric value, we had to divide it by 10. So this is basic salary into, wasn't this DRE after that, add basic salary into R7. So you can get output S. Total salary, offloaded, print the value of total salary. Now create another class written in expense, which is also derived class off employee you can see here, plus expenses also derived class of this class employee know yet we are creating again function written him get to in which we are taking input from user, entered the income tax among which the employee has to pay. And in next very bulgy VR, taking input, enter the loan re-experience. And arthur, that self dot h variable in which we are taking input from user enter food expense. So what is happening here? You don't logic down this is after getting total input photocell V, we're going to subtract this all the income tax among the house to pay loan debt expense and therefore the expense so that we can get that global employees Siri not saving. Now let's see. Here we had created a glass with named CV, which is derived class off plus income and expense both. Now here we had cleared it function get three. Now, self dot d is the saving among know your self dot, dot total salary. So here we are going to subtract from protons LV, this expense. Here, cell doors, saving among self-taught iOS photos. Sadly, this soundboard as f is the income tax and self dot js learn Bria expense self.age edges for the expense. So we are going to suppress this expense from DO surgery sorted, we can get the employees saving. Now we're going to print employs saving, opera that we are created object of class I when it comes to saving. And after that we are passing all the attributes here normally to create objects of other classes. S plus savings is the final data that will indirectly inherit values from other class. So you might be confusing now. So I will going to run this code and explain you what is happening here. It will ask you first, enter the name, like any limb lead firstname to be profiled. I will incurred then it will ask you into their designation, lead their designation to be HOD. After that, it will ask you enter the basic salary next, the basic salary to be 60000. This asking under percentage DRE, let 5%. It will ask you and don't bassinet HRA leg 6%. Now it is asking, you know, fuzzy is displaying here, total salary goes to 66,600. Know, this presented DRE and percentage at RA value. We'll going to add in the basic centered. So now tuples eligible becomes 66,600. Now it will ask you, enter your income tax lead your income tax amount to be 1, 0, 0, 0, 0. Now we're just asking enter your lawn re-experience. Let 500 to be laundry expense. After it is asking interior food experience, leg 4 thousand would be food expense. Now you can see here are to guess ceiling is 61,100. What is a bilinear from total salary? This all expense would be going to subtract it. So 61,100 is the final saving among. So this is all about inheritance concepts. I hope you enjoyed the concept of inheritance. 28. PYTHON PROJECT: In this video, we are going to create a banking application so that you can also create your own banking application by learning Python. Before starting this course, I will first run the group and then explain you how this banking application is working. First, it will ask you under the account number, let any account number, and then leave one until the knee. Let the name PV cell enter the type of account that it to be saving account of Kodak entered among, among to read 1000. Now it will display you account has been created. Now until the next account number. Here I am taking two details of the US from the user. So T details will be displayed. Now account number 2, it will ask you enter the name this time like Nim to be right after debt and other type of account. This time of column to be current account. Now it will ask you enter the amount, that amount to be 3000. Now it will again display your account has been created. Next I call number and account number to which he named to be Ramesh. The other type that third type of accounting to be saving and tell them out, let alone to read three times. Now after this, it will display your account has been created. Now we're doing ask you, press one for deposit and withdraw, and three for balancing quality. If you enter that choice, then this application will move further. So this time I want to deposit amount. So I will press one. Then it will ask you enter that column number. Here. The point you had to know det, a column number which you are going to enter should be mentioned in this dd. Let account number to be one. Now it will ask you enter the amount number to deposit. Lead this time I want to deposit a 100 a mountain breeze. Now, account number 1 is a name is a column within a near miss him and that type of account saving account no, it's total amount is one hundred one hundred because it is having 1000 rupees. And after I had deposited and re-purpose, it will become one hundred, one hundred. Now this time, if I want to withdraw balance. So this data I could press. So I will run the code again and then show you what is happening here. Did I call number one the name for that city among them? And that our column number, name and type. Guarding among leg 2 thousand normal again, it is asking you and better fundamental leg this demo, but number 3, four. Sitting. Now at this time we are going to go violence. For example, leg this time the economy could be two. It will ask you, Sorry, we had integers now this time we have to enter that column. What do we do? Lack a condom or duty to tell the amount to be withdrawn. A column number two is having 2000, so I want to redraw a 100 robots. So account number 2 is named Sam dipole faculties coding. And now it is having 91800 as I allele or a bizarre in 2000. And I had a widowed, a 100 loop is the net amount is 1900. And so this time, if I want to check balance equality, I have to enter the choice three. So once again, I am running this code accountable when Antonin Sen died, sitting among them, accountable to the AHG type. Current command 2000. A condiment has been created. No, again, a column number. As I am taking two liters of user, so it will ask you to name Sam rose this time. Now when did the tide to be direct seeding among 2000. Now this time I want to check balances voice through the stem. I m going to enter three. No, it velocity and dot-dot-dot and double-check them. For this demo, I want to check the balance of account number t and address three. Then it will display a radius of a complementary, complementary mean damage type of a condescending. And among his having attended, see 1000 can compare a whole number t from a search CV among these 3 thousand. So this is how we can take balancing Gaudi from any account. Now, let's see what is the code behind this program so that you can also create your own banking application? No. First I had created a class Whitney banking account. After that, I had created a function. And here I am passing constructed perimeter area. Now we are going to ask user to enter duties. Now, Salvo day for adenocarcinoma cells will be foreign DNA. So go C4, enter the type of account self-taught default, Enter Down Among. Now after this volatility to the display account has been created. Now let's move down first to understand this good. Here, I had created first empty list after-death FOR loop has been created for 30 days off customer. Now here, b equals to banking. I had created the object of class banking here by b. After that, it will automatically called all the constructor function. No need to pass the attributes of the function. After that ls dot append here, I am passing the value of b as b is the object of class banking. So all three details of customer will be saved in this empty list. Now, I'm going to display one for deposit. In the next time it will display twofold withdrawal and three for balancing quality. After that. One variable c, It is created in which I am taking input from user, enter the choice. If the choice equals to t. And 3 is used for balance inquiry. Now this time, this condition is for balancing query. If the user had entered the tree, then it will going to check balance inquiry. After that. First, I'm taking on variable account number and column number to check balance. After that. For loop to check the list of all three details. Now, first it will check if condition in which we are calling function BAL. And here passing the account number as a parameter, let's move to the function. First. Let's see, here is the BL function and we are past the perimeter S account number. So this is that example of constructor parameter in which we are passing parameter s account number here also in starting k equals to 0. If the account number which we had entered by a user to check balance is equally post to sell got a, which means it will check the details of this account number in the details provided by user in the list. If this account number match, then it will display the details of person with account number. It's me, typeof a covenant Israel and the amount it is having an account. Now, if this condition is true, account number matched, then the value of K from in starting which is 0, be incremental one. Now, this function will return the value of T S1. Now the value of two is one is positive. And if this value of Ks been passed, then value of t will increase. If that cow number. If the number here is not matched, the value of K will remain 0, which is the else condition. If the value of T is 0, then it will display a column not fun. Now next, if choices naught equals to three. The choice is equals to one. So it will move to that deposit. Starting case one. It will ask the user enter account number to deposit. It will check the details in the all three list. After that this time it will go into check DEP function for deposit. Now this account number is passed as parameter. Now this will move to the EP function. You can see here function with claimed deposit. And now our column Murray's passes perimeter. If account number is missing details, then it will ask you enter among them, but to deposit the variable a. After that, here we are going to calculate x equals to self dot d plus a. Here X is the new amount. Self dot d is the amount which is having in the user's account. And a is the deposited among, know the new amount will be increased. Amount plus deposited among. Now it will display the details of the user. And here the amount has been teens. It will display the value of x as the new amount which is deposited. Now look, value of k will be incremented to one. It will return one. Now if value of k equal equals to one, then it will display value of k will be incremented. Or if a column number is not nice to you. In this function, then value a condiment, not nice. Then we looked K will remain 0. Then it will display here S account number node found. Similarly, if a user had not entered their choice, one of three, then the next choice will be two. In the else condition, it will ask you ended the account number to withdraw. It will again move to the withdraw function this time with parsing perimeter is account number. Now it will again move to this function with federal and check if the account number in the details and the account number which enter the user on net, then it will ask you enter the amount to withdraw. Now, here new amount will be among which is earlier minus amount which read widow. Now the new amount will be printed as x with its detail. If this account number less than the value of k will be passed as fun, the revise value of k will be passed as 0. So you can see here, this is how we had created this application. Now, you hope you have enjoyed our course. Now you will be also able to create your own program. At the last visit, that tests section in which I had plotted some important quiz section, which will help you move. To summarize this course. 29. How machine learns ?: Let's see how machine lungs, there are many ways it could be closely supervised learning. Second is unsupervised learning and 30s reinforcement learning. Let's see what is supervised learning. Suppose your friend gives you 1, 0, 0, 0, 0, two different currencies. Each coin has different rates. Suppose one rupee coin VGS forgone, and $1 coin weight 50 Ohm. Now your model will predict the currency of coin. Here v du becomes feature of coins, and currency becomes labored. Venue feared this data to the machine learning model, it learns which feature is seated with which coin. It will learn. If a coin is of foreground, it will be one rupee coin. For example, if you go new coin to your system on the basis of wit, your model will learn. Supervised learning uses liberal data to train them more than Nexi, unsupervised learning. Suppose you have a dataset of cricket which includes names, schools, wickets, was beard. Then you feed this data to the machine. It identifies some pattern with one cluster having more runs and less pickets and other with more wicked and less than. So we interpreted these two clusters as batsmen and boiler. Point to note here is that Devin no labels of batsman and baller. Hence, learning is unlabeled data is called unsupervised learning. Now, next, see reinforcement learning. It works on the principle of feedback. For example, if you provide the system an image of a dog and asked to identify. If the system identify it as, get you a negative feedback to it by seeing is the major of docked to the machine. Now machine learns from the feedback. And finally, if it came across any other image of dough, it will able to identify it correctly. That is, reinforcement learning. It works on the principle of feedback. Next, the perfect machine learning solution. Let's talk about a question that everyone needs to answer before building a machine learning model. What kind of solution we should use. You should be very careful while selecting your model. If you don't, then you might end up of energy and processing cost. Next, C, factors that may help in selecting the right kind of machine learning solutions. It is based on your problem statement, your size. If data is clustered, then unsupervised learning. If data is very large. Categorical, then supervise them, also, quality and nature of the data. And lastly, it's a depends on the complexity of your algorithm. Nexi, methods of problem-solving. Algorithms are not type of machine learning, isn't the most simplest language. There are methods of solving a particular problem. First, see for classification, it falls under the category of supervised learning. It is used ven, via looking for output in the form of yes ordinal. For example, if you toss a coin, you want to know number of chances of head, then you will use this classification technique. Now algorithm used our logistic regression decision tree. Random forest. Native bees get in no Nexi, water regression. It also falls under the category of supervised learning. It is used rent data in which we are going to meet prediction is inorganic in nature. Regression technique predicts continuous is bones. For example, change in temperature or fluctuation in electrical demand. It applications include forecasting stock prices, handwriting recognition, and a caustic signal process algorithm used our integration, linear regression. And the next is clustering. It falls under the category of unsupervised learning. It is used when data needs to be organized form. Let's see some examples of clustering. Most of our recommendation technique used by Netflix, Amazon, Flipkart, uses clustering technique. Another major application of it as search engine. Search engine study all sorts history to figure it out the preferences and provide you the best search result. The important points to be noted vibe beyond learning on unclassified and degradation techniques. You all are thinking that weekend only learn the best technique and apply to our data set. But this is not possible. Different datasets are suitable for different algorithm. But by practicing and experience, you would easily be able to know on which data set which algorithm is best suitable. No Nazi difference between regression and classification. And regression and classification are categorized under the same umbrella of supervised machine learning. The main difference between them is the output variable in regression is numeric or continuous file that for classification is ghetto, clerical, or discrete. Some algorithms such as logistic revision have the name regression in their name, but they are not division algorithm. 30. Introduction to Pandas: In this video, we are going to discuss about Pandas library. It is most widely used tool for that MIE. It contains high level data structures and manipulation tools designed to me, data analysis and fast and flexible data as in store relational data. Primary data structures in Python, sound, series, and DataFrame. Pandas has lot of built-in function that can be applied directly on that. Iframe seeds. Pandas comes with default Anaconda package. First step is that I input. You have to create DataFrame and load from file to it. Now reading a CSV file. First unit to import library pandas. When you are using library pandas, we can use it by simply PV. That's why we had used as pd here. Now download a CSV file. Now we had to read CSV file, create variables df. For reading CSV file. Jews command query dot read CSV. Now how to add dataset? Go to the dataset and then go to its property, copies location. And good afternoon to make something is shorter period of a no. Show you any after coping the statement. It lasts. You have to write the name of the CSV file with X engine, you have to print voltage statement in a parentheses and by using a single quote, often lead to print this dataframe. Use the name of variable HDFN to frame the dataset. Now you can see as output data set has been printed. Now next to read an Excel file, you have to download any Excel file. And here the command to read Excel file is pretty dark. Similarly as possible, the writer Lucretia of file within parenthesis, that they'd sname using this simple extension dot XLSX for reading them, Excel file cabinet, for instance, variable D F6. And you can see output. It will display the output in the form of X15. Know Nexi, how to read a text file, create variable. Mileage or two by using P naught read table. And after that, you have to use same procedure. Like that. The name of the file, you have to reduce the actual engineer dot the two root five. And after the frame, the variable name in which you had revealed the text file. And you can see output here is the data sample is storing statement. Welcome to the machine learning. Now let's see how to create a dataframe using dictionary. First, you need to import library pandas as pd. After that, led the name of their desert to be colleagues data in which it includes different columns. The first column is data, which includes name of the, sorry, date of the event. And next is event, which includes the name of the events after that student name, which includes the name of different students. And last column is fees, which include the fees of the different students. After that, create a variable df night. Here we had used Command-A pd dot dataframe. Upper deck pause the name of the dataframe within parenthesis. You should type exactly same as I had used name of the dataframe. Here, D is capital and this capital, if you don't do, it, will show you that a term that dataset and see the output. You can see here dataframe has been created by using diction. Next C, same procedure you can do with file using capitalism. You have to enter the elements in tuple row wise. After that, you make a variable df ten, enrich us. Use beauty dot data frame. You read the dataframe within parenthesis. There typos took colleagues there haven't. This is the name of the dataframe. You can see here. I had created the data frame with name for this data, but after their father name of columns in square bracket. And you can't pass the name of colon inside the dataframe. So you have to use At externally after that, bring the obtain and run the potency of. You can see here you had created a DataFrame by using double. Now see some operations on DataFrames. How to find number of rows and columns being dataframe. First, I included the iris dataset with CSV extension. Let's run the code. And you can see here the same dataset I had use of. It is here also. I'll be, I'm seeing using this command D upon dot c to return the number of rows and columns. Then the other one is the name of the variable name. To read the CSV file. You can see here the upland is the name of the variable which we had used to read the CSV file. The same name of development you are to use here. Because we are reading the 10 frozen column of this dataset would only run the code and see don't put through. You can see, I'll put 150 is the number of rows and Phi is the number of columns. Now next command D of untoward head. It is used to return the 10 samples from the top of the data frame. Let's run the code and see the output. It will display you the ten samples from the starting of the dataset. Now next come on D7 dot py. This command is used to read Phi symbol from the end of the dataset. You can see output five samples from the angle of the dataset has been displayed. Book next, df.columns. This command is used to distribute all the names of the columns attributes. You can run the code and see output. It will display the name of on coelom attributes. Now next see multiple columns election. If you want to display multiple column elements, we use command list of columns and pause the name of list of columns within square bracket. Here we had pause the name of the column, sepal length and variety off their debt. Use HDFN, which is the name of the dataframe. Within square bracket plots the list of the column. Display particular column elements. Here list of column names. Them may involve the variable reach the head used to display multiple columns. Now, run the Korean see output. It will display the output of some particular column. Only. Know if you want to display output of that particular row. You can use her Come on, index equals to two. You can select any next year. I use Command D upon daughter. And you'll see here D7 is the name of the DataFrame. And after that, this LOC command is used to display the rules. Index is the variable to display the particular row. It's gender currency output. It fairly displayed on all the values of a particular row. No hope you have understood the concept of pandas library. Then further in next video, we're going to implement in some other tool also. 31. DATA-VISUALIZATION: In this video, we are going to discuss about data visualization. It allows us to quickly interpret the data and adjust different variables to see their effect. It is easier to understand the result by charting gov rather than reading tables or 1000 offline or draw data, our brain can understand visual things better and it helps to take the decision. Python offers multiple graphing libraries that offers diverse features. First is MercadoLibre, which is used to create 2D graph and plot. And second is Siebel, which provides a high level interface for drawing attractive and informative statistical graphs. Now see first met Godel API. It allows you to easily mid line graphs, pie chart, history, and other professional grade fingers. Using Mac door, you can customize a V aspect of a figure van used within Python. Matplot library has an interactive features like zooming and panning. Now see scatter plot in Mad Libs. Scatter plot is a set of points that represent the values obtained for two different variables plotted on the horizontal and vertical axis. Now before starting scatter plot, next event to use scatter plots, they're used to convey the relationship between two numerical variables. Scatterplots are sometimes called correlation plots because they show how two variables are correlated. For example, traffic, intensity and number of cars, number of research papers published, and year of experience. Now let us see how to draw a scatterplot. First, import pandas. And you can use pandas as pd and afterload import library mag dot, dot, pyplot. And you can use as PLT. Know, let a variable x feed stores number 12345678. And after the y-variable which stalls 10, 15, 17, 20, 23, 25, 27, 29, No, come on. P and T dot scatter is used to plot. Scatter plot. Here are the values to read after that plt.plot title. This come on, use to title your scatter plot and you can provide any title here to your cloth. Now let's run the code and see doubt. You can see here scatter plot. It is plotting. Now next, see how to draw a line graph. First import the library partners and medical LAB. After that, create a variable x in its stores value 1, 2, 3, 4, and in y-variable it stalls 51, 36. After that, plt.plot command is used to plot line GF. Here, x and y are the values of x n by two, the graph after their gender code. And you can see output appear as a line graph is plotted. Now similarly next you can see barcode, which is used to plot, present categorical data with the rectangular bars with lead proposed to a two counts that they represent. Now vent to use Marco tuple represent a frequency distribution of categorical variables. Bar diagram makes it easy to compare set of data between different groups. Now let's see how to draw bulkload. First you to import the libraries Partners n vectors. And we had created here two variables. After that. This command, plt.plot bar, which is used to draw bar plug in x and y are the values policy or after that plt.plot x label, this command is used so that you can label your x-axis and you can provide any name to your x-axis label. Here I had used excesses. You can use any name to your accessories liberal. Similarly, you can label your y-axis. And after that you can provide any title to your chart. Here I had used bar chart. You can use any other style, any other title. Also, let's run the code and see output. You can see here output of Barkow days in the rectangular form. Now Nexi pie chart, which represent your data as a so-called different categorical make slices along the circle based on their properties. Let us useful if we want to compare each categories in common scale. Now first import the two libraries, pandas and Myrtle. After that we had created a variable. First I will run the court, then explain you this pie chart. Now let's see what is happening here. We had created a variable names typhus, which stores this values. And after that we had created new variable mid stores the name of channels. Here, 40 is useful, Sony, and 50 is used for very, Z, and 16 is used for colors, and 80 is used for UTC, and 10 is used for star plus. And after that, this column is used to color this. Attributes. After that, let's see what this command to plot the pie chart. Here, plt.figure is used to plot the pie chart. And after this slice is the first argument. And after-death label, because two channels in the label, it stores the variable channels and after deck in the colors. Used. The variable COLS to color the pie chart. After death. This command is used to format your output to arrange a splices in percentage format. Now after that, plt.plot Show is command is used to show your pie chart. And as output you can see here, all the channels list has been represented with the percentage format. This is how you can draw any pie chart. Nexi. After that, that total AB. Now we can see seaborne library. Seaborn is a Python data visualization library based on bad code LIP. It provides a high level interface for drawing attractive and informative start to decode graph. Now. Let's see scatterplot. First, you need to import the seaborne library and you can use it as SNS. After that, we had created two variables, days in which it includes the number of days. And after that, we had created another variable, limb, temperature, which stores different temperature after debt. As soon as dot read Claude is the command use to two other scatterplots. After that here, we had passed two parameter, which takes the variables. From here, you can see values of days and temperature are passing the regression plot. Now laughter dead. Run the code and see the output. You can see the output as the scatter toward. You can also remove this center line by using the by making the change in the command. After passing the variable names. You can use a simple command, FIT regulation equals to false. After this, that this center line will be removed from your graph. Let's run the code and see the output. You can see here scatterplots had been floated and this center line has been removed. Now next, see how to draw lines. In Siebel. The commodity used to draw a line part is, first of all, you need not to import Seaborn library every time. You can import once and you can use in your program. The next command use to draw line towards this SNS taught Line Total is the command use to draw our input. And after it we had past year variables, which we want to display as a line proof. Let's run the code and see doubt. You can see here, thought has been plotted by using seaborne library. Next, histogram or his plot. This plot is useful for exploring univariate distribution. We can build a histogram and put canal density on it. Kernel density estimation is a non-parametric approach to get the probability function of a random variables. Now, SNS dot display board is the command use to draw the histogram plot. No temperature. Here we are passing only single variable temperature value. And after that, this command is used to display only six values of temperature. Let's run the code and see the output. You can see here histogram plot has been plotted. You can remove this current density by making changes and command here d equals to false. And you can see or put their current density has been removed. Now let's see how to draw a bar plot. Let's create a variable x in which it stores 0, 0, 0, 1, 1, 1, 0, 0, 1 variables. Now next command to draw the barcode is plot. Here we had passed the variable x. It says count the number of zeros and one and represent it to you as a barcode. Let's see the output. You can see byproducts as output here. Hope you have understood the construct of data visualization clearly. 32. DATA PRE-PROCESSING 1: Let's see what is data pre-processing. Before starting data pre-processing, let's see why data pre-processing is important. In the real-world. Data is 30. It consist of noisy values, missing values, inconsistent values. Let's see First, missing values, which means lack of certain attributes. For example, Goal equals 2. Here it is empty or none value, which may result in poor decision-making or inappropriate result when you apply machine learning algorithms. Nexi, noisy values. If your data set contains error. For example, due to program medical error or a hardware failure. This error may occur. For example, income attributes having negative value. This is the example of noisy value. Now let's see inconsistent. For example, age equals to 26. And here birthday to use this 1500 to 2000 nine. This type of values are known as inconsistent values, sometimes due to correct format of birthdate. Also, this type of error occurs. What is data pre-processing? The overall process of making the data more suitable. For data mining. It includes several tasks employed in the process to make data more relevant. It improves the overall accuracy of our dataset. Now let us see data pre-processing task. Before starting. You should note this point. It is not necessary that we can apply any technique on any dataset. Some data set is suitable for normalization technique. In semaphore standardization technique. Let's see what is normalization. It is a scaling technique and which values are shifted and scaled so that they can end up ranging between 01. It is also known as min-max scaling. Formula used to calculating organization is x ds equals to x minus x minimum divided by X max minus X minimum. Next see what is tenderization technique. It is integral preprocessing step such that mean value is 0 and standard deviation is one. For example, ageing year and wait in KG has been used in same dataset. So venue of weight is greater than it. So over model, we'll do more videos to the weight to avoid such issues. V perform standardization. Let's see some more examples to the Jupyter Notebook to explain the concept of data pre-processing clearly. 33. DATA PRE-PROCESSING 2: First import the library pandas as pd. Now if we had used variable d1 to create variable d1 of data frame, which includes column name as the last sort of nickel current FIR filter. The two where ID souls, their ID name, id for each of the names is 9, 3, 5, 7, 2, 4. And their salaries are randomly any values 123. After that, none digits represent empty value after that 654. And here pd dot NET peri is name of library pandas, which can be represent as pd now. And 80 is also a NAN value. Now you can see here, I had used one more values, 300 and Pd dot NET, which is also again one, none value. Now here role includes name of HI, Chairman, manager, secretary, employee, chunk. Here we had created variable df, which stores values in dataframe and pass all the values of d1 in the dataframe. After that, print df. And I will run the code and then explain you clearly. This is how our DataFrame has been created. Now, let's see. Data cleaning. Here. D dot is null, command is used to check the null value. Your df is the name of a variable which is used to store the dataframe D1. So we had used here df got a smell to check any null value in our dataset. Let's run the code and see the output. Here in the salary column, where all null values is present. Retail showing through the wire is null value present. Other place it is showing false, which means where it is double value present, then it will show here too, and otherwise all pays it will show, you can see here false. Okay, Now see some command to drop all the rows. Having any null value, we should use command data dot drop any x is equals to 0. And to resolve all the columns having any null values, we can use Command D dot drop NA and excess equals 21. Now, we want to drop all the rows having null values from the data set. Which means we are removing the rows, which is having any null values. Now here command you use to drop all the values of the row is df dot drop any. We had created neat new variables so that we can check it. And also our ordinal data will not affect the changes. So we had used new variable d F1. Let's run the code and see the output. Here. New dataframe is created in which all the rows having null values are removed. Now, we had used new variable df2, similarly as above, but here we are dropping all the columns having any null values from the original dataset. Now the change in command is here. Simply we have to use X's equals to one. And all the same procedure as above. But we had created yet new variable d. Let's run the code and see output. Here. You can see that we had null values in the column only salary only. You can see here, all the columns are not having less values. Only the column salary is having null value. So by using this command, we can get output in which cell read column has been removed. Now, to improve on what data set accuracy, you should replace your datasets null value by their mean value. Here, df of salary equals to d of Salary dot fill NA. Now if we had selected the columns salary, after that we are filling. Fill NA is used to fill salary column with their mean values. Now after that, we are printing the variable df salary. Let's run the code and see what is happening here. Here a new column has been generated. In place of salary. All the null values are replaced by the mean values. No accuracy of our data set has been improved. Then we will discuss core of the standardization and normalization in the last video in the project section, I hope you have understood the process of data preprocessing. 34. LINEAR REGRESSION 1: In this video, we are going to discuss what is this integration. It is a technique that is used to describe the relationship between dependent and independent variable. There are two types awfully mitigation possible. Let's do a simple linear regression. And second is multiple linear regression. Next week. What is simple, these mitigation litigation between one dependent that even at a single independent variable, I will discuss what is dependent and independent variable in the next slide. Now, next move through the multiple regression. In this equation, it is a regression, but when one dependent variable with two or more independent variable, linear regression is a supervised learning technique. It performs integration task. Then this is the equation of line, which we had used in the dense glass mathematics. Equation of light. If you know something about X. And this knowledge will help you predict about white via excess independent variable. And Y is dependent variable. That m is the slope off tonight and sees a deceptively. Now, you should clear, water, dependent and independent variables null. Next, divide depends on the value of x. Y is directly propyl similar to the venue off x. So obviously Gulf and be lenient. Good points out bloated by using the value of x, invite, diploma, some linear pattern. This time deadline source called common perpendicular distance. Well, if the values are with reference to this center line. Now, honest, when we edit a formula to calculate R-square mean edit is one minus summation of light. B minus my boss would sweat divided by summation of y minus y bar squared. Then VIPs predicted value of flight in via bodies, the mean value of flight. And y is the actual them in your flight. Know, Let's see some examples. To Jupiter notebook sorted. You may have understood the concept of linear regression. 35. LINEAR REGRESSION 2: Here we need to import library NumPy. V can use numpy as np offered. A second module is SKLearn. Now from SKLearn dot linear model, we have to import linear regression. This is the common library which we are going to use for linear regression. Now you have to use exactly the same as I had type this line. Otherwise, this will show you enter to import this library. Here, Ls capital and r is capital and all the nitrous acid module. Now let's move on. Here. V had created a new variable x by stores pier np.array here np is represent NumPy, which we had declared earlier. Now this command np.array is used for creating an array. Now we are passing values 5, 15, 25, 35, 45, 55 to the x. And after that we are reshaping it. Here. We had to require a 2D array. It will create single column, then it will create a single column family here minus 12 is dead. It will include all the rows. Now, y equals 2 np.array, which and includes value phi 20143220 to 38. Now let's print the value of x and see the output. Now you can see here the value of x. First aid, it is showing error. I will run the code again. Now it will not show it. And let's see the value of x. It includes a 2D array, and you can see the output of X here. Now similarly, you can also do item display the value of viral. So here you can see here value of vi has been displayed. Now we are creating a model for linear regression. Now after that, we are going to fit this model. And by to fit this model, we have to use command linear regression dot fit. And v are x and y are the variables which we had past of x and y values. Now, next step, we are calculated R-squared by using Command score. And we're passing here x and y. Here. R-square is also Cola's coefficient of determination. Now let's print the value of R-squared. Then after that, print the value of intercept by using Command intercept. I'm now similarly you can append all so the value of slope by using the command coefficient. Let's run this statement and see the output. It will show era because I had not run the block of code. Now you can see output here. Coefficient of determined value of R-squared is 0.7158. Next, the value of slope is 5.6 333. Now after that, you can see the value of Soviet zero-point five-fold. Now, to predict responses, we had use command via predict then which we are past model.predict command is used. This bold statement is used to predict the value of y, and here it is compulsory. You have to use the value of x only up to that print statement predicted response. And also print the value of vite predict. Let's run the code and see the output. You can see the responses are predicted. And if he had positive value of x and we get the response of vibe in the form of 8.3313.73 and so on. Now, new data prediction VIA checking how our model works for the new value of x. So that we can get the accurate or data prediction so that our prediction will get a curator. Now we are creating a new variable of x in which we are parsing np dot arrange. First, I will run the code and then explain you what is happening in this state. Quote. Here. It has created a 2D array with five values. So basically when we are parsing using command np dot, arrange and passing phi, then it will create a 2D array with five values starting from 0 to four. Now next, we had created new variable via new in which we are passing command model.predict. And now here we are passing the new value of X. And after that, print the value of y new. Now from the code and see the output, you can see output for the new value of x. Our dataset had predicted the value of y new for new value of X. New value of y has been predicted by using the same pet, which we had used earlier in this modelled via predict. And we had positive value of x. It has seen the same pattern. And according to debt tighten, the new output has been represented. Now hope you have understood the concept of linear regression. 36. LOGISTIC REGRESSION 1: In this video, we are going to see what is logistic regulation. It falls into the category of classification method. It falls under the category of supervised learning also, it is same as linear regression. It is used when we are looking for output in the form of yes or no. Let's see some of example of logistic regression to Jupiter notebook so that you can understand what is logistic regression clearly. 37. LOGISTIC REGRESSION 2: First we need to import the library NumPy, offered it Pandas. And after that import library linear model. Basically this library is used for logistic regression. Let's run this cell. After that load the dataset. Here we had created data variable for storing the logistic regression data set. Here I had used logistic regression data set with CSV file link for this dataset I've mentioned in the description. From there, you can download it easily. Now I'm printing that does phi simple. Let's run the code and see the output. It is generating random sample of the dataset. In this dataset, all numeric values. Agenda is containing string values. We are going to make this gender also in the form of numeric, were male equals to VR, assigning male equals to 1. And for female we are assigning 0. Let, let gender is, is a new variable. Then let this command pd dot get dummy is used to create agenda in the form of 01, in which from data we are selecting column gender. And after debt we are printing the variable gender. Let's print the gender and see what is output. You can see first, draw fors equals to true. It is used to make the drop first equals to true for the first value as male equals to true. So molecules too well will be displayed as output in the form of column. After that, you can see here genders column in which male has been assigned value 14, female we had assigned value is 0. Now, we are going to add this column in our dataset so that we can co-locate it. Now, data is the name of variable in which we are going to can concat it. Accurate data is the name of variable in which we had load the dataset. And now in this dataset we are going to concrete the column male equals male. So basically here, we had used the command to concave, concave. Up after that. Here, x is equals to one. And that this whole command will help to add this middle column in the original dataset. Let's print the data and run the code. After I will run the code, you will be able to understand what is happening here. Actually that this male column has been added to the original data set. After that, this inside the original dataset. Here, gender is not required at this containing string values. So next step we are going to remove this column gender. Now we are going to use Command data dot drop. In which we are dropping the gender column. And after that we are printing data. So let's say how our data has been changed now. Now you can see that in our dataset now gender column has been removed. Now our dataset contents all numeric value. Now, we had created a new variable X, in which we are taking height in x-variable from the dataset, we are taking height in the x-variable and male columns value in by variable. After death. We had created a new variable a, in which we are using a linear model dot logistic regression. This command is used to create a model of logistic regulation. After debt, we are fitting the model logistic regression. And here we are passing the values of x and y variable. Now run this cell. After that. What we are going to do here, we are passing the value of height. And on the basis of the value of height, we are going to predict the value of gender, whether it is male or female. We are passing the venule fight. And from that dataset, it will check whether it is male or female. So the commodity used here is via predict equals to a dot. Predict. Here is the variable name which we had created for the more than logistic regression. As you can see here, is the model in which we had created logistic regression. After that, print the y predicted. Now you can see here on the basis of value of height, we are getting output in the form of male and female. Now, let's check this in terms of poverty. What is the probability of our production? We had created our variable pro bed, in which command for puberty is a dot predict problem t. And here we are passing the value of x. After that print the variable program. Let's run the code and just see the output. Here. It will check, it will take the value of VI predict first. But after the, it takes the value of height and basis of fight. It had predicted the value of Y to predict in the form of male and female. So here for first outputted is made. So here in the left side of the output of quality, it will check not the probability of male. And on the right side, it will give you output the probability of male, the left side probability for naught men, and on the right side for beauty for me. So first output is one, which means it is male. So probability for naught Mel will be very, very less. So it is 0.005 and probability is male. So the output for probability of male would be higher. So it is 0.994. And then next output is also male. So from this value, it will check the probability of not male is 0.158. And after that, it will check the probability of male is 0.84. And similarly for all the values or by predict, it will check the property of naught male and property of meme. Now let's check the accuracy of our dataset. Now we had created variable a QC equals 2. Now here, a dot score is the command for accuracy. And here we are passing our variables X and Y after the print accuracy and see the output. Now you can see here output of our dataset iris is 83 percent by using the algorithm of logistic regression. Now, hope you know when to apply the logistic regression. 38. KNN ALGORITHM 1: In this video, we are going to discuss KNN algorithm. Knn is also known as k-nearest neighbor. It is used when the amount of data is large. When there are non-linear decision boundaries between classes. Knn can be used for both classification and regression predictive problems. However, it is more widely used in classification problem in the industry. It is commonly used for, It's easier interpretation. Anglo calculation time. Nexi. How does Canaan algorithm works? First, think we need data set for input of our program. After that, choose the value of k such that the nearest data point k can be any integer. After that, calculate the distance by using the distance formula we had studied in the tenth class mathematics distance formula. So we are applying here the same formula year. Here, X-bar is the first and a B is the second. And we are calculating it by under root x minus a whole square plus y minus v squared squared. After finding the distance, find the closest neighbor. On the basis of closest neighbor. Vote for the labels, and we get the output. Now next, see one example. How does k-means algorithm works? In the first image, initial data is given. Here two classes are given. Class a. Width red star has been presented in class B, has been represented by green triangles. After that. In the second image, calculate the distance from the center, the all the nearest element from the both classes, class a and class B. Calculate the distance from the center to the, all the nearest neighbor. And then next, image, finding neighbor n, voting for labels with value of k equals to 3, which mean select closest three element. On the basis of distance, calculate smallest three element from which two elements are of class B. So major table of elements out of class B, hence, output will be b. This is the concept of kNN. Output will be decided on the basis of value of k. Let's see applications of Canaan. Following other some of areas in which KNN can be applied successfully. First is banking system. Second is politics. And third is the calculating credit ratings. In next video, we will discuss some of examples of kNN using Jupyter Notebook. 39. KNN ALGORITHM 2: Let's see how good an algorithm works. First, we need to import libraries such as Pandas and NumPy array. After that, we need to import our dataset of the iris and from which we had taken some of the samples of that asset. After that, before starting this KNN algorithm. Some points you should remember. First is using the same data for the both training and testing newsroom for miscalculation does increases the chance of inaccurate prediction. There training test function allows you to break the data with ease while pursuing an eigen model. Also keep in mind that your model should not be overfitting or underfitting. Let's see what our overfitting and underfitting. First, what is overfitting? Overfitting is a situation when a model shows almost perfect accuracy. Then handling training dataset, this each person that had done when the model has a complex set of fruits and the model is overfitting. It can be inaccurate when handling new data. Nexi what is underfitting? Under fitting is when a model does not fit the training data due to a set of rules that are too simple. You can't really on underfitting model to make an accurate prediction. So these are the points you should be noted. After that. Let's create a new variable X, in which we are storing the phosphor column of data set. Phosphor column of datasets on sepal length, sepal width, petal length, and petal width. After that. Then VIE variable storing the last columns, all values, last column names. You can see here variety. And via story, all the values of variety in the variable Y. Let's bring this cell, run the system. After that. Let's see how to split a model from SKLearn dot mode oscillation import train test split. This is the library which you are required to import for using the train test split function. After that year. Extreme extra variable is used for training purpose, and x variable is used for testing purpose. They are vibrating is useful. Vice, training purpose then bite testes, useful y-variable testing purpose, which is equal to train test split via passing the variable of x and y to this thing as spread function after death, we are providing that test size equals to 0.8 t, which means it will take 80 percent of data for this testing purpose. And remaining 20. Egn 4 is training purpose. Next, move to the further after that applied KNN. Let's see how to apply cane it. First you need to use the library from SKLearn dot neighbors import k neighbors classifier for using KNN. Run this block after debt. Knn is available in which we are using k neighbors classifier. And here you have to provide the value of k. So here I am providing the value of k as three after that. Third them model. Here. You have to provide every time the value of extreme and vibrate only. This is fixed, you can't change it. Now to predict by via predict VL to use Command KNN dot predict. And this is also fixed for predicting value variable. You are to pass every time the value of x test only. Not predict, print by predict. Let's run the code and see what is output. You can see on the basis of variable of x test, y predict has been made. Now next move on. Classification report. Here, TP variable is used for two positive and FP for false positive. Now see what is precision. Precision is a courtesy of positive prediction. Formula to calculate precision is true positive value divided by true positive plus false positive. After that, let's see what is recall. Recall is sensitivity or true positive rate, which is also equal to fraction of positive two, are correctly identified. Formula to calculate recall is true positives divided by true positive plus false negative. Now lastly, C, what is F1 squared? And how to calculate F1 squared? F first query is equals to two times of precision in to recall divided by precision plus 80. Now, to import classification report, we have to use the library from SKLearn dot matrix important classification report, opera that print classification report. And here we are passing the value of phi test and a byproduct. Let's run this block and see the output. You can see here output for a season value for setosa versicolor and virginica. First of all, setosa versicolor and virginica are the element variables, all of the column, where IT ALL are the elements of the column variety. On the basis of this setosa, versicolor and virginica. This isn't values are shown here. For cytosol, a 100 percent precision, for versicolor, a 100 percent precision, and for virginica, 95 percent precision are now you can see also recall value for setosa is a 100 percent and for versicolor is 95 percent, for varsity case a 100 percent. Similarly you can see for F1 score. Now lastly C. What is the accuracy here? Accuracy is 98% for our dataset, iris on the algorithm KNN. So hope you will understood how to apply KNN algorithm in machine learning. 40. DECISION TREE 1: In this video, we are going to discuss what is decision tree. Decision tree algorithm falls under the category of supervised learning. And it is the most powerful and popular tool that is used for classification as well as prediction. Now let's see what is decision tree. Decision tree is a flowchart like tree structure where each internal nodes denoted test on attributes. Each branch represent an outcome of the test and each leaf node holds a class label. This process of finding the most informative feature is done until we accomplish a stopping criteria where V Then finally end up is so-called leaf node. For example, we are taking input from dataset, which consists of its gender and occupation. Here phosphorylase, root node, and second node is in the area node. There may be more than one interior node depending on your condition. And the last mode is leaf node to which we can get outcome. Here we are going to check does the person likes computer giving after input From dataset, it will check the first condition, age is less than 15. If false. Then this group of people don't like to play computer games, especially unless belong to this group. After that. If the condition true, then it will check next condition whether the gender is male. If no, then these group of people belongs to the girls with prediction score 0.1. If yes, then this group of people that are made with prediction score two. Okay? This is how decision tree algorithm works. Let's see. Algorithm used. First is ID3, secondaries, guinea index, 30s chi-squared, and 40s reduction invariance. The core algorithm for building decision tree used is called ID3. Id3 uses entropy and information gain to construct a decision tree. Now let's see how to calculate decision tree formula used to calculate distances trees minus of summation, where Jay started from one to see probability of c of j into log base 2 t P off feeding, where C is the set of desired class. Then this formula is no need to learn. We will use it in the core. Well next. In the next video, we will going to see some examples of decision tree towards Jupiter Notebook. 41. DECISION TREE 2: Let's see some example of decision tree through Jupyter notebook. Here. First we are importing essential libraries such as pandas, magic, lot, LIV, dot, py, Autodesk, PLT, and three library for decision tree. And now credit VaR reporting, train test split. Let's load the dataset. Here also, we are using the same dataset, eyes dot CSV, and print that dataset. You can see a data set has been dysphasia after death VR creating variable X, which sores though, first four columns, sepal length, sepal width, petal length, petal width, and invite variable. It stores the value of last column where IT after deck. Next we are going to split our model by using the library train test split. Here we are applying the same code as in the previous court KNN algorithm, but here we had made the change to the test size. We are using 40 percent data for testing purpose and remaining 60 percent for training purpose. Now, let's see how to fit the decision tree model. We had created a variable model. Invest, come on to form model. Decision tree is tree dot decision tree classifier. After that, you out to specify here value of criterion equals to entropy. You can use any other algorithm also here of decision tree. After that, fit the model of decision tree. And predict the vibe and pass the y predict in which we are going to predict the model. And after that, print the value of phi predict. This three lines are the same as in the previous school. So I am not repeating it in detail. Let's run this block. First. I need to run this bloke also, which I had not run. Now you can see here display output of y predict has been displayed. Now to come out to plot decision tree. Here, plt.figure is used to adjust the size of your decision tree graph. After that, we had used variable effect in which we are passing the sepal length, sepal width, petal length and petal width. And the variable in C and we are passing setosa, versicolor and virginica. And after that, this command 3 dot plot tree is used to plot the decision tree in which we are passing the model. It will take the name of model. After that feature name equals to f and v are assigning fn feature name. In the afternoon class name we are passing CN. Let's run the code and see the output of Decision Tree, how it looks. You can see the output of Decision Tree for the data iris has been displayed. You can see the output from this form. Output will be represented. Now you can also check the accuracy of our dataset by using classification report library. Now, print classification report and checked outward. You can see here preseason value, PRC2 size and represent for versicolor is 90 percent. Fertilizer, teeny car is 91 percent. Similarly, you can also see the values or recall when score. Now your accuracy of our dataset is 93 percent for Iris dataset on the decision tree algorithm. So hope you understood the concept of decision tree. 42. NAIVE BAYES 1: In this video, we are going to discuss what is their risk algorithm, which is based on Bayes theorem, which states that for two events, a and B, if we know the conditional probability of B given a and the probability of B, then it is possible to calculate the probability of a given P. Now you can see the formula to calculate probability of a given base here, in which a given B is the likelihood of event a occurring. Given that B is true. That is, B given a. Is the likelihood of event B occurring given that a is true. After that p.ball off AMP, via the poverty of observing a and B independently of each other. This is not miss marginal probability. Next thing, what is new base algorithm? It is a classification technique based on Bayes theorem with an assumption of independence among predictors. In simpleton, nail Bayes classifier assumes that in the presence of particular feature in the class is unrelated to the presence of any other features. Even if these features depends on each other or upon their existence of other features, all of these properties independently contribute to the probability of class. And that is why it is known as name. Let's see an example of Bayes theorem. Here, given that two bags, each one has red and white balls here two bags are given baggy. Bag B, hey, contains three, write a morning setting likable. Whereas bag B contains five red and five I'd pose. Both bear how equal chances of being chosen, which means 12 for selecting bed is been di2. And predict for selecting bag B is also one by two. If a ball is pivot, I turned up and found to be red. What is the probability that the ball was chosen from bag a? Now, total probability of red ball is equals to p of I, equals to probability of a boy from bank a. In bag a, there are three red balls and total number of balls are ten. So poverty of selecting a red ball from baggies, C divided by 10. Now for selecting bag a, as it is mentioned in the bag, l, equal chances of being chosen. So probability of B of bag is one-by-two. After that, how selecting random bowl from bag B, there are five volts and total number of moles are 10. So probability of selecting a red ball from Bank B is five divided by ten. Phi are the red Bolton photon and Barbosa 10. Now selecting probability of bag B is one by two, as it is mentioned in the question, both that out equal chance of being chosen. So for selecting bag a one by two and for selecting that be also one by two. So property of Red Bull selection is total eight by 10 t. Now we have to find what is the probability that the Volvos chosen from debt a. Now property that red ball falls from bed a p of a divided by R. This is the probability of Red Bull was from back. Here, property of a, which means probability of selecting at random all from beg, a into poverty of Bell selecting bag a divided by a probe TO selecting writeable. So property or selecting red ball from beg, a is, you can see here t by 10, probability of selecting that is one-by-two. And property for selecting red ball is a two by two and p. So after putting all of them, I guess vk dot put S, SHE by eight. Now next, see what are the applications. First obligation is text classification, such as junk email filtering. Or you can also say that spam filtering of image net. Second is intrusion detection in computer network. And 30s, diagnosing medical conditions given a set of observed symptoms. In the next video, we are going to see some examples of through Jupyter Notebook. 43. NAIVE BAYES 1: In this video, we are going to see some examples of new base. Here. Goshen and B implements the new base algorithm for classification. You can see here cohesion and B has been used to represent Nao Bayes algorithm. You have to also import pandas library classification report, train test split function. Let's run this block code after death. We're using here the iris dataset, which we had used earlier. So you can see an output of Iris dataset has been displayed. Now next, we are creating variable X in which we are sewing. This command is used to store the first four columns value in the x variable. Sepal length, sepal width, petal length, petal width in the y variable. This command is used to store the values of last column in the y-variable. Now let's print the value of x and y. And you can see here output. Now you can see here I'll put off, thanks has been displayed. And after dydt output of y has been also displayed. Next, let's see how to split our models. The code has been similar as we had done earlier, but here the change we are making is test size equals to 0.40, which means it will take 40 percent of dataset for testing purpose and 60 percent Remaining for training purpose. Now let's see how to fit our model. First, you are to create a variable model in which you have to call the function goes in and b after that command to fit a lot more than Gaussian and B. After I WO to pause here, the extreme end migraine. Lastly, for predicting when you violate predict by predict via using command model.predict tiny LV or passing X test. This command is used to predict the value of Power BI. Let's run the code and see the output. It is showing error as I'd not run this block of code. I will done then this error will be good. You can see here output of vipers, it has been displayed. Now let's check. Go to sea of orders dataset using classification report and the EMBL passing value of x test. And by predict legs run this block. As you can see here, precision value for setosa is 100 percent and for versicolor is 100 percent, red is for virginica is 92 percent. Similarly, you can also see recall value and F1 score. And thus be our accuracy for our dataset is 97 percent. By using Iris dataset on near this classifier. Hope you had a enjoyed this plumbing. The base classifier. 44. RANDOM FOREST 1: In this video, we are going to discuss what is the random forests. Random forest is a supervised learning algorithm. It can be used for both classification as well as the regression. It is also the most flexible and easy to use algorithm. A forest is comprised of trees. It is said that the more press it has two more robust a forest is, which means as the number of trees increases, speed of processing, speed of random forests will be decreases. Random forest create decision tree on randomly selected data samples, get prediction from each trees and select the best solution by using mean or 40. Then, then thought is composed of multiple decision tree. By averaging out the effect of similar decision trees, random photos tends to improve the prediction. Let's see how does the random forest algorithm looks. It books in four steps. First step is random subsets are created from the ordinal data set. And second is at each node in the decision tree on the random set of features are considered through beside the best split until the stub is, our decision tree model is. But then on each of the subsets. And last step is the final prediction is calculated by averaging the prediction from all their decision tree. In next video, we will see some more examples of an unknown photos by using Jupyter doesn't know. 45. RANDOM FOREST 2: In this video, we are going to discuss about random forests examples by using Jupiter notebook. Let's see some examples. First, you need to import the library partners. And after debt, you were to import the library train desperate, run this code block. After that, you had to use the data set iris so that we are using here same dataset so that we can predict that courtesy of our dataset by using different, different classifiers and algorithms. Let's run this block of code. After that, we are creating here variable x. Similarly as the last program of NAOH base we are using here also here x-variables tools. The first four columns, all values by using this command. And in Y variable, by using this command, we are storing them only last columns all measure. Now let's print x and y and see the output. You can see here output of X has been displayed. And after debt here now, the value of y has been displayed. Now next, let's print our model. Here we are using the same code, but here we are changing that test size. Now this time we had used 73% of data for our testing purpose and remaining 30 percent for the training purpose. Let's run this block of code. After deck. We are using random forest classifier. For importing this library, you have to use command from SQL endoderm symbol, import, random forest classifier. Let's run this block of code. If there is any error in the spelling, then when you run this block of code after that, it will show error. If not any error, then this block of code believing executed without showing any error. After that, we are creating a variable CLF, in which we are going to call library random forest classifier. And here we are passing the value of an estimator equals to 100. You have to use same variable. In my opinion, if you change, the output will be. So some changes in output. Now we are going to fit our model by using the command clc. Don't fit in which we are passing the value of extreme and the bitrate after it. We are going to predict our model by using the command CLF dot predict, in which we are passing the value of x test. Let's run this cloak of code. After that, we are using a library function as from SKLearn dot matrices import a QC. We are going to calculate accuracy after that. Now we are going to print the QC and using the court accuracy and the score, score. And here we are passing the values of y predict and white test. Let's print and see the output. You can see here that the currency of our data set has been displaying 94% for Iris dataset by using random forest classifier. Hope. You have enjoyed the random forest. 46. FINAL PROJECT : The aim of this project is to summarize the old concept which we had learnt in lung sorted after completing this course. You can also develop your small mini-project. Let's start. First. Import the necessary libraries like pandas, mat good, LIB dot, pyplot, numpy, random forest classifier accuracy score, R2 score mean squared absolute data. Kidney of the classifier three, decision tree classifier, classification report. Logistically degradation. Matrix goes in. And now let's load the dataset and the description link for the desert I had brought it from that you may download it. Now we had collected variable that by the NEA data to load our dataset, which is all format dot CSV. After that, here we are going to display, well simplest from our data set. Let's run and see how over the dissector, it will show you this type of edit because you had not turned the first second block. If first second block will run properly, then it will display you output. Now let's see here. First column is pregnancy. Second is glucose 30s blood pressure for this skin thickness. 50s insulin is BMI, 70s diabetes, pedigree function. And eight, this is in last one is outcome. Here, 100 present diabetic and 0 represent non-diabetic patient. Let's move to further. They'll come on. That dot dot shape is used to represent the number of rows and columns of older. Just say, they're grander cord. Here, 760. The rules are present in our dataset and vet has nine columns are present. In order to say. Next, this command, dot-dot-dot describe is used to describe our all the tons sorted our projects quite better as well in well presented manner. Let's see. You can see a column will display you number of rows in all column you can see. And after that, mean wind display you the mean value of particular column. In pregnancy, mean value of all rules will be displayed similarly in glucose and all other columns. Now has to DVI display standard deviation of particular column. Standard division value of 3000 column is 3.1 in pregnancy. And for glucose 21.97. And similarly for blood pressure, skin thickness and all. Now, minimum will display the minimum value of particular column. So you can see in pregnancy, minimum value is 0 in glucose also in blood pressure also, and skin thickness also, which means all of datasets are having 0 values. Some guides 0 values. Now you can also calculate 25 percent value of particular, 25 percent times particular value, which is going to repeat in particular column in pregnancy, one is going to repeat 25, 45 percent times, whereas in three will be going to paid 50 percent now similarly, you can also calculate maximum value of all columns in pregnancy, maximum value is 17. Your glucose metro and Val is 199. In blood pressure, maximum value is but 22. Similarly for other column also, you can calculate the maximum value by using the metadata describe. Now next, if we wanted to check is there any null value present in your dataset, then you can use this command to calculate whether there is not a value or not. Let's run this block and see the output. You can see here it does the spring force, which means our dataset is not having an invalid value. Now next, we had created very variable diabetic know yet Len function is used to calculate from the column outcome how many times 1, 1 is occurring. It will display you total number of times. This commandment is paying total number of times from the column. Outcome. One is a video. Now, next variable is known diabetic. It will display you number of times 0 is occurring in the column outcome. Now we are printing diabetic and learn them. Let's run the code and see the output. You can see 268 times. 268. Patients are suffering from diabetics versus finer divisions are suffering. Fired peoples are not suffering from diabetes. There's a boarded assumes that the data is unbalanced. The number of non diabetic patients are 268 and the number of diabetic patient is 500. Now, next we are going to present this data by using CBO lighted library. And we're going to plot count float. It's done this block of code. Here, x will store the column of which you're going to describe using count clock. And your data will take the data for this conflict. Sawyer, we are taking the variable name of data, which has been used to load our dataset. And you can see here. Variable name is data. To load our dataset from data, say it really take values and data. Now yeah, 0 representing the model non-diabetic patient and wonder present in number of diabetic patients. Now you can see here non-diabetic whose 60-year and diabetic 500. After that, we had created two variables, x and y. In x VL storing all the columns except the last column in divide via storing only the last column, the new outcome. You can also convey from the vector, say, starting from first all the columns except the last one. We are not including last column in the x-variable and invite variable we are using or liver last column outcome. Now let's move on. Then this book of core. And after that, we're going to check which attributes are highly correlated to each other in a one data set. Seaborne library also includes heat map, which I had not discussed. Data visualization. So here I am explaining what is heat map also. Now he had come on as an represents seaborne library and heatmap is used to represent heat map. Now, this command, source dead. We are taking all the columns from the dataset except the last column. And after that, dot CORS is used to display the qualitative values using heatmap. Not plt.plot show command is used to display the graphs. Let's run this block of code. And you can see here, hi, how to visualize this gulf list. In the heat map. This is right-side vertical line basaltic quantitative value in color from top to down, correlated values decreases. Going down a source highly correlated value and debt current source locally into the values. Now you can see quoted values from diagonal above triangle, and also from the diagonal below triangle. You can compare core return values from both above the diagonal and below the diagonal. We are considering here below the triangle. Along diagonal, you know, if any attributes are and high liquorice debt, that its value would be poor stolen, but near about one. But all values, you can see in all column, all values are too small, which means they are not correlated to each other. You can see. So here not enough or what attributes are highly correlated in this data set? If any attribute is highly correlated, then you have to drop it or remove it from our dataset to improve our datasets accuracy. Now, next, move on. Now, we are going to use one of the technique of data processing, which is standardization. I had not expending any program a level of centralization. So here I'm explaining standardization. First, import the library standard scaler for Standardization by using command from SKLearn dot preprocessing import standard scalar. Now you have a sturdy variable is used for modern standard scalar. Now, new variable q is used to create a dataframe, insight dataframe. We are going to feed them more than standard scaler. And here we are dropping the column outcome. We are not applying standardization on outcome column. After that, mentioned all the names of column inside the dataframe. And run this block of code. Next Q dot head. This command is used to display five samples of data from, from the top. Let's run and see the output. You can see here some dot phi simple dataset has been represented to understood output water again, the standardization theory from data pre-processing video of Dustin decision, accuracy of our data will be improved as compared to a layer. Now the question creeping out of this, somebody is dead. On this column. A value of 0 does not make sense. And this indicates missing value. Following columns or variables held invalid 0 values, pregnancy, glucose, that pleasure, skin thickness in Sweden, BMI. Now we're going to count number of missing rule in all the columns. First. Bank total number of rows. By using length function. We are going to calculate the length of variable data stores data of diabetes are now this next column, sorry, next row, number of rows missing. A year, we are going to calculate length of column pregnancy value equal equals to 0. Similarly next, also we are going to calculate length of the column glucose. Very value of glucose is equal equals to u. And similarly for all other columns, also, know then this block of code and see the output. You can see here total number of rows on in our dataset 768. Number of missing goes for pregnancies, but similarly for glucose concentration phi, blood pressure to define skin thickness two to seven for insulin, 374 for BMI 11 and ages having no missing value. And diabetic or degree function is also having none of missing value. Not to fill the missing value rose. The data distribution needs to be understood that here we had greater variable p in which we are going to plot a histogram floored by using Command and Data dot hist. And to adjust the size of figure, we had used FIFO size equals to 20 comma 20. And they'll run this code. Now you can see here, I'll put off by using histogram dots, you can compare all your different attributes. You can see here different attributes. By using histogram plot. Now, we are going to replace missing values by the mean values. Here we are using library simple imputer to replace missing value by the mean value. We add character to impute a variable in which we are calling simple imputer, in which we are replacing missing value Z, which is equals to 0 by the mean value. So DEX file here to mention the other strategy equals to mean. Know that tau equals to employ dot dot, dots. From here, data is the name of variable. What is no dataset in which we are going to fit up? In filter function. Which means nada about ordinal data set will be going to reflect missing the loop 0 are going to replace by their mean values. Nobody had created new variable that Dava enrich variable and read data equals data, the source data. This data is the change we have made off that it pleasing them mean values. This data is this. Now, you have to mention the name of columns inside that DataFrame. I had mentioned the oil, the names of column in the DataFrame. Null. Next we are going to display a lot of data in which we are going to split 50 samples, nights and Dakota, and you can see I'll put in 50 simple said has been presented in which none of any value is 0. You can see it. None of the value is Yahtzee. You can also check missing value again by using the same command. But here we had teams of data. I believe it was data, which was our original dataset. Now this is the new data which we heard created by replacing the missing values 0 by their mean values. All the place where data was there a live near the visit by data when you can compare this one from the aliyah court also, you can see here that Eddie he had was data and the older rows. And now if we had changes to data one null, then a John Doe discord. You can see here I'll put. Number of missing girls in all plays out no 0. Which means all missing values are now removed from our data set. Now again, we are going to visualize it by using histogram plot. Now this time we are going to plot histogram on that note underscore. And you can see histogram plot. Now you can see again histogram plot, which would be quite different from the allele. Now next we are going to split our model by using the library train test split. We'll be at providing test x equals to 0.2, which means 20 percent of digitized provided for testing purpose and 80 percent of data is provided for training purpose. Now he had an M state equals to 10 sorted. They would get exactly same the loo every time when we run the court, output remains same. That's why we hit provided random state equals to 10. You can provide some, any other random state in which value might be some teams. Let's run this block of four. Now we had a VR applying different algorithms in comparing which classifier is best suited for our data set. Now, borderless logistic regression. And we had protect them more than logistic regression by extreme inviting. After that, we are predicting the model by creating white predict and passing only the x desk value here. After the print the value of miniature data are due score error. That gives you off logistic relation. And lastly, we are going to bring the classification report. Next, run this code and then explain you clearly. Yeah, mean absolute error is 0.23, R2 score is 0.01. Accuracy of logistic regression is 76 percent. Now, you can also compare classification report here for outcome 0. This is an is 75 percent and the footwall, this isn't a given person. Similarly, recall is 93 percent 400 com, and the call is 51 percent for one outcome. Similarly, you can convey for F1 score also, not accuracy by using the command. Classification report is 77 percent approx. Now next, similarly, you can apply on gate nearest neighbor, which is also known as KNN. Here, index is the variable use. Your index is the variable used to create list. It will store ten different values. After death is the variable, which is the coastal period Arts Series. B. Series is used to command to create DataFrame from Pandas library. The next x equals to 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, which is used to draw blood for different values of gain. Now via FOR loops start from vital. We are created more than four Guinean and operated weird passes the value of k, s. I mean, it takes the value of i from the for loop and it will start from 1 to 10. Now after date Vered for debt our model. And next, the elect, a variable in which a dot append this command is used for pd dot Series in which we are appending all the values of accuracy. Now to calculate accuracy, commodities matrices, thought accuracy score, which we are passing the values of I predict and by test after dot plt.plot. Here we are plotting graph between a Keirsey, which is a, and here a dot index represented different values of K. Now after that, PSU dot x dx, here of what x-axis dot from 0, 1, 2, 3. We had used the excess 0, 1, 2, 3. Usually all graphs start from 0. That's why we had used the value of X is 012345678910. After that plt.plot Show to display the graph. Let's run this code and see the output. You can see here on the x-axis of output, value of accuracy has been disappeared. On x-axis, value of t has been presented. Then 1, 2, 3, 4, and 5 give illustrated and extract it, start from 0 for different value of k. Accuracy has been disputed. Now next, similarly, you can calculate Mean Absolute Error, R2 score accuracy for different values of an NHL. In the previous algorithm, I had not understood you how, how this miniature parallel R2 score has been calculated. In the starting only I had used the library for using mean absolute error than R2 score. Next, I will show you here we had imported a library for R2 score and mean absolute error. And after that, here via using to calculate Mean Absolute Error and R2 score area. You can see here. Now we can calculate mean I threw in August for a lead. Also, you can calculate accuracy by using the command of accuracy or non. Finally, we are going to compare classification report. First I will run this block of code, then extend UPN minutes, blueberries, zero-point even R2 score at least minus 0.3 to this Edit should be minimum. To improve accuracy. This value for B minimum as minimum as possible. Now, accuracy for different values of K has been represented here. Now you can see classification report for outcome 0. Pitches in value is 70%. For outcome 1, precision value is 65 percent. Similarly for recall value also you can compare it. Now accuracy by using classification, report it 69 percent. Now next we're going to see this decision tree algorithm. Here we had used variable model to call the decision tree classifier after there to be a fatigue the model, model of decision tree. Next we are going to predict the model by using variable X test. Similarly as uglier done, we are going to calculate magnitude data are two squared error and accuracy of decision tree by using Command Metrics got accuracy. Now next, I've run this block of code. You can see absolute error is 0.29 are two squared error is minus 0.2. And Keirsey of decision trees 70 percent. Now you can also compare this accuracy by using classification report algorithm. You can see present value for 075% and for outcome one 63 percent. Similarly, you can compare, recall fn school. And now accuracy by using classification report is 70% 71. So now next see there are none forest classifier. We had created variable ClO to call the random forest classifier. And he had an estimator value. We had provided a 100, you can use also 200, 300. And so update veered fitted the model random forest by passing x-ray and enlightening values. And lastly, we are going to predict our model on the basis of excess value. Next. Similarly, as we are going to pin mean a tutor or to scorer accuracy of model. Now after debt, by using classification report, we are comparing accuracy and precision. Float random forest algorithm. Now you can see here mean as for Lutheran R2 score around a given CEO for random forest. Now by using classification report also you can see because he's invested 400 alchemists of default percent, Fallout, 76 percent. And now I can see is 75 percent for random forest classifier. You are going to analyze this outcome on by using tabular comparison in which we had created a variable, the t for tabular comparison in which more than the names of different algorithm via the past year. Logistic regression can classify decision tree classifier, random forest classifier. After that we are going to pass. You mean absolute error values are to score error values and accuracy values for different algorithm. Now we had created a variable analysis in which we are going to create a dataframe. And your duty is the name of variable in which we are going to store the deblurring values. And he had induction we are providing from one to three. After that, print the value of analysis and see the output in the tabular form. You can see in modelling logistic innervation, KNN classifier, decision tree classifier, random forest classifier, and their immediate router. I can score error and accuracy also. Now next, we are going to analyze this values by zinc graphical methods in which we had created variable x to store all the values of model logistic integration. Given classifier, decision tree classifier, random forest classifier in y, we are going to store the values of accuracy for different algorithms. Let's run this block of code. And after there, this two line commander used to resize the dimension of output graph. And here, this S and S dot line plot is used to draw the line plot by using seaborne library. And after that, we are creating here plt.plot x label, which is used to draw the x level of graph by using the name different machine learning classifier. Now next four viable, we are passing year level as accuracy. Now let's run this code. See the output. You can see output in the form of graphical, as you can see here also, logistic regression is having highest accuracy. You can compare from a real also here Mean, Absolute and unfold different logistic regression is 0.234 given classifier 0.31, decision tree point 300 for a new forest classifier 0.24. And our toes call error for different classifier. Lastly, you can see here we see four different models. Now Neil, largest acuity for our dataset, diabetes prediction, can be achieved by using logistic regression, which is 77%. Now, similarly, you can see here by using logistic regression in the graph also, you can see logistic regression is having highest accuracy. Now hope you have enjoyed our project. In that description, I had also provided link of my Python course. You may also check out ones. If you're basics of Python is vk.