diff --git a/Jenkinsfile b/Jenkinsfile index 6d7c907..cf6434c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ pipeline { stage('sh: Shell Script') { steps { 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] diff --git a/Python_file.py b/Python_file.py new file mode 100644 index 0000000..0d96283 --- /dev/null +++ b/Python_file.py @@ -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) \ No newline at end of file diff --git a/test.sh b/test.sh index a4150e5..0efedce 100644 --- a/test.sh +++ b/test.sh @@ -1,19 +1,2 @@ -# 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 \ No newline at end of file +#Uruchomienie skryptu i wyświetlenie 10 pierwszych wierszy wyjściowej tabeli +python3 Python_file.py \ No newline at end of file diff --git a/test_jenkins.sh b/test_jenkins.sh new file mode 100644 index 0000000..a4150e5 --- /dev/null +++ b/test_jenkins.sh @@ -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 \ No newline at end of file