Pathway Analytics
  • Introduction
  • Blog
    • MMM Showdown: Google Meridian vs. PyMC Marketing
    • Drop Line Charts - Use Process Behavior Charts Instead!
    • Create a GitBook Data Science Portfolio
    • 5 Reasons I Chose Johns Hopkins Online AI Masters Program
  • Statistics
    • Google Lightweight MMM
    • Propensity Score Matching
    • Thompson Sampling
    • Basketball Free Throw Percentage App
  • Deep Learning
    • Classifying Medical Abstract Sentences
    • Predicting Bitcoin Prices
    • Food Image Classifying
  • Supervised Learning
    • Waiter Tips Multivariate Regression
    • Sleep Cycle - Analyzing My Own Sleep Data
  • Unsupervised Learning
    • Customer Segmentation using KMeans
    • Time Series Clustering
  • Dashboards, Reports, and Visualizations
    • Shiny Useful Code
    • R Markdown Reports
  • Mini Notes
    • Useful SQL Code
    • Testing Code
    • Correlation Plots
    • Docker - Jupyter Lab and R Studio Setup
    • Tensorflow GPU Setup
    • Object Oriented Programming
    • R and Python Together using Reticulate
    • Random Forests are Versatile
Powered by GitBook
On this page
  • Introduction
  • Difference between self and other variables
  1. Mini Notes

Object Oriented Programming

PreviousTensorflow GPU SetupNextR and Python Together using Reticulate

Last updated 3 years ago

Created by Chia, Jonathan on Apr 09, 2022

Introduction

Some notes on OOP.

See: https://www.kdnuggets.com/2019/08/object-oriented-programming-data-scientists-estimator.html

Difference between self and other variables

Notice here how output predicted_ gets saved into self.

The difference between X and self is that X is a variable that comes in, whereas self is a variable that is saved and used throughout the whole class. self.predicted_ can be used in other defs

Notice the self.intercept_ and self.coef_. Instead of starting the def with predict(coef_, intercept_, X), I can start the def with just predict(self, X).


Document generated by Confluence on Apr 09, 2022 16:54

Atlassian