Skip to content

Instantly share code, notes, and snippets.

View michlee1337's full-sized avatar
🐢

Michelle S Lee michlee1337

🐢
View GitHub Profile
# 1. Load the "Matching" library.
> install.packages("Matching")
> library(Matching)
# 2. Load the lalonde data set into working memory.
> data(lalonde)
# 3. What are the dimensions of the data set?
> str(lalonde)
## 445 observations of 12 variables (445x12)
# Question 1 (using "dim")
# What are the dimensions of the data set (how many rows and columns)?
dim(GerberGreenImai)
## [1] 10829 26
# Question 2 (using "names")
# What are the variable names?
names(GerberGreenImai)
## [1] "PERSONS" "WARD" "QUESTION" "MAILGRP" "PHONEGRP" "PERSNGRP"
## [7] "APPEAL" "CONTACT" "MAILINGS" "AGE" "MAJORPTY" "VOTE96.0"
# First we import the base automaton
from automata.base.automaton import Automaton #Begin by importing the following
from automata.tm.ntm import NTM
ntm = NTM(
states={'q1', 'q2', 'q3', 'q4','q5','q6','q7','q8','qA'},
input_symbols={'0', '1', '#'},
tape_symbols={'0', '1', '#','x','.'},
transitions={
'q1': {