Coder Social home page Coder Social logo

Example of CSV file reading about minirocket HOT 5 CLOSED

angus924 avatar angus924 commented on August 19, 2024
Example of CSV file reading

from minirocket.

Comments (5)

angus924 avatar angus924 commented on August 19, 2024

Hi @jumpingfella, the fit(...) and transform(...) functions from minirocket.py require the data to be in the form of a 2d numpy array, with dtype np.float32. Each row is a different time series, so if you have 10 timeseries, and each time series is of length 100, then your array should have 10 rows and 100 columns.

Does this answer your question?

from minirocket.

jumpingfella avatar jumpingfella commented on August 19, 2024

thanks, I had some progress with the following:

    df = df.to_numpy()
    df = df.astype(np.float32)
    print(df.shape)
    print(df)

which produces

(301, 2)
[[1.6197731e+12 5.4559469e+04]
 [1.6197731e+12 5.4563930e+04]
 [1.6197731e+12 5.4554230e+04]
 [1.6197731e+12 5.4564340e+04]

but then I get

parameters = fit(df)
  File "minirocket.py", line 130, in fit
    biases = _fit_biases(X, dilations, num_features_per_dilation, quantiles)
ValueError: unable to broadcast argument 1 to output array
File "minirocket.py", line 77

from minirocket.

angus924 avatar angus924 commented on August 19, 2024

Hi @jumpingfella, if I understand correctly, you are treating the input as being 301 time series, each of length 2. I think it is more likely that one of your columns is a time series (i.e., you have 1 or 2 time series, each of length 301).

Could you describe your data in a little more detail, and what you are trying to do? Then I might be able to help a bit better. At the moment, I'm not sure whether MiniRocket is the right fit for your data.

Thanks very much.

from minirocket.

jumpingfella avatar jumpingfella commented on August 19, 2024

I'm trying to do classification of bitcoin price. In my data first column is a timestamp, second - close price. Data arrives in 5 seconds intervals. I'm guessing that I need to keep only close column and do df = np.transpose(df)

from minirocket.

jumpingfella avatar jumpingfella commented on August 19, 2024

My problems are resolved with:

df = df.to_numpy()
df = df.astype(np.float32)
df = np.transpose(df)

Could be still nice to have full script which reads from CSV file.

from minirocket.

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.