# naive prediction model
from pandas import read_csv
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# load the dataset
data = read_csv('combined.csv', header=0, index_col=0, parse_dates=True, squeeze=True)
values = data.values
# split data into inputs and outputs
X, y = values[:, :-1], values[:, -1]
# split the dataset
trainX, testX, trainy, testy = train_test_split(X, y, test_size=0.3, shuffle=False, random_state=1)

# make a naive prediction
def naive_prediction(testX, value):
	return [value for x in range(len(testX))]

# evaluate skill of predicting each class value
for value in [0, 1]:
	# forecast
	yhat = naive_prediction(testX, value)
	# evaluate
	score = accuracy_score(testy, yhat)
	# summarize
	print('Naive=%d score=%.3f' % (value, score))
712fd025f55f42aedcc73a60799a23165bdc794e
<mask token>


def naive_prediction(testX, value):
    return [value for x in range(len(testX))]


<mask token>

<mask token>


def naive_prediction(testX, value):
    return [value for x in range(len(testX))]


for value in [0, 1]:
    yhat = naive_prediction(testX, value)
    score = accuracy_score(testy, yhat)
    print('Naive=%d score=%.3f' % (value, score))

<mask token>
data = read_csv('combined.csv', header=0, index_col=0, parse_dates=True,
    squeeze=True)
values = data.values
X, y = values[:, :-1], values[:, -1]
trainX, testX, trainy, testy = train_test_split(X, y, test_size=0.3,
    shuffle=False, random_state=1)


def naive_prediction(testX, value):
    return [value for x in range(len(testX))]


for value in [0, 1]:
    yhat = naive_prediction(testX, value)
    score = accuracy_score(testy, yhat)
    print('Naive=%d score=%.3f' % (value, score))

from pandas import read_csv
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
data = read_csv('combined.csv', header=0, index_col=0, parse_dates=True,
    squeeze=True)
values = data.values
X, y = values[:, :-1], values[:, -1]
trainX, testX, trainy, testy = train_test_split(X, y, test_size=0.3,
    shuffle=False, random_state=1)


def naive_prediction(testX, value):
    return [value for x in range(len(testX))]


for value in [0, 1]:
    yhat = naive_prediction(testX, value)
    score = accuracy_score(testy, yhat)
    print('Naive=%d score=%.3f' % (value, score))

# naive prediction model
from pandas import read_csv
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# load the dataset
data = read_csv('combined.csv', header=0, index_col=0, parse_dates=True, squeeze=True)
values = data.values
# split data into inputs and outputs
X, y = values[:, :-1], values[:, -1]
# split the dataset
trainX, testX, trainy, testy = train_test_split(X, y, test_size=0.3, shuffle=False, random_state=1)

# make a naive prediction
def naive_prediction(testX, value):
	return [value for x in range(len(testX))]

# evaluate skill of predicting each class value
for value in [0, 1]:
	# forecast
	yhat = naive_prediction(testX, value)
	# evaluate
	score = accuracy_score(testy, yhat)
	# summarize
	print('Naive=%d score=%.3f' % (value, score))