Coder Social home page Coder Social logo

Comments (3)

aaalvinnn avatar aaalvinnn commented on May 26, 2024

u can try this way:

import numpy as np
DATA_PATH = './npydata/'
# read dataset
X_train = np.load(DATA_PATH + 'X_train.npy')
y_train = np.load(DATA_PATH + 'y_train.npy')
X_test = np.load(DATA_PATH + 'X_test.npy')
y_test = np.load(DATA_PATH + 'y_test.npy')

# convert to dataloader
X, y, splits = combine_split_data([X_train, X_test], [y_train, y_test])
tfms  = [None, [Categorize()]]
dsets = TSDatasets(X, y, tfms=tfms, splits=splits, inplace=True)
dls = TSDataLoaders.from_dsets(dsets.train, dsets.valid, bs=64, batch_tfms=[TSStandardize()], num_workers=0)

where DATA_PATH is ur dataset with numpy form.
Whats more, tsai library has specific format requirements for input data (such as X_train and X_test here). u can check this from their Tutorial: https://timeseriesai.github.io/tsai/tutorials.html

from tsai.

Albertccy avatar Albertccy commented on May 26, 2024

TypeError Traceback (most recent call last)
Cell In[81], line 13
10 X, y, splits = combine_split_data([X_train, X_test], [y_train, y_test])
11 tfms = [None, [Categorize()]]
---> 13 dsets = TSDatasets(X, y, tfms=tfms, splits=splits, inplace=True)
14 dls = TSDataLoaders.from_dsets(dsets.train, dsets.valid, bs=64, batch_tfms=[TSStandardize()], num_workers=0)

TypeError: unhashable type: 'numpy.ndarray'

then I have this error when I used your sentence.could you do me a favor that what I should do?thanks a lot.

from tsai.

aayushukla avatar aayushukla commented on May 26, 2024

Hey I am also facing this same issue. Were you able to resolve it? @Albertccy

from tsai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.