/images/Yiyang.png

Yiyang Dong

Statistical Learning Notes | LDA 1 - Linear Discriminant Analysis

ISLR4.4 - LDA 0. LDA vs Logistic Regression When the classes are well-separated, the parameter estimates for the logistic regression model are surprisingly unstable LDA is more stable than Logistic Regression If n is small and distribution X ~ Normal in each of the classes, LDA is more accurate than Logistic Regression LDA is more common when we have more than two response classes ($K \geq 2 $ ) because it also provides low-dimensional views of the data 1.

SQL Practices 01

175. Combine Two Table Write a SQL query for a report that provides FirstName, LastName, City, State for each person in the Person table, regardless if there is an address for each of those people PersonId and AddressId are primary keys 1 2 3 4 5 6 CreatetablePerson(PersonIdint,FirstNamevarchar(255),LastNamevarchar(255))CreatetableAddress(AddressIdint,PersonIdint,Cityvarchar(255),Statevarchar(255))TruncatetablePersoninsertintoPerson(PersonId,LastName,FirstName)values('1','Wang','Allen')TruncatetableAddressinsertintoAddress(AddressId,PersonId,City,State)values('1','2','New York City','New York') Solution: Outter Join Since the PersonId in table Address is the foreign key of table Person, we can join this two table to get the address information of a person.

eCommerce Platform 05 - Shopping Cart Implementation

1. Qty Select & Add to Cart Button In ProductScreen.js import useState add qty, history, addToCartHandler 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 import React, { useState, useEffect } from "react"; const ProductScreen = ({ history, match }) => { const [qty, setQty] = useState(1) const addToCartHandler = () => { history.

Full Stack Notes | eCommerce Platform 04 - Redux for State Management

Notes on Aug 15th: lots of stuff I haven’t understanded, just try to learn some whole framework Redux Overview https://redux.js.org/understanding/thinking-in-redux/glossary Redux is a predictable state container for JavaScript apps. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. Install Redux DevTools in chrome web store 1 frontend % npm i redux react-redux redux-thunk redux-devtools-extension React-Redux is the official React UI bindings layer for Redux.

eCommerce Platform 03 - Database, MongoDB, Postman

Mongo DB Atlas & Compass Setup Download Compass https://www.mongodb.com/try/download/compass Create Database(Cluster) in mongodb.com Security => Database Access => Add new database user Network Access => Add IP Address => Allow Access From Anywhere => Confirm Databases => Browse Collections => Add my Own Data db name: eshop collection name: products Databases => Connect => Connect using MongoDB Compass => I have MongoDB Compass Copy the connection string, and paste in MongoDB Compass App modify <password> and /test => /eshop Databases => Connect => Connect your application (Node.

eCommerce Platform 02 - Backend, Node.js, Fetch Data from React

Backend Setup Create eShop/package.json backend setup for ES Module: "type": "module", 1 eshop % npm init 1 2 3 4 5 6 7 8 9 10 11 12 { "name": "eshop", "version": "1.0.0", "description": "MERN eCommerce Platform", "main": "server.js", "type": "module", "author": "Yiyang Dong", "license": "MIT", "dependencies": { "express": "^4.17.1" } } Nodemon & Concurrently 1 eshop % npm i -D nodemon concurrently In eshop/package.