I am currently doing the Logistic Regression in machine learning for python. This is the code i write.
import pandas as pd
from sklearn import linear_model
import numpy as np
from sklearn.utils import column_or_1d
logistic = linear_model.LogisticRegression()
data = pd.read_excel('/home/mick/PycharmProjects/project1/excel/Ron95_Price_Class.xlsx')
X = data[['Date']]
y = data[['Ron95_RM']]
y = np.ravel(y)
logistic.fit(X, y)
price = logistic.predict(42491)
print "The price for Ron95 in next month will be RM", np.array_str(price,1)
This is the output of the code
The price for Ron95 in next month will be RM [ u'B']
There is no error, but my question is the characters after RM in the output should be 'B' or an other characters. I wonder if it's because I do the code wrongly or is just a format problem with the numpy array.
Because I basically just started with Python today, sorry if I just made a stupid mistake.