This problem will happen because the function corr() cannot calculate the correlation for the columns that are declared as non-numerical data, in this example the Date column has type object. I've solved the problem by following the below step-by-step: # checking which columns contain numerical data print(gold_data.dtypes) # select only the columns with numerical values numerical_data = gold_data.select_dtypes(include=['float64', 'int64']) # calculate the correlation correlation = numerical_data.corr() print(correlation) # constructing a heatmap to understand the correlation plt.figure(figsize=(8,8)) sns.heatmap(correlation, cbar=True, square=True, fmt='.1f', annot=True, annot_kws={'size':8}, cmap='Blues')
Maybe this problem is specific to me but the correlation method is returning an error which mentions that date is a string. I worked around it by dropping the date column and then finding the correlation. Not sure if it's the right way to go about it though...!
Hi thanks for your wonderful content I just have a problem, in 16:12 i get an error : ValueError : could not convert string to float : '1/2/2008', Could you please help me to solve it?
Yeah. This is because the corr() function while calculating correlation does not accept Strings(dates are strings in the dataset). So, u can solve this issue by dropping the Date column from the dataset before running that line. Add this cell before that line: gold_data = gold_data.drop('Date',axis=1) and execute again. Now the error will go away
Why are the project not in serial order and few are missing !! also i feel few projects are taken from other youtube channels, sorry if offended but have strong step to step copy paste !!
Can I use this project as a mini project for college coz iam a beginner and doing this project in 2 year of studying Can u help me How to do the project
Sir I have a doubt like the dates are also important during the prediction of the gold price how should we make our model to take the date variable too. And sir similar in the case of the car price prediction we have dropped the car brand and the name of the car there also . And these things also important in the prediction of the prices of the car Regards
hi! you can try a time series prediction kind of an approach for gold price prediction. for car price prediction, you can definitely add the brands as feature for training. my goal while making the videos will be to clearly explain the implementation and the process in it. I may miss a thing or two. so you can definitely improvise a lot.
Monet12 Thank you for a wonderful and thorough explanation. When are you gonna make a project in forecasting stock prices so i can become a billionaire?
It's very easy to understand. thanks What is the reason behind in R square error to use is there any other functions we can use?.. can you explain more on this please.
Might be. It is in us dollars. I am not sure what is the specific metric. You can refer this for details about the dataset: www.kaggle.com/altruistdelhite04/gold-price-data