Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
''' | |
Part 1. | |
Preparing data for conv net | |
Data can be found here: | |
https://www.kaggle.com/ucffool/dice-d4-d6-d8-d10-d12-d20-images | |
''' | |
from PIL import Image | |
import os | |
import numpy as np |
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
''' | |
Part 2. | |
Loading previously saved data, modeling the convolutional NN, fitting the model. | |
It took me ~10 minutes to train on my PC, so I saved it for further use. | |
''' | |
import numpy as np | |
import pickle | |
import tensorflow as tf | |
from tensorflow.keras.layers import Conv2D, Dense, MaxPooling2D, Flatten, Dropout |
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 pandas as pd | |
# prepare data for models | |
def pepper_data(df): | |
df.rename(columns={'v2a1':'monthly_rent', | |
'hacdor':'overcrowd_bedroom', | |
'hacapo':'overcrowd_rooms', | |
'v14a':'has_bathroom', | |
'refrig':'has_refrigerator', | |
'r4t1':'persons_younger_12', |
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
''' | |
Тестовое задание: необходимо составить программу на python, | |
рисующую графики ошибок 1го и 2го рода для двух статистических гипотез (H0 и H1). | |
Параметры распределения гипотез выбрать самостоятельно. | |
''' | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def gauss(x,mu=0,sigma=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
import pandas as pd | |
import numpy as np | |
import seaborn as sns | |
# loading data | |
training_data=pd.read_csv('train.csv') | |
test_data=pd.read_csv('test.csv') | |
# preprocessing data | |
y_train=training_data['SalePrice'] |