









Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!










Data structures : how data can be represented in memory Coding : process designing, building computer program to perform specific task (algorithm representation) At the root of programming: algorithm ALGORITHM : Works on Ideal memory, made of ABSTRACT data structures ranging from variables to lists
HOW TO EXECUTE PROGRAMS: Compiled languages : a complier (special program) translates source code in specific machine language output is an executable program
Greater < Less than = Greater or equal <= Less than or equal
Assignment operators Operator Syntax Same as
dare moat
E
Binary search complexity Sequential search complexity Best case O(1) O(1) Worst/average case n/2k^ = 1 log 2 (n)+1 O(n) With n = 1 million 9 operations (sorted data) 1 million operations (unsorted dat) Binary search : + elegante import math def binaryPos(mylist, x, start=0, end=-1): if end == - 1: end = len(mylist) mid = math.floor((start+end)/2) if mylist[mid] == x: found = True else: if start < end: #so if we can divide again sublist if mylist[mid] > x: return(binaryPos(mylist, x, stard, mid - 1)) else: return(binaryPos(mylist, x, mid + 1, end)) else: found = False def binaryPos (mylist, x): return return (binaryPos(mylist, x) != None) result in just one line Iterative Binary Search Function : returns index [pos] of x in given array if present, else returns - 1 def binary_search(arr, x): low = 0 high = len(arr) - 1 mid = 0 while low <= high: mid = (high + low) // 2 if arr[mid] < x: # Check if x is present at mid low = mid + 1 elif arr[mid] > x: # If x is greater, ignore left half high = mid - 1 else: # If x is smaller, ignore right half return mid return - 1 # convention, not important - 1 EFFICIENT: insertion > bubble > selection https://www.toptal.com/developers/sorting-algorithms SORTING ALGORITHMS : “algorithm that put elements of a list in certain order” (numerical/lexicographical)
O
9in alter (^) list e I
Import numpy as np: Multidimensional matrix : we can specify as many dimensions as we need: Array = np.array([3, 6, 9, 12]) transform (cast) list in array Division = array/3 with lists I couldn’t do it in one only line (heterogeneous elements) ndarray (usually fixed size) multidimensional container of items of the same type and size N° of dimensions and items defined by its shape (tuple of N non negative integers that specify size of each dimension Basic function for array creation : np.array(data, datatype) datatype inferred by data nature Popular NumPy functions : np.zeros(shape) create array and initialize elements to 0 np.zeros (plain, rows, columns) np.ones() create array and initialize to 1 np.arange(number) create array that contain numbers until the one specified np.arange(start, end, increment) end excluded (I care about position np.linspace(start, end, numberOfPoints) end included (interval divided in tot) np.full(shape, value, dtype=int) array creation ; value initialize array to that value
ONE dimensional polynomial class
Pandas data structures : Series: one dimensional labeled array capable of holding any data type
CSV: comma separated values Returns lowest index in the string where substring is found: position in which sub starts
g
Keys needed to decrypt held in escrow à an authorized third party may gain access to keys under certain circumstances SSL = secure sockets layer = unique standard about security on internet (to secure internet browser) Digital certificate : certificate that a given public key is associated to a given identity Security issues : Malware: software that performs hidden actions to weaken security of our system
Ee E
Process mapping à risk identification à risk evaluation à risk treatment ISO 27001 : standard for information security :
Advantages of approach :
chain to demonstrate how information security is guaranteed
DATA SCIENCE : field of study that combines:
Applies machine learning algorithms to numbers, text, images, video, audio and more to produce artificial intelligence (AI) systems to perform tasks that ordinarily require human intelligence Systems generate insights which analysts and business users can translate into tangible business values Problems targeted :
A DATA SCIENCE PROBLEM : classification through regression : Dataset 4 columns x 7 rows of data, 1 of titles Regression = predicting a cell missing in the dataset through known data
o Dependent variable can be continuous only (not categorial) Techniques to build a predictor : Predicting power taking in account an error
o Calculates the slope and the intercept of the line describing dependency of y upon x o Equation of the line: Y^I = b 0 + b 1 Xi o B 1 =slope, b 0 =intercept of Y^ when Xi= o Before train the model (80% dataset) à then test (20%)
ARTIFICIAL INTELLIGENCE : simulation of human intelligence processes by machines, computer systems Can have very specific applications To do so we assume activity of brain are computational process
Image processing and face detection : E 4 I