Skip to main content

Logistic Regression

 Logistic Regression :

logistic regression is a supervised learning algorithm used for classification problems. It is mainly used for binary classification. the target variable is categorical. the algorithm predicts the group which the current object belong. 

it predicts the group by estimating the probabilities based on weightage relationship between dependent and independent variable.  for this probabilities it uses the logistics function. the task of logistic function is to take any real value and map it between 0 and 1. then this values are converted into binary values 0 and 1 using threshold value. default threshold value is 0.5

Popular posts from this blog

spark-scala-python

 ############sparkcontest######33333 it is used in earlier spark 1.x //scala  import org.apache.spark.SparkConf     import org.apache.spark.SparkContext     val conf = new SparkConf().setAppName("first").setMaster("local[*]")     val sc = new SparkContext(conf) val rdd1 = sc.textFile("C:/workspace/data/txns") # python  from pyspark import SparkContext,SparkConf     conf = SparkConf().setAppName("first").setMaster("local[*])     sc = SparkContext(conf)      ## now days sparksession are used  ########range######### // in Scala val myRange = spark.range(1000).toDF("number") # in Python myRange = spark.range(1000).toDF("number") ###########where########## // in Scala val divisBy2 = myRange.where("number % 2 = 0") # in Python divisBy2 = myRange.where("number % 2 = 0") ###########read csv ########## // in Scala val flightData2015 = spark .read .option("inferSchema", "true") .o...

Binomial Distribution

  The binomial distribution formula is:                                                    b(x; n, P) =  n C x  * P x  * (1 – P) n – x Where: b = binomial probability x = total number of “successes” (pass or fail, heads or tails etc.) P = probability of a success on an individual trial n = number of trials Note:  The binomial distribution formula can also be written in a slightly different way, because  n C x  = n! / x!(n – x)! (this binomial distribution formula uses factorials  (What is a factorial? ). “q” in this formula is just the probability of failure (subtract your probability of success from 1). Using the First Binomial Distribution Formula The binomial distribution formula can calculate the probability of success for binomial distributions. Often you’ll be told to “plug in” the numbers to the  formul...

Remove Outliers with IQR

   Interquartile Range(IQR) Steps: 1:  Put the numbers in order. 1, 2, 5, 6, 7, 9, 12, 15, 18, 19, 27. 2:  Find the median. 1, 2, 5, 6, 7 , 9 , 12, 15, 18, 19, 27. 3:  Place parentheses around the numbers above and below the median. Not necessary  statistically , but it makes Q1 and Q3 easier to spot. (1, 2, 5, 6, 7), 9, (12, 15, 18, 19, 27). 4:  Find Q1 and Q3 Think of Q1 as a median in the lower half of the data and think of Q3 as a median for the upper half of data. (1, 2,  5 , 6, 7) ,  9 , ( 12, 15,  18 , 19, 27). Q1 = 5 and Q3 = 18. 5  Subtract Q1 from Q3 to find the interquartile range . 18 – 5 = 13. What if I Have an Even Set of Numbers? Example question : Find the IQR for the following data set: 3, 5, 7, 8, 9, 11, 15, 16, 20, 21. Step 1:  Put the numbers in order . 3, 5, 7, 8, 9, 11, 15, 16, 20, 21. Step 2:  Make a mark in the center of the data : 3, 5, 7, 8, 9,  |  11, 15, 16, 20, 21. Step 3:  Place...