Why do we use Poisson distribution or Negative Binomial distribution for regression?

Let’s say we have predictor variables (features) denoted as $latex X \in \mathbb{R}^n$ and response variable (label) $latex y$ whose underlying random variable is $latex Y$. If we want to fit an Ordinary Least Square (OLS) regression such that $latex y=WX+\epsilon$ where $latex \epsilon$ is an error term, then we have the following assumptions:  strict exogenous: $latex E(\epsilon|X)=0$ …

Leetcode 198: House Robber

https://leetcode.com/problems/house-robber/ 198. House Robber  Total Accepted: 101581 Total Submissions: 275668 Difficulty: Easy Contributors: Admin You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it …

Leetcode 298: Binary Tree Longest Consecutive Sequence

https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/ Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The longest consecutive path need to be from parent to child (cannot be the reverse). For example, 1 \ …

Leetcode 262: Trips and Users

262. Trips and Users Total Accepted: 6774 Total Submissions: 43127 Difficulty: Hard Contributors: Admin The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’). +—-+———–+———–+———+——————–+———-+ | Id | …

Leetsql 185: Department Top Three Salaries

185. Department Top Three Salaries Total Accepted: 8926 Total Submissions: 57724 Difficulty: Hard Contributors: Admin The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id. +—-+——-+——–+————–+ | Id | Name | Salary | DepartmentId | +—-+——-+——–+————–+ | 1 | Joe | 70000 | 1 …

Leetcode 40: Combination Sum II

40. Combination Sum II Total Accepted: 89506 Total Submissions: 294097 Difficulty: Medium Contributors: Admin Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combination. Note: All numbers (including …