Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

preprocess.R 589 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. input_file <- read.csv(file = 'data/alarm.tsv',
  2. sep='\t', stringsAsFactors=FALSE)
  3. # Quero apenas as primeiras 10 features
  4. input_file <- input_file[, 1:20]
  5. #
  6. input_file <-
  7. apply(input_file,
  8. 2,
  9. function(x) ifelse(x == 'NORMAL', 0, x))
  10. input_file <-
  11. apply(input_file,
  12. 2,
  13. function(x) ifelse(x == 'HIGH', 1, x))
  14. input_file <-
  15. apply(input_file,
  16. 2,
  17. function(x) ifelse(x == 'LOW', -1, x))
  18. write.csv2(input_file,
  19. 'data/simulation_preprocessed.csv',
  20. row.names=FALSE)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...