Machine Learning (Part 4)

Notebooks

Colab

Colab is Google's implementation of Jupyter Notebooks.

 A Colab consists of text comments and code

NumPy

NumPy is a Python library for creating and manipulating vectors and matrices.

import numpy as np

np.array([...])

np.array([[...],[...],...,[...]]

a sequence from 5 to 11

6 random values between 50 and 100

5 random floating point values between 0 and 1

feature and label

adding noise

Pandas

Pandas DataFrames are similar to spreadsheets. DataFrames have columns and rows.

import numpy and pandas

pd.DataFrame(data=<data cell values>, columns=<column names>)

<dataframe>["<new column name>"] = <dataframe>["<existing column name>"] + <constant>

<dataframe>[<start index>,<end index + 1>]

<dataframe>.copy()