This file contains hidden or 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
| ## Read the reviews first. | |
| g = open('reviews.txt','r') # What we know! | |
| reviews = list(map(lambda x:x[:-1],g.readlines())) | |
| g.close() | |
| g = open('labels.txt','r') # What we WANT to know! | |
| labels = list(map(lambda x:x[:-1].upper(),g.readlines())) | |
| g.close() | |
| from collections import Counter |
This file contains hidden or 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
| version: '2' | |
| services: | |
| my-test-server: | |
| image: nginx | |
| ports: | |
| - "80:80" | |
| volumes: | |
| - my-test-store:/usr/share/nginx/html:ro | |
| volumes: |
This file contains hidden or 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
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "path/filepath" | |
| "strconv" |
This file contains hidden or 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 numpy as np | |
| def sigmoid(x): | |
| # sigmoid function | |
| return 1/(1+np.exp(-x)) | |
| inputs = np.array([0.7, -0.3]) | |
| weights = np.array([0.1, 0.8]) | |
| bias = -0.1 |
This file contains hidden or 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
| # TODO: Add import statements | |
| import pandas as pd | |
| from sklearn import linear_model | |
| # Assign the dataframe to this variable. | |
| # TODO: Load the data | |
| bmi_life_data = pd.read_csv("bmi_and_life_expectancy.csv") | |
| # Make and fit the linear regression model |
This file contains hidden or 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
| Country | Life expectancy | BMI | |
|---|---|---|---|
| Afghanistan | 52.8 | 20.62058 | |
| Albania | 76.8 | 26.44657 | |
| Algeria | 75.5 | 24.5962 | |
| Andorra | 84.6 | 27.63048 | |
| Angola | 56.7 | 22.25083 | |
| Armenia | 72.3 | 25.355420000000002 | |
| Australia | 81.6 | 27.56373 | |
| Austria | 80.4 | 26.467409999999997 | |
| Azerbaijan | 69.2 | 25.65117 |
This file contains hidden or 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
| package main | |
| import ( | |
| "github.com/docker/go-plugins-helpers/volume" | |
| ) | |
| const ( | |
| sshfsID = "_sshfs" | |
| socketAddress = "/run/docker/plugins/my-dummy-fs.sock" | |
| ) |
This file contains hidden or 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
| // Driver represent the interface a driver must fulfill. | |
| type Driver interface { | |
| Create(Request) Response | |
| List(Request) Response | |
| Get(Request) Response | |
| Remove(Request) Response | |
| Path(Request) Response | |
| Mount(MountRequest) Response | |
| Unmount(UnmountRequest) Response | |
| Capabilities(Request) Response |
This file contains hidden or 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
| # fetch code. | |
| $ go get github.com/minio/minfs | |
| # cd to directory. | |
| $ cd $GOPATH/src/github.com/minio/minfs | |
| # build the docker container for Minfs. | |
| $ docker build minio/minfs . | |
| # Run Minfs Docker container. |
This file contains hidden or 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
| # Install fuse on the host. | |
| $ sudo apt-get install fuse | |
| # On host - Fetch and builds Minfs. | |
| $ go get github.com/minio/minfs | |
| # On host - Set Access and Secret Key of the Minio server. | |
| $ export MINFS_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F | |
| $ export MINFS_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG |