fix script
This commit is contained in:
parent
82b655ce2f
commit
00f443439e
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@ -15,9 +15,9 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
|
||||||
sh 'pip install kaggle'
|
sh 'pip install kaggle'
|
||||||
sh 'kaggle datasets download -d nasa/meteorite-landings'
|
sh 'kaggle datasets download -d uciml/forest-cover-type-dataset'
|
||||||
sh 'unzip -o meteorite-landings.zip'
|
sh 'unzip -o forest-cover-type-dataset.zip'
|
||||||
sh 'rm meteorite-landings.zip'
|
sh 'rm forest-cover-type-dataset.zip'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ pipeline {
|
|||||||
def customImage = docker.build("custom-image")
|
def customImage = docker.build("custom-image")
|
||||||
customImage.inside {
|
customImage.inside {
|
||||||
sh 'python3 ./IUM_2.py'
|
sh 'python3 ./IUM_2.py'
|
||||||
archiveArtifacts artifacts: 'meteorite-landings.csv, meteorite_train.csv, meteorite_test.csv, meteorite_val.csv', onlyIfSuccessful: true
|
archiveArtifacts artifacts: 'covtype.csv, forest_train.csv, forest_test.csv, forest_val.csv', onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
kaggle datasets download -d nasa/meteorite-landings
|
kaggle datasets download -d uciml/forest-cover-type-dataset
|
||||||
|
|
||||||
unzip -o meteorite-landings.zip
|
unzip -o forest-cover-type-dataset.zip
|
||||||
|
|
||||||
###Zmienne###
|
###Zmienne###
|
||||||
|
|
||||||
@ -10,12 +10,12 @@ test_val_ratio=0.5
|
|||||||
|
|
||||||
##Przetwrazanie pliku##
|
##Przetwrazanie pliku##
|
||||||
|
|
||||||
shuf meteorite-landings.csv -o shuffled-meteorite-landings.csv
|
shuf covtype.csv -o forest.csv
|
||||||
|
|
||||||
##Cut off $1 rows##
|
##Cut off $1 rows##
|
||||||
head -n $1 shuffled-meteorite-landings.csv > shuffled-meteorite-landings.csv
|
head -n $1 forest.csv > forest.csv
|
||||||
|
|
||||||
total_lines=$(wc -l < shuffled-meteorite-landings.csv)
|
total_lines=$(wc -l < forest.csv)
|
||||||
train_lines=$(echo $total_lines*$train_ratio| bc)
|
train_lines=$(echo $total_lines*$train_ratio| bc)
|
||||||
train_lines=$(echo "($train_lines+0.5)/1" | bc )
|
train_lines=$(echo "($train_lines+0.5)/1" | bc )
|
||||||
|
|
||||||
@ -24,9 +24,9 @@ test_lines=$(echo "($test_lines+0.5)/1" | bc )
|
|||||||
|
|
||||||
validation_lines=$(echo $total_lines-$train_lines-$test_lines | bc)
|
validation_lines=$(echo $total_lines-$train_lines-$test_lines | bc)
|
||||||
|
|
||||||
head -n "$train_lines" shuffled-meteorite-landings.csv > "meteorite_train.csv"
|
head -n "$train_lines" forest.csv > "forest_train.csv"
|
||||||
tail -n $((test_lines+validation_lines)) shuffled-meteorite-landings.csv | head -n "$test_lines" > "meteorite_test.csv"
|
tail -n $((test_lines+validation_lines)) forest.csv | head -n "$test_lines" > "forest_test.csv"
|
||||||
tail -n "$validation_lines" shuffled-meteorite-landings.csv > "meteorite_validation.csv"
|
tail -n "$validation_lines" forest.csv > "forest_validation.csv"
|
||||||
|
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
mv meteorite-landings.csv shuffled-meteorite-landings.csv meteorite_test.csv meteorite_train.csv meteorite_validation.csv artifacts/
|
mv covtype.csv forest.csv forest_test.csv forest_train.csv forest_validation.csv artifacts/
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
wc -l artifacts/meteorite_train.csv > stats_train.txt
|
wc -l artifacts/forest_train.csv > stats_train.txt
|
||||||
|
|
||||||
wc -l artifacts/meteorite_test.csv > stats_test.txt
|
wc -l artifacts/forest_test.csv > stats_test.txt
|
||||||
|
|
||||||
wc -l artifacts/meteorite_validation.csv > stats_validation.txt
|
wc -l artifacts/forest_validation.csv > stats_validation.txt
|
||||||
|
|
||||||
mv stats_train.txt stats_test.txt stats_validation.txt artifacts/
|
mv stats_train.txt stats_test.txt stats_validation.txt artifacts/
|
Loading…
Reference in New Issue
Block a user