Maths - Machine Learning

  • Linear Algebra
  • Statistics
    • Collect, Organize, Analyze, interpret & Represent
    • Descriptive
      • Measure of central tendency (MoCT)
        • Mean (μ or x̄)
        • Median (M)
        • Mode (Mo)
      • Measure of Dispersion (MoD)
        • Range (R)
        • Standard Deviation (s or σ)
        • Variance (s² or σ²)
    • Inferential
      • Z-test
      • T-test
      • F-test
  • Probability
    • Conditional Probability
      • Image Not Found
      • Find probability of event A given that event B has already occurred
      • Baye's Theorem
        • Image Not Found
        • A is Hypothesis and B is Data/Evidence
        • Naive Bayes Classifier
          • Bernoulli
            • Features are of Binary nature
            • Bernoulli distribution
            • P(success) = p & P(faliure) = q = 1 - p
            • Random Variable (X) => 1 (Success) & 0 (Faliure)
            • X has Bernoulli distribution
            • Image Not Found
          • Multinomial
            • Used for finding Discrete count, Number of occurrences, Frequency
            • Multinomial distribution
            • Image Not Found
          • Gaussian (Normal)
            • Not to be used if data has discrete values, Use when features has continuous values
            • Gaussian distribution
            • Image Not Found
            • Code
                  from sklearn.model_selection import train_test_split
                  from sklearn.naive_bayes import GaussianNB
                  from sklearn import metrics
                  X = data.value
                  y = data.target
                  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1)
                  gnb = GaussianNB()
                  gnb.fit(X_train, y_train)
                  y_pred = gnb.predict(X_test)
                  print(metrics.accuracy_score(y_test, y_pred))
              
Share: