Skip to content

Commit

Permalink
[add] Auto Format in GitHub actions (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed May 1, 2024
1 parent edc00d7 commit c9fc0b3
Show file tree
Hide file tree
Showing 6 changed files with 4,090 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/WebPageToMarkdown.yml
Expand Up @@ -29,6 +29,7 @@ jobs:
ignoreSelector: '.ad-wrapper'
markDownFilePath: './chinese/articles/'
githubToken: ${{ github.token }}

- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/main.yml
@@ -1,19 +1,27 @@
name: CI & CD

on:
push:
branches:
- main

jobs:
Lint:
Lint-and-Format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install & Lint
run: |
npm install
npm run lint
cache: pnpm
- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Lint & Format
run: pnpm format

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Format
4 changes: 0 additions & 4 deletions .husky/pre-commit
@@ -1,5 +1 @@
#!/usr/bin/env sh

. "$(dirname -- "$0")/_/husky.sh"

npm test
4 changes: 2 additions & 2 deletions chinese/articles/machine-learning-handbook.md
Expand Up @@ -1271,7 +1271,7 @@ Forward Step-Wise Selection can be summarized as follows:
- Consider all (p-k) models that contain the variables in M\_k with one additional feature or predictor.
- Choose the best model among these p-k models, and define it M\_(k+1) by using performance metrics such as [RSS][32]/[R-squared][33].

****Step 3:**** Select the single model with the best performance among these M\_…….M\_p models (one with smallest [Cross Validation Error][34], [C\_p][35], [AIC][36] [(Akaike Information Criterion)][37], [BIC][38] (Bayesian Information Criteria)or [adjusted R-squared][39] is your best model M\*).
****Step 3:**** Select the single model with the best performance among these M\…….M\_p models (one with smallest [Cross Validation Error][34], [C\_p][35], [AIC][36] [(Akaike Information Criterion)][37], [BIC][38] (Bayesian Information Criteria)or [adjusted R-squared][39] is your best model M\*).

So, the idea behind this Selection is to start simple and increase the number of predictors in the model. Per number of predictors, consider all possible combination of variables and select a single best model: M\_k. Then compare all these models with different number of predictors (best M\_ks ) and the one best performing one can be selected.

Expand All @@ -1292,7 +1292,7 @@ Backward Step-Wise Feature Selection can be summarized as follows:
- Consider all k models that contain all variables except for one of the predictors in M\_k model, for k − 1 features.
- Choose the best model among these k models, and define it M\_(k-1) by using performance metrics such as [RSS][46]/[R-squared][47].

****Step 3:**** Select the single model with the best performance among these M\_…….M\_p models (one with smallest [Cross Validation Error][48], [C\_p][49], [AIC][50][(Akaike Information Criterion)][51], [BIC][52] (Bayesian Information Criteria)or [adjusted R-squared][53] is your best model M\*).
****Step 3:**** Select the single model with the best performance among these M\…….M\_p models (one with smallest [Cross Validation Error][48], [C\_p][49], [AIC][50][(Akaike Information Criterion)][51], [BIC][52] (Bayesian Information Criteria)or [adjusted R-squared][53] is your best model M\*).

Like Forward Step-wise Selection, the Backward Step-Wise Feature Selection technique searches through only (p+1)/2 models, making it possible to apply in settings where p is too large to apply other selection techniques.

Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -12,9 +12,9 @@
},
"devDependencies": {
"@lint-md/cli": "^2.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.3.0",
"prettier": "^3.0.3"
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5"
},
"prettier": {
"singleQuote": true,
Expand All @@ -28,6 +28,6 @@
"lint": "lint-md chinese/**/*.md",
"format": "lint-md chinese/**/*.md --fix",
"test": "lint-staged",
"prepare": "husky install"
"prepare": "husky"
}
}

0 comments on commit c9fc0b3

Please sign in to comment.