Commit ae8b113c authored by Carsten Eie Frigaard's avatar Carsten Eie Frigaard
Browse files

update

parent 57e43ab2
...@@ -907,7 +907,7 @@ ser vi derfor til sidst på Scikit-learns Pipelines.} ...@@ -907,7 +907,7 @@ ser vi derfor til sidst på Scikit-learns Pipelines.}
\item{Almindelig forelæsning} \item{Almindelig forelæsning}
\subitem*{ekstra materiale: \link**{[HOME]/L03/Extra/k-fold_demo.ipynb}} \subitem*{ekstra materiale: \link**{[HOME]/L03/Extra/k-fold_demo.ipynb}}
\item{\b{Opgave} (pipelines): \link**{[HOME]/L03/pipelines.ipynb}} \item{\b{Opgave} (pipelines): \link**{[HOME]/L03/pipelines.ipynb}}
\subitem*{Data til pipelines opgaven (bør lige i L03/Data/): \link**{[HOME]/L03/itmal_l01_data.pkl}} \subitem*{Data til pipelines opgaven (bør lige i L03/Data/):\link**{[HOME]/L03/Data/itmal_l01_data.pkl}}
\subitem*{(Du har allerede denne data-fil, hvis du pull'er fra [GITMAL])} \subitem*{(Du har allerede denne data-fil, hvis du pull'er fra [GITMAL])}
} }
......
...@@ -9,7 +9,7 @@ COURSEFILES = ITMAL_E21 ...@@ -9,7 +9,7 @@ COURSEFILES = ITMAL_E21
MKDIFF=printf "DIFF Ref/%-10s Test/ .. " $1 && colordiff -dw Refs/$1 Test/ && echo "DIFF OK" && rm Test/$1 MKDIFF=printf "DIFF Ref/%-10s Test/ .. " $1 && colordiff -dw Refs/$1 Test/ && echo "DIFF OK" && rm Test/$1
build: build:
@ $(PYCOURSE) -c $(COURSEFILES)/course.tex -v -o ../../Html/ @ $(PYCOURSE) -c $(COURSEFILES)/course.tex -v -o ../../Html/ -t
@ $(PYPLAN) -p $(COURSEFILES)/plan.txt -v -o ../../Html/plan.html @ $(PYPLAN) -p $(COURSEFILES)/plan.txt -v -o ../../Html/plan.html
@ cd ../.. && $(PWD)/$(PYFILETREE) -v -o Html/filetree.html @ cd ../.. && $(PWD)/$(PYFILETREE) -v -o Html/filetree.html
...@@ -23,9 +23,9 @@ sync: build ...@@ -23,9 +23,9 @@ sync: build
TESTARGS=-v TESTARGS=-v
test: clean test: clean
@ cd Test && $(PWD)/$(PYCOURSE) -c course.tex $(TESTARGS) @ cd Test && $(PWD)/$(PYCOURSE) $(TESTARGS)
@ cd Test && $(PWD)/$(PYPLAN) -p plan.txt $(TESTARGS) @ cd Test && $(PWD)/$(PYPLAN) $(TESTARGS)
@ cd Test && $(PWD)/$(PYFILETREE) $(TESTARGS) @ cd Test && $(PWD)/$(PYFILETREE) $(TESTARGS)
@ $(call MKDIFF,L00.html) @ $(call MKDIFF,L00.html)
@ $(call MKDIFF,L01.html) @ $(call MKDIFF,L01.html)
@ $(call MKDIFF,plan.html) @ $(call MKDIFF,plan.html)
......
#!/usr/bin/env python3 #!/usr/bin/env python3
from Utils.dbg import ERR, DiagStdErr, PrettyPrintTracebackDiagnostics from Utils.dbg import ERR, WARN, DiagStdErr, PrettyPrintTracebackDiagnostics
from sys import stdout, stderr from sys import stdout, stderr
from html import escape, unescape from html import escape, unescape
...@@ -55,6 +55,9 @@ def Dbg(verbose, msg, level=1): ...@@ -55,6 +55,9 @@ def Dbg(verbose, msg, level=1):
Str(msg) Str(msg)
if Int(level) <= Int(verbose): if Int(level) <= Int(verbose):
print(msg, file=stderr) print(msg, file=stderr)
def Warn(msg):
WARN(msg)
def Outputfile(outputfile): def Outputfile(outputfile):
assert outputfile is not None assert outputfile is not None
...@@ -76,27 +79,29 @@ def LoadText(filename, timeout=4000, split=True): ...@@ -76,27 +79,29 @@ def LoadText(filename, timeout=4000, split=True):
def HtmlEncode(s): def HtmlEncode(s):
# for text in html page # for text in html page
return escape(Str(s, False)) t=escape(Str(s, False))
#assert t==escape(t)
return t
def HtmlDecode(s): def HtmlDecode(s):
return unescape(Str(s, False)) t=unescape(Str(s, False))
assert t==unescape(t)
return t
def UrlQuote(s): def UrlQuote(s):
# for file names in urls # for file names in urls
s = quote(Str(s, False), safe='') t = quote(Str(s, False), safe='')
assert s.find("'") < 0 assert t==quote(t, safe='')
assert s.find('"') < 0 assert t.find("'") < 0
assert s.find(" ") < 0 assert t.find('"') < 0
return s assert t.find(" ") < 0
return t
def MkHtmlPage(htmlcontent): def MkHtmlPage(htmlcontent):
assert Str(htmlcontent).find("DOCTYPE")<0 and htmlcontent.find("<html>")<=0 and htmlcontent.find("<body>")<=0 assert Str(htmlcontent).find("DOCTYPE")<0 and htmlcontent.find("<html>")<=0 and htmlcontent.find("<body>")<=0
meta = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>" meta = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
comment = "<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->" comment = "<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->"
bodystyle = "style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'" # org BS "style='font-family: Verdana;font-size: 12pt;color: #494c4e;'" bodystyle = "style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'" # org BS "style='font-family: Verdana;font-size: 12pt;color: #494c4e;'"
return f"<!DOCTYPE html>\n<html>\n{comment}\n{meta}\n<body {bodystyle}>\n" + htmlcontent + "\n</body>\n</html>" return f"<!DOCTYPE html>\n<html>\n{comment}\n{meta}\n<body {bodystyle}>\n" + htmlcontent + "\n</body>\n</html>"
def HandleException(ex): def HandleException(ex):
......
#!/usr/bin/env python3 #!/usr/bin/env python3
from Utils.dbg import ERR, WARN
from Utils.colors import Col, ColEnd from Utils.colors import Col, ColEnd
from Utils.mkutils import * from Utils.mkutils import *
from sys import argv from sys import argv
from argparse import ArgumentParser from argparse import ArgumentParser
from urllib.request import urlopen
if __name__ == '__main__': if __name__ == '__main__':
...@@ -15,6 +15,15 @@ if __name__ == '__main__': ...@@ -15,6 +15,15 @@ if __name__ == '__main__':
LEFT = '<' LEFT = '<'
RIGHT= '>' RIGHT= '>'
def TestLink(url):
try:
contents = urlopen(url).read()
Dbg(verbose, f" {Col('green')}URL OK:{ColEnd()} '{url}'", 1)
return True
except Exception as ex:
Warn(f"exception in TestLink(url={url})..")
return False
def _mkHtml(tag, style=""): def _mkHtml(tag, style=""):
if len(Str(style, False)) > 0: if len(Str(style, False)) > 0:
if style[0]!=" ": if style[0]!=" ":
...@@ -44,8 +53,7 @@ if __name__ == '__main__': ...@@ -44,8 +53,7 @@ if __name__ == '__main__':
def isCmd(obj): def isCmd(obj):
s = str(type(obj)) s = str(type(obj))
e = "<class '__main__.Cmd'>" e = "<class '__main__.Cmd'>"
if s != e: Check(s==e, f"object not correct class of object, got type '{s}', expected '{e}'")
WARN(f"not correct class of object, got type '{s}', expected '{e}'")
return True return True
def Ok(self): def Ok(self):
...@@ -130,7 +138,9 @@ if __name__ == '__main__': ...@@ -130,7 +138,9 @@ if __name__ == '__main__':
extra = " rel='noopener' target='_blank'" if Bool(exlink) else "" extra = " rel='noopener' target='_blank'" if Bool(exlink) else ""
style = " style='font-family: courier new, courier;'" if not Bool(isstar) else "" style = " style='font-family: courier new, courier;'" if not Bool(isstar) else ""
return f"{Str(left)}span{style}{Str(right)}{left}a href='{arg1}'{extra}{right}{arg0}{left}/a{right}{left}/span{right}" if testlinks:
TestLink(arg1)
return f"{Str(left)}span{style}{Str(right)}{left}a href='{arg1}'{extra}{right}{arg0}{left}/a{right}{left}/span{right}"
@staticmethod @staticmethod
def __MkStyle(a, left, right): def __MkStyle(a, left, right):
...@@ -280,7 +290,7 @@ if __name__ == '__main__': ...@@ -280,7 +290,7 @@ if __name__ == '__main__':
self.__st = "" self.__st = ""
else: else:
if c=='(' or c=='[': if c=='(' or c=='[':
WARN("found left parathesis '{c}' while in command parsing mode, did you mean '{'?") Warn("found left parathesis '{c}' while in command parsing mode, did you mean '{'?")
self.__st += c self.__st += c
else: else:
assert self.__args=="" assert self.__args==""
...@@ -330,24 +340,24 @@ if __name__ == '__main__': ...@@ -330,24 +340,24 @@ if __name__ == '__main__':
return txt return txt
def ParseDefs(refs): #def ParseDefs(refs):
r = {} # r = {}
for i in refs.split("\n"): # for i in refs.split("\n"):
if len(Trim(i, False))>0: # if len(Trim(i, False))>0:
n = Str(i).find(']') # n = Str(i).find(']')
#
Check(not(n<=0 or i[0]!='['), f"refs need to be of the form '[key] value', got='{i}'") # Check(not(n<=0 or i[0]!='['), f"refs need to be of the form '[key] value', got='{i}'")
#
key = i[0:n+1].strip() # key = i[0:n+1].strip()
val = i[n+1:].strip() # val = i[n+1:].strip()
#
Check(len(key) > 0, f"empty key in ref element='{i}'") # Check(len(key) > 0, f"empty key in ref element='{i}'")
Check(len(val) > 0, f"empty value in ref element='{i}'") # Check(len(val) > 0, f"empty value in ref element='{i}'")
#
Dbg(verbose, f" ParseRef(): found '{key}' => '{val}'", 2) # Dbg(verbose, f" ParseRef(): found '{key}' => '{val}'", 2)
assert not r.get(key) # assert not r.get(key)
r[key]=val # r[key]=val
return r # return r
def ParseDefs2(defs): def ParseDefs2(defs):
r = {} r = {}
...@@ -356,16 +366,13 @@ if __name__ == '__main__': ...@@ -356,16 +366,13 @@ if __name__ == '__main__':
if len(d) > 0: if len(d) > 0:
n = Str(d).find(']') n = Str(d).find(']')
if n<=0 or d[0]!='[': Check(not(n<=0 or d[0]!='['), f"refs need to be of the form '[key] value', got='{i}'")
ERR(f"refs need to be of the form '[key] value', got='{i}'")
key = d[0:n+1].strip() key = d[0:n+1].strip()
val = d[n+1:].strip() val = d[n+1:].strip()
if len(key)==0: Check(len(key) > 0, f"empty key in ref element='{i}'")
ERR(f"empty key in ref element='{i}'") Check(len(val) > 0, f"empty value in ref element='{i}'")
if len(val)==0:
ERR(f"empty value in ref element='{i}'")
Dbg(verbose, f" ParseRef(): found '{key}' => '{val}'", 2) Dbg(verbose, f" ParseRef(): found '{key}' => '{val}'", 2)
assert not r.get(key) assert not r.get(key)
...@@ -375,10 +382,8 @@ if __name__ == '__main__': ...@@ -375,10 +382,8 @@ if __name__ == '__main__':
def ParseBasetructure(courselist): def ParseBasetructure(courselist):
N = len(List(courselist)) N = len(List(courselist))
if N<=0: Check(N > 0,"file seems to be empty")
ERR("file seems to be empty") Check(courselist[0]=="COURSE","missing tag 'COURSE' in course file")
if courselist[0]!="COURSE":
ERR("missing tag 'COURSE' in course file")
s = {} s = {}
curr = None curr = None
...@@ -415,17 +420,15 @@ if __name__ == '__main__': ...@@ -415,17 +420,15 @@ if __name__ == '__main__':
for i in s: for i in s:
n = Str(i).find("CONTENT") n = Str(i).find("CONTENT")
if n>0: Check( n==0, f"CONTENT tag not in column 1, but in column {n} for entry '{i}'")
ERR("CONTENT tag not in column 1, but in column {n} for entry '{i}'") l = []
elif n==0: for line in List(s[i]):
l = [] for key in defs:
for line in List(s[i]): assert Str(key)[0]=='[' and key[-1]==']'
for key in defs: val = Str(defs[key])
assert Str(key)[0]=='[' and key[-1]==']' line = line.replace(key, val)
val = Str(defs[key]) l.append(Str(line, False))
line = line.replace(key, val) s[i] = l
l.append(Str(line, False))
s[i] = l
# 3: parse structure and generate html code # 3: parse structure and generate html code
htmlstructure = {} htmlstructure = {}
...@@ -458,14 +461,13 @@ if __name__ == '__main__': ...@@ -458,14 +461,13 @@ if __name__ == '__main__':
assert Str(i).find("CONTENT")==0 assert Str(i).find("CONTENT")==0
sublesson = i[7:].strip() sublesson = i[7:].strip()
if len(sublesson)<=0: Check(len(sublesson)>0, "sublesson name empty (or just whitespace)")
ERR("sublesson name empty (or just whitespace)")
outputfilename = Str(filenamebase) + sublesson + ".html" outputfilename = Str(filenamebase) + sublesson + ".html"
htmlcontent = Str(htmlstructure[i]) htmlcontent = Str(htmlstructure[i])
Dbg(verbose, f" {Col('YELLOW')}WRITING '{i}' => '{outputfilename}'{ColEnd()}", 1) Dbg(verbose, f" {Col('YELLOW')}WRITING '{i}' => '{outputfilename}'{ColEnd()}", 1)
html = MkHtmlPage(htmlcontent) if Bool(addhtmlheaders) else htmlcontentl html = MkHtmlPage(htmlcontent) if Bool(addhtmlheaders) else htmlcontent
with Outputfile(outputfilename) as f: with Outputfile(outputfilename) as f:
f.write(html) f.write(html)
...@@ -490,6 +492,7 @@ if __name__ == '__main__': ...@@ -490,6 +492,7 @@ if __name__ == '__main__':
parser = ArgumentParser(prog=argv[0], epilog="version 0.2") parser = ArgumentParser(prog=argv[0], epilog="version 0.2")
parser.add_argument("-v", default=verbose, action="count", help=f"increase output verbosity, default={verbose}\n") parser.add_argument("-v", default=verbose, action="count", help=f"increase output verbosity, default={verbose}\n")
parser.add_argument("-t", default=False, action="store_true", help=f"generate simple html (witouth <html> <body> etc tags), default=False\n") parser.add_argument("-t", default=False, action="store_true", help=f"generate simple html (witouth <html> <body> etc tags), default=False\n")
parser.add_argument("-l", default=False, action="store_true", help=f"test links, default=False\n")
parser.add_argument("-o", default=outputfiledir, type=str, help=f"output file dir base, default='{outputfiledir}'\n") parser.add_argument("-o", default=outputfiledir, type=str, help=f"output file dir base, default='{outputfiledir}'\n")
parser.add_argument("-c", default=coursefile, type=str, help=f"cause file to be parsed, default='{coursefile}'\n") parser.add_argument("-c", default=coursefile, type=str, help=f"cause file to be parsed, default='{coursefile}'\n")
...@@ -497,9 +500,10 @@ if __name__ == '__main__': ...@@ -497,9 +500,10 @@ if __name__ == '__main__':
verbose = Int(args.v) verbose = Int(args.v)
coursefile = Str(args.c) coursefile = Str(args.c)
ouptputfiledir = Str(args.o) outputfiledir = Str(args.o)
testlinks = Bool(args.t)
Dbg(verbose, f"{Col('PURPLE')}GENERATING html course from file '{coursefile}'..{ColEnd()}") Dbg(verbose, f"{Col('PURPLE')}GENERATING html course from file '{coursefile}', outputfiledir={outputfiledir}..{ColEnd()}")
htmlencoded = [HtmlEncode(i) for i in LoadCourseFile(coursefile)] htmlencoded = [HtmlEncode(i) for i in LoadCourseFile(coursefile)]
htmlstructure = ParseStructure(htmlencoded) htmlstructure = ParseStructure(htmlencoded)
......
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
<h3>Web sites</h3> <h3>Web sites</h3>
...@@ -58,6 +53,3 @@ Guides etc. ...@@ -58,6 +53,3 @@ Guides etc.
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
Der er adgang til en GPU baseret server ifbm kurset. Serveren består af en Der er adgang til en GPU baseret server ifbm kurset. Serveren består af en
&#x27;master&#x27; som kan tilgås via &#x27;master&#x27; som kan tilgås via
...@@ -135,6 +130,3 @@ frigiver!</p> ...@@ -135,6 +130,3 @@ frigiver!</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
<dl> <dl>
<dt>[<b>AI</b>]: <dt>[<b>AI</b>]:
...@@ -82,6 +77,3 @@ ...@@ -82,6 +77,3 @@
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
<h3>Formål</h3> <h3>Formål</h3>
...@@ -86,6 +81,3 @@ at undersøg/bruge det).</p> ...@@ -86,6 +81,3 @@ at undersøg/bruge det).</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
<h3>Formål</h3> <h3>Formål</h3>
...@@ -118,6 +113,3 @@ brug for en python og lineær algebra kick-start.</p> ...@@ -118,6 +113,3 @@ brug for en python og lineær algebra kick-start.</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!-- AUTOGENERATED HTML from CourseBuilder, CEF -->
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<body style='font-family: times new roman, times, serif;font-size: 12pt;color: #000000;'>
<h3>Hands-on Machine Learning <span style='font-family: courier new, courier;'>[HOML]</span></h3> <h3>Hands-on Machine Learning <span style='font-family: courier new, courier;'>[HOML]</span></h3>
...@@ -53,6 +48,3 @@ og meget brugt i ML sammenhænge.) ...@@ -53,6 +48,3 @@ og meget brugt i ML sammenhænge.)
</body>
</html>
\ No newline at end of file
...@@ -58,25 +58,12 @@ ...@@ -58,25 +58,12 @@
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dir2<br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dir2<br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dir3<br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dir3<br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/Dir2/Dir3/dummy.txt'>dummy.txt</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/Dir2/Dir3/dummy.txt'>dummy.txt</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/L00.html'>L00.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/L01.html'>L01.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/course.tex'>course.tex</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/course.tex'>course.tex</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/plan.txt'>plan.txt</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Test/plan.txt'>plan.txt</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Utils<br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Utils<br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/colors.py'>colors.py</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/colors.py'>colors.py</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/dbg.py'>dbg.py</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/dbg.py'>dbg.py</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/mkutils.py'>mkutils.py</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Utils/mkutils.py'>mkutils.py</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Dokumentation_og_links.html'>Dokumentation_og_links.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/GPU_Cluster.html'>GPU_Cluster.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Journal_afleveringsformat.html'>Journal_afleveringsformat.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Kriterier_for_O4.html'>Kriterier_for_O4.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Kursusforkortelser.html'>Kursusforkortelser.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/L00.html'>L00.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/L01.html'>L01.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/L02.html'>L02.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/L03.html'>L03.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/L04.html'>L04.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Litteratur.html'>Litteratur.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Makefile'>Makefile</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/Makefile'>Makefile</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/course.tex'>course.tex</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/course.tex'>course.tex</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/mk_course.py'>mk_course.py</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/Etc/CourseBuilder/mk_course.py'>mk_course.py</a><br></span>
...@@ -143,7 +130,6 @@ ...@@ -143,7 +130,6 @@
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;Figs<br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;Figs<br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/Figs/ml_supervised_map.pdf'>ml_supervised_map.pdf</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/Figs/ml_supervised_map.pdf'>ml_supervised_map.pdf</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/Figs/ml_supervised_map.png'>ml_supervised_map.png</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/Figs/ml_supervised_map.png'>ml_supervised_map.png</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/l03.html'>l03.html</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/lesson03.pdf'>lesson03.pdf</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/lesson03.pdf'>lesson03.pdf</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/pipeline.ipynb'>pipeline.ipynb</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/pipeline.ipynb'>pipeline.ipynb</a><br></span>
<span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/train_test_split.ipynb'>train_test_split.ipynb</a><br></span> <span style="font-family: 'courier new', courier, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://itundervisning.ase.au.dk/ITMAL_E21/L03/train_test_split.ipynb'>train_test_split.ipynb</a><br></span>
......
<!DOCTYPE html>
<html>
<head>
</head>
<body style="font-family: Lato;font-size: 12pt;color: #494c4e;">
<h5>Form&aring;l</h5>
<p>Opsamlingslektion: vi tager et genblik p&aring; <em>&sect; 2 <em>"End-to-End Machine Learning Project",</em></em> og samler op p&aring; dette brede kapitel.</p>
<p>Vi g&aring;r f&oslash;rst igang med at gennemg&aring; <em><strong>K-fold Cross-validation</strong></em> (eller K-fold CV), for derefter at bruge "The Map" til at komme igennem alle grundliggende koncepter i <em>&sect; 2. </em><em><br /></em></p>
<p>Da alle kerne-koncepter i supervised ML nu kendes, kan det hele konkret sammens&aelig;ttes i en samlet processerings-<em><strong>pipeline</strong>.</em> Programmerings-teknisk ser vi derfor til sidst p&aring; Scikit-learns Pipelines.</p>
<ul>
<li><a rel="noopener" href="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10655397_1/xid-10655397_1" target="_blank" title="ml_supervised_map.pdf">Oversigtskortet for Supervised learning</a>:</li>
</ul>
<p style="margin-left: 60px;"><a rel="noopener" href="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10655397_1/xid-10655397_1" target="_blank" title="ml_supervised_map.pdf"><img src="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10655394_1/xid-10655394_1" alt="ml_supervised_map.pdf" title="ml_supervised_map.pdf" width="512" height="499" /></a></p>
<h5>Indhold</h5>
<ul>
<li>Generel genl&aelig;sning og repetition af <em>&sect; 2</em></li>
<li>K-fold Cross-validation</li>
<li>Pipelines<em></em></li>
</ul>
<h5>Litteratur</h5>
<p style="margin-left: 30px;"><em>Genl&aelig;s: &sect; 2 <em>"End-to-End Machine Learning Project" </em></em>[HOML]</p>
<p style="margin-left: 60px;">(eksklusiv <em>"Create the Workspace" </em>og <em>"Download the Data")</em></p>
<p style="margin-left: 30px;"><span style="color: #800000;"><span style="font-family: courier new, courier; color: #000000;"><a rel="noopener" href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.KFold.html?highlight=k%20fold#sklearn.model_selection.KFold" target="_blank"><span style="color: #000000;">Scikit's dokumentations-side vdr. k-fold CV</span></a></span><em> </em></span></p>
<h6>Forberedelse inden lektionen</h6>
<ul>
<li>L&aelig;s litteraturen.<em><br /></em></li>
</ul>
<h6>P&aring; klassen</h6>
<ol>
<li><span style="text-decoration: line-through;">'</span>Sp&oslash;rge-minutter'</li>
<li>Almindelig forel&aelig;sning
<ul>
<li>ekstra materiale: <span style="font-family: courier new, courier;"><a rel="noopener" href="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10655399_1/xid-10655399_1" target="_blank">k-fold_demo.ipynb</a></span></li>
</ul>
</li>
<li>Exercise: <span style="font-family: courier new, courier;"><a rel="noopener" href="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10655389_1/xid-10655389_1" target="_blank">pipelines.ipynb</a> <br /></span>
<ul>
<li><span style="color: #800000;"><span style="color: #000000;">Data til pipelines opgaven (b&oslash;r lige i L07/Data/</span>)</span>: <span style="font-family: courier new, courier;"><a rel="noopener" href="https://blackboard.au.dk/bbcswebdav/pid-2931054-dt-content-rid-10656401_1/xid-10656401_1" class="event_clickFileName" target="_blank">itmal_l01_data.pkl</a> </span></li>
<li>(Du har allerede denne data-fil, hvis du pull'er fra GITMAL)</li>