Automated backup management.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import pprint, requests, sys | |
from bs4 import BeautifulSoup | |
from itertools import izip | |
base_url = 'http://www.bookshop.unsw.edu.au/cgi-bin/bookweb/subject2' | |
subjects = [] | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests, optparse | |
from bs4 import BeautifulSoup | |
PRECISION = 2 | |
VERBOSE = False | |
parser = optparse.OptionParser() | |
parser.add_option('-f', '--from', action="store", dest="from") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests | |
from bs4 import BeautifulSoup | |
EMAIL = '' | |
PASSWORD = '' | |
# Scrape login form and parse into a dict of fields and default vales for form submission | |
payload = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests, re, json | |
from bs4 import BeautifulSoup | |
r = requests.get('https://my.unsw.edu.au/amserver/UI/Login?module=ISISWSSO&IDToken1=') | |
soup = BeautifulSoup(r.text) | |
form = soup.find("form", {"id": "muLoginForm"}) | |
payload = {} | |
for field in form.find_all("input"): |
- 3
- 2
=== Run information ===
Scheme:weka.classifiers.trees.J48 -C 0.25 -M 2
Relation: iris
Instances: 150
Attributes: 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
World 1.0 9.425909e11 1.0 [Particle 2.1301455e10 (-23.722443,273.93643) (-0.5603789,8.87553),Particle 5.4552156e12 (-620.9837,-34.27094) (0.8044095,14.809131),Particle 2.0776714e11 (9.89766,-174.47176) (35.80036,-34.40756),Particle 1.2364892e10 (4.0329933,65.24691) (18.734251,221.23175),Particle 7.7461894e11 (740.04193,94.38988) (15.756793,-8.751707),Particle 4.2237824e11 (-1585.7284,-213.17168) (47.984566,101.29193),Particle 5.401596e11 (-235.64716,-139.60974) (-26.06327,-15.914259),Particle 1.33174534e11 (-64.33501,-405.01236) (4.042644,2.774118),Particle 5.1389723e10 (-1511.0996,4881.5757) (0.6556639,13.3051195),Particle 5.3848208e11 (-115.08583,955.13684) (-11.534346,-31.219143),Particle 5.9962958e10 (-68.10322,-94.91835) (-13.505034,1.1353914),Particle 5.0289918e10 (-220.84084,-96.86563) (0.38176155,11.775326),Particle 5.1853357e10 (8.276694,-235.82036) (-51.282913,25.556257),Particle 3.3220094e10 (1525.3933,23.393568) (-0.47481883,-5.4444294),Particle 8.3360986e11 (-34.808674,-5.540028) (10.581584,12.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Test.QuickCheck | |
import Data.List(sort, nub) | |
data BinaryTree = Branch Integer BinaryTree BinaryTree | |
| Leaf | |
deriving (Show, Ord, Eq) | |
isBST :: BinaryTree -> Bool | |
isBST Leaf = True | |
isBST (Branch v l r) = allTree (< v) l && allTree (>= v) r && isBST l && isBST r |
-
- a. Observing the results of comparison by
Percent_correct
usingDecisionStump
as the baseline, we can see that there is no statistically significant difference in accuracy (Percent_correct
) betweenJ48
andDecisionStump
on the datasetscredit-rating
(85.51% vs. 85.57%) andvote
(95.63% vs. 96.57%).
- a. Observing the results of comparison by
First note that J48
is simply an implementation of the C4.5 algorithm that generates a decision tree of arbitrary depth, while DecisionStump
generates a decision tree of depth one, i.e. a set of rules that test one attribute. Thus, one possible reason their accuracy might be approximately equivalent is that the inductive bias of decision tree learning (Occam's razor/preference of shorter trees) may not suit the dataset well, causing both algorithms to perform equally poor - not the case here with either dataset (both over 85% accuracy)! Another possible cause is the existence of a single attribute in the datase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
String content = "hello world!\nThere are 2 lines in this file!"; | |
File file = new File("something.txt"); | |
file.createNewFile(); | |
FileWriter fw = new FileWriter(file.getAbsoluteFile()); | |
BufferedWriter bw = new BufferedWriter(fw); | |
bw.write(content); | |
bw.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); |
OlderNewer