Posts

Oct () function in python

Image
  oct() function in Python:  oct() function is an important function in Python . It transforms any data type into the octal form. If anyone wants to convert any data from any format to octal form then it can be done easily with the help of oct() function. Format:-  oct(data), data is in int format. Parameters:-  inside the oct function we have to only pass the integer data. Diagrammatic representation of oct function:- Implementation of oct function in Python Decimal to octal:- #decimal to octal a= int ( input ()) b= oct ( a ) print ( "the number " + str ( a ) + " in octal form is " + str ( b )) Here, we take a decimal number as input and print that number in the octal form. Binary to octal:- # Binary to octal c= int ( input () , 2 ) d= oct ( c ) print ( "the number " + str ( c ) + " in octal form is " + str ( d )) Here, we take a binary number as input and print that number in the octal form. Hexadecimal to octal:- #Hexadecimal to octal e= i

Multinomial regression

Image
  In this tutorial, we will learn how to implement logistic regression using Python. Let us begin with the concept behind multinomial logistic regression. In the binary classification, logistic regression determines the probability of an object to belong to one class among the two classes. If the predicted probability is greater than 0.5 then it belongs to a class that is represented by 1 else it belongs to the class represented by 0. In multinomial logistic regression, we use the concept of one vs rest classification using binary classification technique of logistic regression. Now, for example, let us have “K” classes. First, we divide the classes into two parts, “1 “represents the 1st class and “0” represents the rest of the classes, then we apply binary classification in this 2 class and determine the probability of the object to belong in 1st class vs rest of the classes. Similarly, we apply this technique for the “k” number of classes and return the class with the highest probabi