Source control is a system for tracking changes to files over time.
What's the point?
- No version hell
if(!require("ggseas")) install.packages("ggseas") | |
if(!require("forecast")) install.packages("forecast") | |
if(!require("data.table")) install.packages("data.table") | |
if(!require("knitr")) install.packages("knitr") | |
library(ggseas) | |
library(forecast) | |
library(data.table) | |
# Get data |
library(shiny) | |
library(data.table) | |
ui <- fluidPage( | |
titlePanel("Multiple file uploads"), | |
sidebarLayout( | |
sidebarPanel( | |
fileInput("csvs", | |
label="Upload CSVs here", | |
multiple = TRUE) |
This post provides an overview of performing diagnostic and performance evaluation on logistic regression models in R. After training a statistical model, it’s important to understand how well that model did in regards to it’s accuracy and predictive power. The following content will provide the background and theory to ensure that the right technique are being utilized for evaluating logistic regression models in R. | |
Logistic Regression Example | |
We will use the GermanCredit dataset in the caret package for this example. It contains 62 characteristics and 1000 observations, with a target variable (Class) that is allready defined. The response variable is coded 0 for bad consumer and 1 for good. It’s always recommended that one looks at the coding of the response variable to ensure that it’s a factor variable that’s coded accurately with a 0/1 scheme or two factor levels in the right order. The first step is to partition the data into training and testing sets. | |
``` | |
library(caret) | |
data(GermanCredit) | |
Train <- cr |
# get html from url | |
library(RCurl) | |
library(XML) | |
library(data.table) | |
library(ggplot2) | |
url <- "http://sqlbits.com/information/PublicSessions.aspx" | |
src<-getURL(url) | |
# transform html |
'Allows aggregation of a multilookup cell and can be configured by the user | |
'To use add this expression to a cell's expression window: | |
'=code.AggLookup([aggregate choice as string], LookupSet([Local Column], [Match Column], [Return Column], [Dataset as string])) | |
' | |
'Available aggregate choices are count, sum, min, max and avg | |
Function AggLookup(ByVal choice as String, ByVal items as Object) | |
'Ensure the LookupSet array provided is not empty | |
If items is Nothing then | |
Return Nothing |
library(rtweet) #' uses v0.7.0.9012 or higher | |
library(tidyverse) | |
## authenticate via web browser | |
auth_setup_default() | |
## people i follow | |
follow <- get_friends("theStephLocke") | |
## their user data | |
follow_deets <- lookup_users(follow$to_id) |
name: Generate Word docs | |
on: push | |
jobs: | |
convert_via_pandoc: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: convert md to docx | |
uses: docker://pandoc/latex:2.9 |
let | |
Source = Web.Page(Web.Contents("https://www.pass.org/Governance/Elections")), | |
Data5 = Source{5}[Data], | |
#"Changed Type" = Table.TransformColumnTypes(Data5,{{"", type text}, {"Joey D'Antoni", type number}, {"Lori Edwards", type number}, {"Roberto Fonseca", type number}, {"Matt Gordon", type number}, {"Stephanie Locke", type number}, {"Jose L. Rivera", type number}, {"Hamish Watson", type number}}), | |
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"", "Area"}}), | |
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Area"}, "Attribute", "Value"), | |
#"Renamed Columns1" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Candidate"}}) | |
in | |
#"Renamed Columns1" |