Code Monkey home page Code Monkey logo

youtube-tutorials's People

Contributors

josiahparry avatar

Stargazers

Jordi avatar Ryuici avatar  avatar Oluwafemi OYEDELE avatar Matt Pettis avatar Howard Baek avatar  avatar Olivier Leroy avatar Roberto Salas avatar  avatar Michael Sumner avatar Owain  gaunders avatar

Watchers

James Cloos avatar Jordi avatar  avatar Kostas Georgiou avatar  avatar

youtube-tutorials's Issues

scalars are helpful

  • R already has an implicit concept of scalars || vs &&
  • we use constants in regression

imagine implementing a scalar

e.g.

scalar(x, ptype = character() (with inspo from vctrs)

rlang::inject vs do.call

rlang::inject() lets you inject parameters using !!! partially. Rather than having a list of arguments that you need to pass in using do.call

use case bringing this up:

  item_res <- rlang::inject(
    add_item(
      x,
      title,
      user = user,
      host = host,
      token = token,
      !!!adtl_args
    )
  )

rlang: functions for writing functions

example for diffusing code:

dplyr_but_later <- rlang::expr(library(dplyr)) 
rlang::eval_tidy(dplyr_but_later)

taking named arguments via dots, and collecting them into a list

make_new_list <- function(...) {
  my_list <- rlang::list2(...)
  my_list
}

splicing named list into argument
!!!

splice_dfs <- function(...) {
  args <- rlang::list2(...)
  
  dplyr::bind_rows(!!!args)
}

# equivalent
splice_dfs <- function(...) {
  args <- rlang::list2(...)
  
  dplyr::bind_rows(rlang::splice(args))
}

Kernel weights to introduce distance decay

Most analyses that use aerial geometries utilize row standardized weights because there is not good theoretical reason to apply diifferent weights.

If, however, we have a good reason to use polygon centroids or, probably more approrpiately, using point data, we can use kernel weights. Kernel weights are used to introduce a decay function ito our weighting.

Say we have a point with 8 neighbors which are not at a uniform distance away. How much weight should we give each location in our subsequent calculations? Should we really be allocating equal weight? Or, should we recognize that things that are closer likely have more impact than those that are further away

A good use case of say gaussian kernel weights is if we have a hexagonal grid of incidents that are fairly small. First order neighbors may be limiting and we want to include 2nd or third order neighbors, but those should have less weight.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.