@dgadela wrote:
Hi,
I’m new to ML and trying to build algorithms based on the data available in the net.
I have taken data available in the reservoir from the past 5 years and i’m trying to predict the water level for the next year.While executing the code in python i’m getting the below. Can someone help me to resolve this issue.
Sample Dataset :
01-01-2004,3.90,0.00,268.00,0.00
Code in Python :
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVCurl=“C:/Users/id856158/Downloads/creditcardfraud/chennai_reservoir_levels.csv”
names=[‘Date’,‘POONDI’,‘CHOLAVARAM’,‘REDHILLS’,‘CHEMBARAMBAKKAM’]
dataset=pd.read_csv(url,names=names)print(dataset.head(5))
print(dataset.shape)array=dataset.values
X=array[:,0:5]x_train,x_test,y_train,y_test=model_selection.train_test_split(X,Y,test_size=0.2,random_state=2)
model = LinearRegression()
model.fit(x_train,y_train)Error :
ValueError: could not convert string to float: ‘19-01-2011’
Posts: 1
Participants: 1