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
Title: Linear regression of Housing Values in Suburbs of Boston using PyData | |
Slug: linear-regression-with-python | |
Date: 2017-11-06 0:00 | |
Category: Notebook | |
Tags: Python |
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
const hoge = results.hoge; | |
// ↓ | |
const { hoge } = results; |
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 android.app.Activity | |
import android.os.Build | |
import android.os.Bundle | |
import android.util.Log | |
import com.google.android.things.pio.PeripheralManagerService | |
class MainActivity : Activity() { | |
private val TAG = "MainActivity" | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) |
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
from __future__ import print_function | |
import tensorflow as tf | |
class FizzBuzz(): | |
def __init__(self, length=30): | |
self.length = length | |
self.array = tf.Variable([str(i) for i in range(1, length+1)], dtype=tf.string, trainable=False) | |
self.graph = tf.while_loop(self.cond, self.body, [1, self.array], | |
shape_invariants=[tf.TensorShape([]), tf.TensorShape(self.length)], | |
back_prop=False) | |
def run(self): |
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
timesteps = 40 # 最大系列長 | |
input_dim = 3 # 入力次元 | |
df = pd.read_csv('example.csv') | |
seq = df.as_matrix() | |
seq_length = seq.shape[0] # 対象となるデータの系列長 | |
seq_0padding = np.r_[seq, np.zeros((timesteps-seq_length, input_dim))] |
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 | |
from keras.models import Sequential | |
from keras.layers import Dense, Activation | |
from keras import optimizers | |
from keras.callbacks import EarlyStopping | |
from sklearn.utils import shuffle | |
from sklearn.model_selection import train_test_split | |
# Setup dataset | |
np.random.seed(1234) |
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 | |
np.random.seed(1234) | |
from keras.models import Sequential | |
from keras.layers import Dense, Activation | |
from keras import optimizers | |
from keras.wrappers.scikit_learn import KerasClassifier | |
from sklearn.utils import shuffle | |
from sklearn.model_selection import GridSearchCV |
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 | |
from sklearn.model_selection import train_test_split | |
from sklearn.utils import shuffle | |
from sklearn import svm | |
from sklearn.metrics import precision_score | |
from sklearn.metrics import recall_score | |
from sklearn.metrics import f1_score | |
np.random.seed(1234) | |
n_data = 200 |