fix3
f
This commit is contained in:
parent
e880c09935
commit
b683993dfc
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -28,7 +28,7 @@ pipeline {
|
|||||||
stage('sh: Shell Script') {
|
stage('sh: Shell Script') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod +x test.sh'
|
sh 'chmod +x test.sh'
|
||||||
sh './test.sh ${CUTOFF}'
|
sh './test_jenkins.sh ${CUTOFF}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 5. Zapisanie zbioru danych [4 pkt] + 7. Parametry zadania [1 pkt]
|
// 5. Zapisanie zbioru danych [4 pkt] + 7. Parametry zadania [1 pkt]
|
||||||
|
31
Python_file.py
Normal file
31
Python_file.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import wget
|
||||||
|
url = 'https://git.wmi.amu.edu.pl/s434788/ium_434788/raw/branch/master/winequality-red.csv'
|
||||||
|
wget.download(url, out='winequality-red.csv', bar=None)
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
wine=pd.read_csv('winequality-red.csv')
|
||||||
|
wine
|
||||||
|
|
||||||
|
from sklearn.model_selection import train_test_split
|
||||||
|
|
||||||
|
wine_train, wine_test = train_test_split(wine, test_size=360,train_size=959, random_state=1)
|
||||||
|
|
||||||
|
wine_test["quality"].value_counts()
|
||||||
|
|
||||||
|
wine_train["quality"].value_counts()
|
||||||
|
|
||||||
|
wine
|
||||||
|
|
||||||
|
wine["quality"].value_counts()
|
||||||
|
|
||||||
|
wine.describe(include='all')
|
||||||
|
|
||||||
|
wine["quality"]=((wine["quality"]-wine["quality"].min())/(wine["quality"].max()-wine["quality"].min()))*20
|
||||||
|
|
||||||
|
wine["quality"].value_counts()
|
||||||
|
|
||||||
|
wine.isnull().sum()
|
||||||
|
|
||||||
|
wine.dropna(inplace=True)
|
||||||
|
|
||||||
|
print(wine)
|
21
test.sh
21
test.sh
@ -1,19 +1,2 @@
|
|||||||
# 5. Zapisanie zbioru danych [4 pkt] (Pobranie pliku .csv)
|
#Uruchomienie skryptu i wyświetlenie 10 pierwszych wierszy wyjściowej tabeli
|
||||||
curl -OL https://git.wmi.amu.edu.pl/s434788/ium_434788/raw/branch/master/winequality-red.csv
|
python3 Python_file.py
|
||||||
|
|
||||||
|
|
||||||
# 5. Zapisanie zbioru danych [4 pkt] (Podzielenie pliku csv na test/dev/train)
|
|
||||||
head -n 1 winequality-red.csv > header.csv
|
|
||||||
tail -n +2 winequality-red.csv | shuf > data.shuffled
|
|
||||||
|
|
||||||
head -n 266 data.shuffled > wine.data.test
|
|
||||||
head -n 532 data.shuffled | tail -n 266 > wine.data.dev
|
|
||||||
tail -n +333 data.shuffled > wine.data.train
|
|
||||||
|
|
||||||
cat header.csv wine.data.test > test.csv
|
|
||||||
cat header.csv wine.data.dev > dev.csv
|
|
||||||
cat header.csv wine.data.train > train.csv
|
|
||||||
|
|
||||||
# 7. Parametry zadania [1 pkt]
|
|
||||||
head -n $1 data.shuffled > zadanie7.data
|
|
||||||
cat header.csv zadanie7.data > zadanie7.csv
|
|
19
test_jenkins.sh
Normal file
19
test_jenkins.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# 5. Zapisanie zbioru danych [4 pkt] (Pobranie pliku .csv)
|
||||||
|
curl -OL https://git.wmi.amu.edu.pl/s434788/ium_434788/raw/branch/master/winequality-red.csv
|
||||||
|
|
||||||
|
|
||||||
|
# 5. Zapisanie zbioru danych [4 pkt] (Podzielenie pliku csv na test/dev/train)
|
||||||
|
head -n 1 winequality-red.csv > header.csv
|
||||||
|
tail -n +2 winequality-red.csv | shuf > data.shuffled
|
||||||
|
|
||||||
|
head -n 266 data.shuffled > wine.data.test
|
||||||
|
head -n 532 data.shuffled | tail -n 266 > wine.data.dev
|
||||||
|
tail -n +333 data.shuffled > wine.data.train
|
||||||
|
|
||||||
|
cat header.csv wine.data.test > test.csv
|
||||||
|
cat header.csv wine.data.dev > dev.csv
|
||||||
|
cat header.csv wine.data.train > train.csv
|
||||||
|
|
||||||
|
# 7. Parametry zadania [1 pkt]
|
||||||
|
head -n $1 data.shuffled > zadanie7.data
|
||||||
|
cat header.csv zadanie7.data > zadanie7.csv
|
Loading…
Reference in New Issue
Block a user