Artificial Intelligence

NIFTY Index Price Movement Prediction with LSTM Keras

2Views

Disclaimer

12 Comments

  • Got your files from GitHub and run loadData first, then run, preprocess then run buildModel and get:

    —————————————————————————

    ValueError Traceback (most recent call last)

    <ipython-input-4-0b55985f689f> in <module>

    10

    11

    —> 12 df=loadData.load()

    13

    14 # features=len(df.columns)

    ~DesktopNifty ProjectloadData.py in load()

    64

    65 def load():

    —> 66 tickers=get_nifty50_list(True)

    67 df=pd.DataFrame()

    68 for ticker in tickers:

    ~DesktopNifty ProjectloadData.py in get_nifty50_list(scrap)

    39 def get_nifty50_list(scrap=False):

    40 if scrap:

    —> 41 tickers=nifty_50_list()

    42 else:

    43 with open("nifty50_list.pickle","rb") as f:

    ~DesktopNifty ProjectloadData.py in nifty_50_list()

    31 tickers.append('MM')#Adding it manually since quandl code is different than the ticker symbol obtained from Wiki which is M&M

    32 tickers.append('NIFTY_50')#Fetching data for NIFTY50 index whose price we want to predict

    —> 33 tickers.remove('VEDL')

    34 tickers.remove('UPL')

    35 tickers.remove('IBULHSGFIN')

    ValueError: list.remove(x): x not in list

  • For me it prints the ticker symbols and gives the following error:
    ——————————————————————————————————–
    Traceback (most recent call last):
    File "c:UsersknikhNEHA NIFTY_50_STOCK_PREDICTION-masterbuildModel.py", line 12, in <module>
    df=loadData.load()
    File "c:UsersknikhNEHA NIFTY_50_STOCK_PREDICTION-masterloadData.py", line 69, in load
    getStockdataFromQuandl(ticker)
    File "c:UsersknikhNEHA NIFTY_50_STOCK_PREDICTION-masterloadData.py", line 53, in getStockdataFromQuandl
    data=quandl.get(quandl_code,start_date=startdate,end_date=enddate)
    File "D:Anacondaenvsvenvlibsite-packagesquandlget.py", line 45, in get
    dataset_args = _parse_dataset_code(dataset)
    File "D:Anacondaenvsvenvlibsite-packagesquandlget.py", line 71, in _parse_dataset_code
    raise ValueError(Message.ERROR_COLUMN_INDEX_TYPE % dataset)
    ValueError: The column index must be expressed as an integer for NSE/ADANIPORTS.NS.

    [Done] exited with code=1 in 4.913 seconds

  • Great job once again. Try using cuDNNLSTM or cuDNNGRU. The training will be lot faster. You need to have cuda tool kit and nvidia GPU. Also make the model stateful, the learning from each time step will be carried to the next time step. Currently there is not much learning from past history.

  • Hello neha!

    def getStockdataFromQuandl(ticker):
    quandl_code="NSE/"+ticker

    try:

    if not os.path.exists(f'stock_data/{ticker}.csv'):

    data=quandl.get(quandl_code,start_date=start_date,end_date=end_date)

    data.to_csv(f'stock_data/{ticker}.csv')

    else:

    print(f"stock data for {ticker} already exists")

    except quandl.errors.quandl_error.NotFoundError as e:

    print(ticker)

    print(str(e))

    I get an error like this….

    ValueError Traceback (most recent call last)

    <ipython-input-43-6c9192144dd2> in <module>()

    19

    20

    —> 21 load()

    3 frames

    /usr/local/lib/python3.6/dist-packages/quandl/get.py in _parse_dataset_code(dataset)

    69 dataset_temp = dataset.split('.')

    70 if not dataset_temp[1].isdigit():

    —> 71 raise ValueError(Message.ERROR_COLUMN_INDEX_TYPE % dataset)

    72 return {'code': dataset_temp[0], 'column_index': int(dataset_temp[1])}

    73

    ValueError: The column index must be expressed as an integer for NSE/ADANIPORTS.NS.

  • I don't know why your subscribers are less , but plse keep uploading videos,it is very helpful and soon you will get too much subscribers that u deserves

Leave a Reply