commit 3d28b2d7edb4b90f77a47973d2fce8444cbd2423 Author: Waneksio Date: Tue Nov 29 23:36:06 2022 +0100 Add data converter and datasets diff --git a/MasterThesis/AirPassengers.csv b/MasterThesis/AirPassengers.csv new file mode 100644 index 0000000..7014d86 --- /dev/null +++ b/MasterThesis/AirPassengers.csv @@ -0,0 +1,145 @@ +Month,#Passengers +1949-01,112 +1949-02,118 +1949-03,132 +1949-04,129 +1949-05,121 +1949-06,135 +1949-07,148 +1949-08,148 +1949-09,136 +1949-10,119 +1949-11,104 +1949-12,118 +1950-01,115 +1950-02,126 +1950-03,141 +1950-04,135 +1950-05,125 +1950-06,149 +1950-07,170 +1950-08,170 +1950-09,158 +1950-10,133 +1950-11,114 +1950-12,140 +1951-01,145 +1951-02,150 +1951-03,178 +1951-04,163 +1951-05,172 +1951-06,178 +1951-07,199 +1951-08,199 +1951-09,184 +1951-10,162 +1951-11,146 +1951-12,166 +1952-01,171 +1952-02,180 +1952-03,193 +1952-04,181 +1952-05,183 +1952-06,218 +1952-07,230 +1952-08,242 +1952-09,209 +1952-10,191 +1952-11,172 +1952-12,194 +1953-01,196 +1953-02,196 +1953-03,236 +1953-04,235 +1953-05,229 +1953-06,243 +1953-07,264 +1953-08,272 +1953-09,237 +1953-10,211 +1953-11,180 +1953-12,201 +1954-01,204 +1954-02,188 +1954-03,235 +1954-04,227 +1954-05,234 +1954-06,264 +1954-07,302 +1954-08,293 +1954-09,259 +1954-10,229 +1954-11,203 +1954-12,229 +1955-01,242 +1955-02,233 +1955-03,267 +1955-04,269 +1955-05,270 +1955-06,315 +1955-07,364 +1955-08,347 +1955-09,312 +1955-10,274 +1955-11,237 +1955-12,278 +1956-01,284 +1956-02,277 +1956-03,317 +1956-04,313 +1956-05,318 +1956-06,374 +1956-07,413 +1956-08,405 +1956-09,355 +1956-10,306 +1956-11,271 +1956-12,306 +1957-01,315 +1957-02,301 +1957-03,356 +1957-04,348 +1957-05,355 +1957-06,422 +1957-07,465 +1957-08,467 +1957-09,404 +1957-10,347 +1957-11,305 +1957-12,336 +1958-01,340 +1958-02,318 +1958-03,362 +1958-04,348 +1958-05,363 +1958-06,435 +1958-07,491 +1958-08,505 +1958-09,404 +1958-10,359 +1958-11,310 +1958-12,337 +1959-01,360 +1959-02,342 +1959-03,406 +1959-04,396 +1959-05,420 +1959-06,472 +1959-07,548 +1959-08,559 +1959-09,463 +1959-10,407 +1959-11,362 +1959-12,405 +1960-01,417 +1960-02,391 +1960-03,419 +1960-04,461 +1960-05,472 +1960-06,535 +1960-07,622 +1960-08,606 +1960-09,508 +1960-10,461 +1960-11,390 +1960-12,432 diff --git a/MasterThesis/TimeSeries.py b/MasterThesis/TimeSeries.py new file mode 100644 index 0000000..9ed4510 --- /dev/null +++ b/MasterThesis/TimeSeries.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Jul 14 13:37:58 2021 +@author: sadrachpierre +""" + +import pandas as pd +import matplotlib.pyplot as plt +import seaborn as sns +from statsmodels.tsa.stattools import adfuller +from statsmodels.tsa.seasonal import seasonal_decompose + +df = pd.read_csv("AirPassengers.csv") + +print(df.head()) + +print(df.tail()) + +df['Month'] = pd.to_datetime(df['Month'], format='%Y-%m') + +df.index = df['Month'] +del df['Month'] +print(df.head()) + +# sns.lineplot(data=df) +# plt.ylabel("Number of Passengers") +# plt.show() + +rolling_mean = df.rolling(7).mean() +rolling_std = df.rolling(7).std() + +plt.plot(df, color="blue", label="Original Passenger Data") +plt.plot(rolling_mean, color="red", label="Rolling Mean #Passenger") +plt.plot(rolling_std, color="black", label="Rolling Standard Deviation in #Passenger") +plt.title("Passenger Time Series, Rolling Mean, Standard Deviation") +plt.legend(loc="best") +plt.show() + +adft = adfuller(df, autolag="AIC") + +output_df = pd.DataFrame({"Values": [adft[0], adft[1], adft[2], adft[3], adft[4]['1%'], adft[4]['5%'], adft[4]['10%']], + "Metric": ["Test Statistics", "p-value", "No. of lags used", "Number of observations used", + "critical value (1%)", "critical value (5%)", "critical value (10%)"]}) +print(output_df) + +autocorrelation_lag1 = df['#Passengers'].autocorr(lag=1) +print("One Month Lag: ", autocorrelation_lag1) + +autocorrelation_lag3 = df['#Passengers'].autocorr(lag=3) +print("Three Month Lag: ", autocorrelation_lag3) + +autocorrelation_lag6 = df['#Passengers'].autocorr(lag=6) +print("Six Month Lag: ", autocorrelation_lag6) + +autocorrelation_lag9 = df['#Passengers'].autocorr(lag=9) +print("Nine Month Lag: ", autocorrelation_lag9) + +decompose = seasonal_decompose(df['#Passengers'], model='additive', period=7) +decompose.plot() +plt.show() +df['Date'] = df.index + +train = df[df['Date'] < pd.to_datetime("1960-08", format='%Y-%m')] +train['train'] = train['#Passengers'] +del train['Date'] +del train['#Passengers'] +test = df[df['Date'] >= pd.to_datetime("1960-08", format='%Y-%m')] +del test['Date'] +test['test'] = test['#Passengers'] +del test['#Passengers'] +plt.plot(train, color="black") +plt.plot(test, color="red") +plt.title("Train/Test split for Passenger Data") +plt.ylabel("Passenger Number") +plt.xlabel('Year-Month') +sns.set() +plt.show() + +from pmdarima.arima import auto_arima + +model = auto_arima(train, trace=True, error_action='ignore', suppress_warnings=True) +model.fit(train) +forecast = model.predict(n_periods=len(test)) +forecast = pd.DataFrame(forecast, index=test.index, columns=['Prediction']) + +plt.plot(train, label='Train') +plt.plot(test, label='Test') +plt.plot(forecast, label='Prediction') +plt.title('#Passenger Prediction') +plt.xlabel('Date') +plt.ylabel('Actual #Passenger') +plt.legend(loc='upper left', fontsize=8) +plt.show() + +from math import sqrt +from sklearn.metrics import mean_squared_error + +print("RMSE: ", rms) \ No newline at end of file diff --git a/MasterThesis/TimeSeriesForecasting.py b/MasterThesis/TimeSeriesForecasting.py new file mode 100644 index 0000000..ea6d7c3 --- /dev/null +++ b/MasterThesis/TimeSeriesForecasting.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Tue Sep 28 11:11:06 2021 +@author: sadrachpierre +""" +import pandas as pd +import pandas_datareader as web +import datetime + +import matplotlib.pyplot as plt +import seaborn as sns + +from statsmodels.tsa.statespace.sarimax import SARIMAX +from statsmodels.tsa.arima.model import ARIMA +pd.set_option('display.max_columns', None) +pd.set_option('display.max_rows', None) + + + + +# btc = web.get_data_yahoo(['BTC-USD'], start=datetime.datetime(2018, 1, 1), end=datetime.datetime(2020, 12, 2)) + +# btc = btc['Close'] + +# btc.to_csv("btc.csv") + +btc = pd.read_csv("btc.csv") + + +btc.index = pd.to_datetime(btc['Date'], format='%Y-%m-%d') +del btc['Date'] + +print(btc.head()) +sns.set() +plt.ylabel('BTC Price') +plt.xlabel('Date') +plt.xticks(rotation=45) +plt.plot(btc.index, btc['BTC-USD'], ) +plt.show() + +train = btc[btc.index < pd.to_datetime("2020-11-01", format='%Y-%m-%d')] +test = btc[btc.index >= pd.to_datetime("2020-11-01", format='%Y-%m-%d')] +print(test) +plt.plot(train, color = "black", label = 'Training') +plt.plot(test, color = "red", label = 'Testing') +plt.ylabel('BTC Price') +plt.xlabel('Date') +plt.xticks(rotation=45) +plt.title("Train/Test split for BTC Data") + +y = train['BTC-USD'] + +ARMAmodel = SARIMAX(y, order = (1, 0, 1)) +ARMAmodel = ARMAmodel.fit() + +y_pred = ARMAmodel.get_forecast(len(test.index)) +y_pred_df = y_pred.conf_int(alpha = 0.05) +y_pred_df["Predictions"] = ARMAmodel.predict(start = y_pred_df.index[0], end = y_pred_df.index[-1]) +y_pred_df.index = test.index +y_pred_out = y_pred_df["Predictions"] +plt.plot(y_pred_out, color='green', label = 'ARMA Predictions') +plt.legend() + + +import numpy as np +from sklearn.metrics import mean_squared_error + +arma_rmse = np.sqrt(mean_squared_error(test["BTC-USD"].values, y_pred_df["Predictions"])) +print("ARMA RMSE: ",arma_rmse) + + + + +ARIMAmodel = ARIMA(y, order = (5, 4, 2)) +ARIMAmodel = ARIMAmodel.fit() + +y_pred = ARIMAmodel.get_forecast(len(test.index)) +y_pred_df = y_pred.conf_int(alpha = 0.05) +y_pred_df["Predictions"] = ARIMAmodel.predict(start = y_pred_df.index[0], end = y_pred_df.index[-1]) +y_pred_df.index = test.index +y_pred_out = y_pred_df["Predictions"] +plt.plot(y_pred_out, color='Yellow', label = 'ARIMA Predictions') +plt.legend() + + +import numpy as np +from sklearn.metrics import mean_squared_error + +arma_rmse = np.sqrt(mean_squared_error(test["BTC-USD"].values, y_pred_df["Predictions"])) +print("ARIMA RMSE: ",arma_rmse) + + + +SARIMAXmodel = SARIMAX(y, order = (5, 4, 2), seasonal_order=(2,2,2,12)) +SARIMAXmodel = SARIMAXmodel.fit() + +y_pred = SARIMAXmodel.get_forecast(len(test.index)) +y_pred_df = y_pred.conf_int(alpha = 0.05) +y_pred_df["Predictions"] = SARIMAXmodel.predict(start = y_pred_df.index[0], end = y_pred_df.index[-1]) +y_pred_df.index = test.index +y_pred_out = y_pred_df["Predictions"] +plt.plot(y_pred_out, color='Blue', label = 'SARIMA Predictions') +plt.legend() + + +import numpy as np +from sklearn.metrics import mean_squared_error + +arma_rmse = np.sqrt(mean_squared_error(test["BTC-USD"].values, y_pred_df["Predictions"])) +print("SARIMA RMSE: ",arma_rmse) \ No newline at end of file diff --git a/MasterThesis/__init__.py b/MasterThesis/__init__.py new file mode 100644 index 0000000..81384a5 --- /dev/null +++ b/MasterThesis/__init__.py @@ -0,0 +1,12 @@ +from selenium import webdriver +from selenium.webdriver.common.keys import Keys + +if __name__ == '__main__': + driver = webdriver.Chrome() + driver.get("https://stockx.com/jordan-1-retro-black-royal-blue-2001") + button = driver.find_element_by_xpath('//*[@id="main-content"]/div/section[4]/div/div/div/div/div[1]/div[2]/button') + button.click() + elem = driver.find_element_by_xpath('//*[@id="chakra-modal--body-38"]/div/div/table/tbody/tr[100]/td[4]/p/p') + price = elem.text + print(price) + driver.close() \ No newline at end of file diff --git a/MasterThesis/configs/.azureml/myconfig.json b/MasterThesis/configs/.azureml/myconfig.json new file mode 100644 index 0000000..ec74f03 --- /dev/null +++ b/MasterThesis/configs/.azureml/myconfig.json @@ -0,0 +1 @@ +{"Id": null, "Scope": "/subscriptions/616d95e9-f2f8-4e95-8535-e2449b5bd652/resourceGroups/myresourcegroup/providers/Microsoft.MachineLearningServices/workspaces/newworkspace"} \ No newline at end of file diff --git a/MasterThesis/converter.py b/MasterThesis/converter.py new file mode 100644 index 0000000..23fc08a --- /dev/null +++ b/MasterThesis/converter.py @@ -0,0 +1,25 @@ +import matplotlib.pyplot as plt + + +def convert(text): + points = text.split("L") + result = [] + max_y = 0 + min_y = 1000000 + for point in points: + x, y = point.split(",") + x = int(float(x)) + y = int(float(y)) + if y > max_y: + max_y = y + if y < min_y: + min_y = y + result.append([x, y]) + print(result) + # print([row[1] for row in result]) + plt.plot([row[0] for row in result], [max_y - row[1] + min_y for row in result]) + plt.show() + + +if __name__ == '__main__': + convert("25,35.67999999999999L35.07070707070707,60.08L45.141414141414145,60.08L55.21212121212121,60.08L65.28282828282829,21.999999999999993L75.35353535353535,21.999999999999993L85.42424242424242,21.999999999999993L95.49494949494948,21.999999999999993L105.56565656565657,50L115.63636363636363,50L125.7070707070707,27.200000000000003L135.77777777777777,27.200000000000003L145.84848484848484,76L155.91919191919192,50.23999999999999L165.98989898989896,50.23999999999999L176.06060606060606,50.23999999999999L186.13131313131314,50.23999999999999L196.20202020202018,58.16000000000001L206.27272727272725,54.00000000000001L216.34343434343432,41.99999999999999L226.4141414141414,41.99999999999999L236.48484848484847,66.72000000000001L246.55555555555554,55.44000000000001L256.6262626262626,64.48L266.6969696969697,80.08L276.7676767676768,66.08000000000001L286.83838383838383,76L296.9090909090909,30L306.9797979797979,70L317.050505050505,70L327.1212121212121,47.599999999999994L337.19191919191917,68.64L347.26262626262627,68.64L357.3333333333333,68.64L367.40404040404036,72.32L377.47474747474746,70L387.54545454545456,70L397.6161616161616,66.48L407.68686868686865,71.92L417.7575757575757,80.8L427.8282828282828,80.8L437.8989898989899,78.32000000000001L447.96969696969694,52.400000000000006L458.04040404040404,58.32000000000001L468.1111111111111,58.32000000000001L478.18181818181813,58.96000000000001L488.25252525252523,79.67999999999999L498.3232323232323,78.08L508.3939393939394,78.08L518.4646464646464,66L528.5353535353536,74.08L538.6060606060606,74.08L548.6767676767677,74.08L558.7474747474748,74.08L568.8181818181818,70L578.8888888888889,58.88L588.959595959596,74.88L599.0303030303031,81.92L609.10101010101,53.52L619.1717171717171,58.96000000000001L629.2424242424242,67.36000000000001L639.3131313131313,71.12L649.3838383838383,67.68L659.4545454545455,73.91999999999999L669.5252525252525,80.08L679.5959595959596,77.60000000000001L689.6666666666666,87.2L699.7373737373738,70.48L709.8080808080807,80.88L719.878787878788,88.96000000000001L729.9494949494949,78.88L740.020202020202,78.88L750.0909090909091,68.08L760.1616161616162,98.00000000000001L770.2323232323232,94L780.3030303030303,94L790.3737373737373,80.55999999999999L800.4444444444445,86.32000000000001L810.5151515151514,81.52L820.5858585858587,85.92L830.6565656565656,109.28000000000002L840.7272727272727,123.76000000000002L850.7979797979798,125.76L860.8686868686868,125.36L870.9393939393939,124.80000000000001L881.010101010101,125.03999999999999L891.0808080808081,124.72000000000001L901.1515151515151,126.4L911.2222222222222,126.72L921.2929292929293,124.80000000000001L931.3636363636363,127.12L941.4343434343434,126.72L951.5050505050505,126.47999999999999L961.5757575757576,127.52L971.6464646464646,127.68L981.7171717171717,128.56L991.7878787878788,131.6L1001.8585858585858,134.88L1011.929292929293,137.27999999999997L1022,137.35999999999999") \ No newline at end of file diff --git a/MasterThesis/keywords for presentation.txt b/MasterThesis/keywords for presentation.txt new file mode 100644 index 0000000..37abce0 --- /dev/null +++ b/MasterThesis/keywords for presentation.txt @@ -0,0 +1,7 @@ +stationarity +autoregressive moving average ARMA +Dickey Fuller test +rolling mean +Autocorrelation +Decomposition +Forecasting (ARIMA) \ No newline at end of file diff --git a/MasterThesis/predykcje.py b/MasterThesis/predykcje.py new file mode 100644 index 0000000..bc67033 --- /dev/null +++ b/MasterThesis/predykcje.py @@ -0,0 +1,17 @@ +from azureml.core import Workspace +from azureml.core.experiment import Experiment +from azureml.train + +def main(): + ws = Workspace.get(name='newworkspace', subscription_id='616d95e9-f2f8-4e95-8535-e2449b5bd652', resource_group='myresourcegroup') + # ws = Workspace.create(name='newworkspace', + # subscription_id='616d95e9-f2f8-4e95-8535-e2449b5bd652', + # resource_group='myresourcegroup', + # create_resource_group=True, + # location='eastus2' + # ) + + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/MasterThesis/resources/air-jordan-1-retro-high-pollen.txt b/MasterThesis/resources/air-jordan-1-retro-high-pollen.txt new file mode 100644 index 0000000..e69de29 diff --git a/MasterThesis/resources/air-jordan-1-retro-high-shattered-backboard-3.txt b/MasterThesis/resources/air-jordan-1-retro-high-shattered-backboard-3.txt new file mode 100644 index 0000000..9dc3e2e --- /dev/null +++ b/MasterThesis/resources/air-jordan-1-retro-high-shattered-backboard-3.txt @@ -0,0 +1 @@ +M25,35.60000000000001L35.07070707070707,47.527272727272724L45.141414141414145,88.25454545454546L55.21212121212121,94.65454545454544L65.28282828282829,99.89090909090908L75.35353535353535,105.12727272727273L85.42424242424242,104.83636363636364L95.49494949494948,103.38181818181818L105.56565656565657,101.63636363636364L115.63636363636363,100.18181818181819L125.7070707070707,100.18181818181819L135.77777777777777,99.01818181818183L145.84848484848484,97.27272727272727L155.91919191919192,96.4L165.98989898989896,95.23636363636363L176.06060606060606,100.18181818181819L186.13131313131314,95.52727272727273L196.20202020202018,91.74545454545456L206.27272727272725,85.92727272727271L216.34343434343432,82.14545454545454L226.4141414141414,78.94545454545454L236.48484848484847,77.2L246.55555555555554,75.16363636363636L256.6262626262626,73.41818181818181L266.6969696969697,73.41818181818181L276.7676767676768,69.34545454545454L286.83838383838383,66.43636363636365L296.9090909090909,61.78181818181818L306.9797979797979,63.23636363636364L317.050505050505,64.39999999999999L327.1212121212121,58.00000000000001L337.19191919191917,60.90909090909092L347.26262626262627,54.8L357.3333333333333,53.63636363636363L367.40404040404036,54.509090909090915L377.47474747474746,58.87272727272727L387.54545454545456,60.32727272727273L397.6161616161616,58.58181818181817L407.68686868686865,57.70909090909091L417.7575757575757,58.58181818181817L427.8282828282828,57.12727272727273L437.8989898989899,58.87272727272727L447.96969696969694,59.163636363636364L458.04040404040404,57.12727272727273L468.1111111111111,55.09090909090909L478.18181818181813,53.05454545454545L488.25252525252523,55.38181818181819L498.3232323232323,57.12727272727273L508.3939393939394,58.58181818181817L518.4646464646464,56.25454545454545L528.5353535353536,57.12727272727273L538.6060606060606,53.63636363636363L548.6767676767677,52.18181818181819L558.7474747474748,48.981818181818184L568.8181818181818,51.8909090909091L578.8888888888889,49.27272727272728L588.959595959596,54.21818181818182L599.0303030303031,54.8L609.10101010101,52.472727272727276L619.1717171717171,50.43636363636362L629.2424242424242,51.30909090909091L639.3131313131313,50.43636363636362L649.3838383838383,49.85454545454546L659.4545454545455,47.81818181818181L669.5252525252525,54.21818181818182L679.5959595959596,48.4L689.6666666666666,52.472727272727276L699.7373737373738,52.472727272727276L709.8080808080807,54.509090909090915L719.878787878788,53.92727272727273L729.9494949494949,51.30909090909091L740.020202020202,50.72727272727272L750.0909090909091,46.94545454545455L760.1616161616162,49.27272727272728L770.2323232323232,48.981818181818184L780.3030303030303,46.36363636363637L790.3737373737373,49.85454545454546L800.4444444444445,51.018181818181816L810.5151515151514,44.327272727272735L820.5858585858587,51.8909090909091L830.6565656565656,48.1090909090909L840.7272727272727,49.85454545454546L850.7979797979798,51.6L860.8686868686868,55.38181818181819L870.9393939393939,55.09090909090909L881.010101010101,54.509090909090915L891.0808080808081,59.74545454545454L901.1515151515151,63.81818181818181L911.2222222222222,63.52727272727274L921.2929292929293,63.23636363636364L931.3636363636363,64.10909090909091L941.4343434343434,61.19999999999999L951.5050505050505,58.29090909090908L961.5757575757576,61.78181818181818L971.6464646464646,61.19999999999999L981.7171717171717,61.78181818181818L991.7878787878788,58.58181818181817L1001.8585858585858,61.78181818181818L1011.929292929293,63.81818181818181L1022,63.52727272727274 \ No newline at end of file diff --git a/MasterThesis/resources/air-jordan-4-retro-white-midnight-navy.txt b/MasterThesis/resources/air-jordan-4-retro-white-midnight-navy.txt new file mode 100644 index 0000000..88c990e --- /dev/null +++ b/MasterThesis/resources/air-jordan-4-retro-white-midnight-navy.txt @@ -0,0 +1 @@ +M25,54.8L35.07070707070707,54.8L45.141414141414145,72.66666666666667L55.21212121212121,82.26666666666667L65.28282828282829,91.33333333333333L75.35353535353535,94.53333333333333L85.42424242424242,92.13333333333333L95.49494949494948,81.73333333333333L105.56565656565657,86.26666666666667L115.63636363636363,63.86666666666667L125.7070707070707,65.73333333333335L135.77777777777777,68.93333333333332L145.84848484848484,74.53333333333333L155.91919191919192,73.73333333333333L165.98989898989896,73.2L176.06060606060606,70.8L186.13131313131314,68.39999999999999L196.20202020202018,68.66666666666667L206.27272727272725,58.266666666666666L216.34343434343432,63.599999999999994L226.4141414141414,62.266666666666666L236.48484848484847,66L246.55555555555554,63.333333333333336L256.6262626262626,69.46666666666667L266.6969696969697,68.66666666666667L276.7676767676768,68.66666666666667L286.83838383838383,68.66666666666667L296.9090909090909,67.86666666666667L306.9797979797979,54.00000000000001L317.050505050505,54.00000000000001L327.1212121212121,71.06666666666668L337.19191919191917,72.66666666666667L347.26262626262627,70.26666666666668L357.3333333333333,72.93333333333332L367.40404040404036,70.26666666666668L377.47474747474746,64.13333333333334L387.54545454545456,57.2L397.6161616161616,58.266666666666666L407.68686868686865,55.86666666666666L417.7575757575757,61.19999999999999L427.8282828282828,36.666666666666664L437.8989898989899,65.73333333333335L447.96969696969694,65.73333333333335L458.04040404040404,63.06666666666666L468.1111111111111,63.86666666666667L478.18181818181813,56.93333333333334L488.25252525252523,56.666666666666664L498.3232323232323,57.2L508.3939393939394,59.333333333333336L518.4646464646464,60.93333333333334L528.5353535353536,63.333333333333336L538.6060606060606,45.73333333333334L548.6767676767677,60.666666666666664L558.7474747474748,65.73333333333335L568.8181818181818,65.73333333333335L578.8888888888889,42.53333333333334L588.959595959596,50.800000000000004L599.0303030303031,50.800000000000004L609.10101010101,51.33333333333333L619.1717171717171,51.866666666666674L629.2424242424242,56.93333333333334L639.3131313131313,63.599999999999994L649.3838383838383,32.66666666666667L659.4545454545455,49.199999999999996L669.5252525252525,67.33333333333333L679.5959595959596,56.13333333333333L689.6666666666666,61.99999999999999L699.7373737373738,66.53333333333335L709.8080808080807,59.60000000000001L719.878787878788,67.33333333333333L729.9494949494949,70L740.020202020202,69.2L750.0909090909091,76.66666666666666L760.1616161616162,79.60000000000001L770.2323232323232,76.93333333333332L780.3030303030303,81.19999999999999L790.3737373737373,76.13333333333333L800.4444444444445,80.39999999999999L810.5151515151514,80.93333333333334L820.5858585858587,77.46666666666665L830.6565656565656,84.13333333333334L840.7272727272727,85.19999999999999L850.7979797979798,85.73333333333333L860.8686868686868,86L870.9393939393939,85.46666666666667L881.010101010101,90L891.0808080808081,93.46666666666667L901.1515151515151,86.8L911.2222222222222,84.39999999999999L921.2929292929293,85.46666666666667L931.3636363636363,85.73333333333333L941.4343434343434,87.06666666666668L951.5050505050505,88.13333333333333L961.5757575757576,88.93333333333332L971.6464646464646,91.60000000000001L981.7171717171717,91.60000000000001L991.7878787878788,92.13333333333333L1001.8585858585858,92.93333333333332L1011.929292929293,91.06666666666666L1022,92.39999999999999 \ No newline at end of file diff --git a/MasterThesis/resources/blastoise-holo-1999-pokemon-base-set-2-102.txt b/MasterThesis/resources/blastoise-holo-1999-pokemon-base-set-2-102.txt new file mode 100644 index 0000000..8f37403 --- /dev/null +++ b/MasterThesis/resources/blastoise-holo-1999-pokemon-base-set-2-102.txt @@ -0,0 +1 @@ +M25,148.03636363636366L35.07070707070707,155.45454545454544L45.141414141414145,155.45454545454544L55.21212121212121,142.5090909090909L65.28282828282829,142.5090909090909L75.35353535353535,142.5090909090909L85.42424242424242,145.27272727272725L95.49494949494948,145.27272727272725L105.56565656565657,145.27272727272725L115.63636363636363,162.72727272727275L125.7070707070707,162.72727272727275L135.77777777777777,162.72727272727275L145.84848484848484,147.45454545454547L155.91919191919192,147.45454545454547L165.98989898989896,147.45454545454547L176.06060606060606,147.45454545454547L186.13131313131314,147.45454545454547L196.20202020202018,147.45454545454547L206.27272727272725,147.45454545454547L216.34343434343432,147.45454545454547L226.4141414141414,147.45454545454547L236.48484848484847,147.45454545454547L246.55555555555554,107.30909090909091L256.6262626262626,107.30909090909091L266.6969696969697,107.30909090909091L276.7676767676768,126.36363636363637L286.83838383838383,137.27272727272725L296.9090909090909,137.27272727272725L306.9797979797979,137.27272727272725L317.050505050505,137.27272727272725L327.1212121212121,31.818181818181817L337.19191919191917,32.981818181818184L347.26262626262627,104.25454545454546L357.3333333333333,123.16363636363636L367.40404040404036,110.8L377.47474747474746,111.0909090909091L387.54545454545456,100.76363636363637L397.6161616161616,124.03636363636363L407.68686868686865,133.05454545454546L417.7575757575757,98.00000000000001L427.8282828282828,82.87272727272727L437.8989898989899,82.58181818181818L447.96969696969694,106L458.04040404040404,60.90909090909092L468.1111111111111,85.05454545454546L478.18181818181813,113.7090909090909L488.25252525252523,137.27272727272725L498.3232323232323,92.47272727272725L508.3939393939394,30.36363636363637L518.4646464646464,98.87272727272727L528.5353535353536,109.78181818181818L538.6060606060606,120.10909090909092L548.6767676767677,120.10909090909092L558.7474747474748,120.10909090909092L568.8181818181818,119.09090909090911L578.8888888888889,106.58181818181819L588.959595959596,106.58181818181819L599.0303030303031,132.1818181818182L609.10101010101,112.25454545454546L619.1717171717171,101.49090909090908L629.2424242424242,101.49090909090908L639.3131313131313,115.45454545454547L649.3838383838383,115.45454545454547L659.4545454545455,136.4L669.5252525252525,117.4909090909091L679.5959595959596,117.4909090909091L689.6666666666666,117.4909090909091L699.7373737373738,145.27272727272725L709.8080808080807,144.98181818181817L719.878787878788,117.92727272727272L729.9494949494949,131.16363636363639L740.020202020202,128.54545454545456L750.0909090909091,142.36363636363635L760.1616161616162,147.45454545454547L770.2323232323232,142.36363636363635L780.3030303030303,125.78181818181818L790.3737373737373,142.36363636363635L800.4444444444445,142.36363636363635L810.5151515151514,126.65454545454544L820.5858585858587,136.9818181818182L830.6565656565656,136.9818181818182L840.7272727272727,145.27272727272725L850.7979797979798,139.16363636363636L860.8686868686868,138L870.9393939393939,148.1818181818182L881.010101010101,126.94545454545455L891.0808080808081,102.36363636363637L901.1515151515151,101.92727272727271L911.2222222222222,119.09090909090911L921.2929292929293,119.09090909090911L931.3636363636363,139.16363636363636L941.4343434343434,139.16363636363636L951.5050505050505,139.16363636363636L961.5757575757576,138.72727272727275L971.6464646464646,102.07272727272728L981.7171717171717,115.6L991.7878787878788,115.6L1001.8585858585858,115.6L1011.929292929293,115.6L1022,145.70909090909092 \ No newline at end of file diff --git a/MasterThesis/resources/charizard-holo-1999-pokemon-base-set-4-102.txt b/MasterThesis/resources/charizard-holo-1999-pokemon-base-set-4-102.txt new file mode 100644 index 0000000..5c7de8b --- /dev/null +++ b/MasterThesis/resources/charizard-holo-1999-pokemon-base-set-4-102.txt @@ -0,0 +1 @@ +M25,155.49333333333334L35.07070707070707,155.49333333333334L45.141414141414145,162.05333333333334L55.21212121212121,155.65333333333334L65.28282828282829,155.65333333333334L75.35353535353535,155.92L85.42424242424242,157.78666666666666L95.49494949494948,157.78666666666666L105.56565656565657,148.72L115.63636363636363,157.62666666666667L125.7070707070707,150L135.77777777777777,150L145.84848484848484,150L155.91919191919192,150L165.98989898989896,145.73333333333335L176.06060606060606,145.73333333333335L186.13131313131314,157.73333333333335L196.20202020202018,157.73333333333335L206.27272727272725,157.73333333333335L216.34343434343432,142.05333333333334L226.4141414141414,142.05333333333334L236.48484848484847,142.05333333333334L246.55555555555554,130L256.6262626262626,130L266.6969696969697,130L276.7676767676768,134.69333333333336L286.83838383838383,140.66666666666669L296.9090909090909,140.66666666666669L306.9797979797979,127.33333333333334L317.050505050505,19.60000000000001L327.1212121212121,58.64000000000001L337.19191919191917,73.94666666666666L347.26262626262627,97.36000000000001L357.3333333333333,120.13333333333333L367.40404040404036,134L377.47474747474746,129.62666666666667L387.54545454545456,135.28L397.6161616161616,124.02666666666667L407.68686868686865,113.14666666666668L417.7575757575757,104.13333333333335L427.8282828282828,124.61333333333333L437.8989898989899,93.52000000000001L447.96969696969694,107.54666666666667L458.04040404040404,133.20000000000002L468.1111111111111,128.18666666666667L478.18181818181813,115.76L488.25252525252523,123.38666666666666L498.3232323232323,124.93333333333332L508.3939393939394,109.04L518.4646464646464,130.26666666666668L528.5353535353536,137.14666666666668L538.6060606060606,144.72L548.6767676767677,136.13333333333335L558.7474747474748,140.18666666666667L568.8181818181818,135.60000000000002L578.8888888888889,143.38666666666666L588.959595959596,122.16000000000001L599.0303030303031,134.64000000000001L609.10101010101,127.81333333333333L619.1717171717171,115.12L629.2424242424242,115.12L639.3131313131313,134.05333333333334L649.3838383838383,151.65333333333334L659.4545454545455,140.02666666666667L669.5252525252525,134.21333333333334L679.5959595959596,147.12L689.6666666666666,133.35999999999999L699.7373737373738,133.35999999999999L709.8080808080807,113.36000000000001L719.878787878788,138.26666666666665L729.9494949494949,141.52L740.020202020202,142.48000000000002L750.0909090909091,133.84L760.1616161616162,141.68L770.2323232323232,90L780.3030303030303,132.88L790.3737373737373,148.24L800.4444444444445,135.54666666666665L810.5151515151514,143.44L820.5858585858587,143.54666666666668L830.6565656565656,139.86666666666665L840.7272727272727,141.94666666666666L850.7979797979798,144.08L860.8686868686868,151.86666666666667L870.9393939393939,142.53333333333333L881.010101010101,142.53333333333333L891.0808080808081,136.45333333333332L901.1515151515151,144.82666666666665L911.2222222222222,121.36L921.2929292929293,121.36L931.3636363636363,124.66666666666666L941.4343434343434,151.17333333333335L951.5050505050505,150.79999999999998L961.5757575757576,144.82666666666665L971.6464646464646,147.4933333333333L981.7171717171717,151.65333333333334L991.7878787878788,131.76L1001.8585858585858,131.76L1011.929292929293,143.33333333333334L1022,147.8133333333333 \ No newline at end of file diff --git a/MasterThesis/resources/jordan-1-retro-fragment.txt b/MasterThesis/resources/jordan-1-retro-fragment.txt new file mode 100644 index 0000000..e0a9c7a --- /dev/null +++ b/MasterThesis/resources/jordan-1-retro-fragment.txt @@ -0,0 +1 @@ +M25,152.57454545454544L35.07070707070707,155.3090909090909L45.141414141414145,145.6509090909091L55.21212121212121,155.16363636363636L65.28282828282829,127.87636363636364L75.35353535353535,128.60363636363635L85.42424242424242,131.2218181818182L95.49494949494948,126.2181818181818L105.56565656565657,127.38181818181818L115.63636363636363,124.90909090909092L125.7070707070707,121.76727272727274L135.77777777777777,122.52363636363637L145.84848484848484,125.89818181818181L155.91919191919192,117.25818181818182L165.98989898989896,121.85454545454546L176.06060606060606,120.92363636363636L186.13131313131314,120.19636363636364L196.20202020202018,123.83272727272728L206.27272727272725,124.26909090909092L216.34343434343432,121.44727272727273L226.4141414141414,122.72727272727273L236.48484848484847,121.27272727272727L246.55555555555554,122.72727272727273L256.6262626262626,121.94181818181818L266.6969696969697,120.13818181818179L276.7676767676768,123.16363636363636L286.83838383838383,121.30181818181818L296.9090909090909,116.35636363636364L306.9797979797979,121.53454545454545L317.050505050505,119.75999999999999L327.1212121212121,117.08363636363636L337.19191919191917,117.92727272727272L347.26262626262627,119.00363636363636L357.3333333333333,119.23636363636363L367.40404040404036,119.32363636363637L377.47474747474746,111.44L387.54545454545456,116.18181818181817L397.6161616161616,114.75636363636363L407.68686868686865,116.64727272727272L417.7575757575757,118.33454545454546L427.8282828282828,118.27636363636364L437.8989898989899,114.49454545454547L447.96969696969694,117.54909090909092L458.04040404040404,116.38545454545454L468.1111111111111,120.34181818181818L478.18181818181813,115.54181818181817L488.25252525252523,114.9309090909091L498.3232323232323,116.15272727272728L508.3939393939394,114.11636363636364L518.4646464646464,117.11272727272728L528.5353535353536,112.54545454545455L538.6060606060606,109.08363636363636L548.6767676767677,104.69090909090909L558.7474747474748,103.29454545454546L568.8181818181818,93.63636363636363L578.8888888888889,98.17454545454545L588.959595959596,100.90909090909089L599.0303030303031,93.86909090909091L609.10101010101,70.53818181818181L619.1717171717171,79.52727272727273L629.2424242424242,73.97090909090909L639.3131313131313,86.07272727272728L649.3838383838383,81.33090909090909L659.4545454545455,87.0909090909091L669.5252525252525,72.95272727272727L679.5959595959596,67.86181818181818L689.6666666666666,84.32727272727274L699.7373737373738,66.55272727272727L709.8080808080807,71.29454545454544L719.878787878788,84.35636363636365L729.9494949494949,63.585454545454546L740.020202020202,74.78545454545454L750.0909090909091,69.31636363636363L760.1616161616162,67.5709090909091L770.2323232323232,69.34545454545454L780.3030303030303,60.35636363636364L790.3737373737373,54.21818181818182L800.4444444444445,47.14909090909091L810.5151515151514,46.39272727272728L820.5858585858587,42.029090909090904L830.6565656565656,45.81090909090909L840.7272727272727,39.20727272727273L850.7979797979798,47.99272727272727L860.8686868686868,33.010909090909095L870.9393939393939,17.09818181818182L881.010101010101,39.09090909090908L891.0808080808081,44.18181818181817L901.1515151515151,44.18181818181817L911.2222222222222,45.63636363636365L921.2929292929293,46.88727272727272L931.3636363636363,35.10545454545454L941.4343434343434,35.68727272727273L951.5050505050505,35.68727272727273L961.5757575757576,46.974545454545456L971.6464646464646,57.41818181818182L981.7171717171717,56.80727272727273L991.7878787878788,68.44363636363637L1001.8585858585858,68.44363636363637L1011.929292929293,72.63272727272728L1022,82.72727272727273 \ No newline at end of file diff --git a/MasterThesis/resources/lego-imperial-star-destroyer-ultimate-collector-series-set-75252.txt b/MasterThesis/resources/lego-imperial-star-destroyer-ultimate-collector-series-set-75252.txt new file mode 100644 index 0000000..9843109 --- /dev/null +++ b/MasterThesis/resources/lego-imperial-star-destroyer-ultimate-collector-series-set-75252.txt @@ -0,0 +1 @@ +M25,54.977777777777774L35.07070707070707,61.55555555555555L45.141414141414145,66.88888888888889L55.21212121212121,70.26666666666668L65.28282828282829,72.93333333333332L75.35353535353535,73.11111111111111L85.42424242424242,72.22222222222221L95.49494949494948,70.97777777777776L105.56565656565657,61.911111111111104L115.63636363636363,77.37777777777778L125.7070707070707,68.66666666666667L135.77777777777777,68.66666666666667L145.84848484848484,68.66666666666667L155.91919191919192,74L165.98989898989896,67.42222222222223L176.06060606060606,68.66666666666667L186.13131313131314,67.77777777777779L196.20202020202018,69.02222222222223L206.27272727272725,69.02222222222223L216.34343434343432,69.02222222222223L226.4141414141414,87.33333333333333L236.48484848484847,87.33333333333333L246.55555555555554,84.66666666666666L256.6262626262626,92.66666666666666L266.6969696969697,93.02222222222224L276.7676767676768,91.77777777777777L286.83838383838383,88.57777777777778L296.9090909090909,89.28888888888889L306.9797979797979,87.33333333333333L317.050505050505,88.57777777777778L327.1212121212121,97.28888888888889L337.19191919191917,81.11111111111111L347.26262626262627,81.11111111111111L357.3333333333333,79.33333333333334L367.40404040404036,44.48888888888888L377.47474747474746,38.44444444444445L387.54545454545456,80.93333333333334L397.6161616161616,80.93333333333334L407.68686868686865,58.53333333333334L417.7575757575757,75.77777777777777L427.8282828282828,68.13333333333333L437.8989898989899,80.57777777777778L447.96969696969694,80.22222222222223L458.04040404040404,80.93333333333334L468.1111111111111,80.93333333333334L478.18181818181813,74.71111111111111L488.25252525252523,66.88888888888889L498.3232323232323,71.86666666666667L508.3939393939394,77.73333333333333L518.4646464646464,68.66666666666667L528.5353535353536,60.13333333333334L538.6060606060606,46.08888888888888L548.6767676767677,69.91111111111111L558.7474747474748,72.57777777777777L568.8181818181818,74.17777777777778L578.8888888888889,83.06666666666668L588.959595959596,74.17777777777778L599.0303030303031,76.4888888888889L609.10101010101,82.71111111111111L619.1717171717171,85.73333333333333L629.2424242424242,81.99999999999999L639.3131313131313,83.6L649.3838383838383,87.33333333333333L659.4545454545455,86.26666666666667L669.5252525252525,80.93333333333334L679.5959595959596,71.33333333333333L689.6666666666666,51.42222222222221L699.7373737373738,46.8L709.8080808080807,43.06666666666666L719.878787878788,39.86666666666666L729.9494949494949,57.644444444444446L740.020202020202,69.55555555555556L750.0909090909091,72.57777777777777L760.1616161616162,72.57777777777777L770.2323232323232,58.7111111111111L780.3030303030303,72.22222222222221L790.3737373737373,72.75555555555556L800.4444444444445,71.33333333333333L810.5151515151514,60.3111111111111L820.5858585858587,68.31111111111112L830.6565656565656,63.333333333333336L840.7272727272727,64.75555555555556L850.7979797979798,67.24444444444444L860.8686868686868,67.77777777777779L870.9393939393939,71.15555555555555L881.010101010101,69.02222222222223L891.0808080808081,68.84444444444443L901.1515151515151,69.02222222222223L911.2222222222222,67.42222222222223L921.2929292929293,61.19999999999999L931.3636363636363,50.53333333333333L941.4343434343434,61.55555555555555L951.5050505050505,54.44444444444444L961.5757575757576,54.8L971.6464646464646,53.73333333333333L981.7171717171717,59.244444444444454L991.7878787878788,64.04444444444444L1001.8585858585858,62.62222222222222L1011.929292929293,61.911111111111104L1022,62.08888888888889 \ No newline at end of file diff --git a/MasterThesis/resources/lego-millennium-falcon-ultimate-collector-series-set-75192.txt b/MasterThesis/resources/lego-millennium-falcon-ultimate-collector-series-set-75192.txt new file mode 100644 index 0000000..4b54a4e --- /dev/null +++ b/MasterThesis/resources/lego-millennium-falcon-ultimate-collector-series-set-75192.txt @@ -0,0 +1 @@ +M25,34L35.07070707070707,34L45.141414141414145,35.760000000000005L55.21212121212121,41.99999999999999L65.28282828282829,23.439999999999994L75.35353535353535,26.479999999999997L85.42424242424242,25.199999999999996L95.49494949494948,30.480000000000004L105.56565656565657,27.92L115.63636363636363,26.959999999999994L125.7070707070707,26.319999999999997L135.77777777777777,26.479999999999997L145.84848484848484,35.28000000000001L155.91919191919192,32.08L165.98989898989896,29.2L176.06060606060606,29.519999999999996L186.13131313131314,25.36L196.20202020202018,24.399999999999995L206.27272727272725,30.64L216.34343434343432,30.96L226.4141414141414,47.28L236.48484848484847,42.16L246.55555555555554,44.71999999999999L256.6262626262626,49.839999999999996L266.6969696969697,43.919999999999995L276.7676767676768,59.60000000000001L286.83838383838383,44.879999999999995L296.9090909090909,52.400000000000006L306.9797979797979,47.92L317.050505050505,55.6L327.1212121212121,49.199999999999996L337.19191919191917,46.8L347.26262626262627,40.87999999999999L357.3333333333333,41.19999999999999L367.40404040404036,41.19999999999999L377.47474747474746,40.23999999999999L387.54545454545456,43.599999999999994L397.6161616161616,37.84000000000001L407.68686868686865,31.76L417.7575757575757,38.80000000000001L427.8282828282828,49.67999999999999L437.8989898989899,35.440000000000005L447.96969696969694,40.87999999999999L458.04040404040404,44.239999999999995L468.1111111111111,34.480000000000004L478.18181818181813,31.6L488.25252525252523,31.6L498.3232323232323,32.24L508.3939393939394,32.56L518.4646464646464,38.00000000000001L528.5353535353536,37.2L538.6060606060606,38.32000000000001L548.6767676767677,40.39999999999999L558.7474747474748,41.519999999999996L568.8181818181818,45.519999999999996L578.8888888888889,40.71999999999999L588.959595959596,45.04L599.0303030303031,46.48L609.10101010101,57.040000000000006L619.1717171717171,49.52L629.2424242424242,58.80000000000001L639.3131313131313,65.84L649.3838383838383,70.16L659.4545454545455,71.44L669.5252525252525,69.03999999999999L679.5959595959596,61.67999999999999L689.6666666666666,61.519999999999996L699.7373737373738,69.03999999999999L709.8080808080807,69.2L719.878787878788,63.11999999999999L729.9494949494949,62.959999999999994L740.020202020202,69.67999999999999L750.0909090909091,70.32000000000001L760.1616161616162,65.52L770.2323232323232,73.2L780.3030303030303,70.48L790.3737373737373,66.16L800.4444444444445,66.96L810.5151515151514,62.63999999999999L820.5858585858587,59.92L830.6565656565656,65.52L840.7272727272727,65.52L850.7979797979798,67.28L860.8686868686868,72.08000000000001L870.9393939393939,72.39999999999999L881.010101010101,64.24L891.0808080808081,59.92L901.1515151515151,61.519999999999996L911.2222222222222,63.919999999999995L921.2929292929293,61.519999999999996L931.3636363636363,63.76L941.4343434343434,61.99999999999999L951.5050505050505,62.959999999999994L961.5757575757576,66.16L971.6464646464646,67.6L981.7171717171717,68.56L991.7878787878788,67.12L1001.8585858585858,67.6L1011.929292929293,66.96L1022,65.52 \ No newline at end of file diff --git a/MasterThesis/resources/lego-star-wars-death-star-set-75159.txt b/MasterThesis/resources/lego-star-wars-death-star-set-75159.txt new file mode 100644 index 0000000..4f025aa --- /dev/null +++ b/MasterThesis/resources/lego-star-wars-death-star-set-75159.txt @@ -0,0 +1 @@ +M25,71.73333333333333L35.07070707070707,64L45.141414141414145,72.93333333333332L55.21212121212121,69.86666666666666L65.28282828282829,83.33333333333334L75.35353535353535,83.33333333333334L85.42424242424242,85.33333333333334L95.49494949494948,82.93333333333332L105.56565656565657,82.93333333333332L115.63636363636363,82.26666666666667L125.7070707070707,80.53333333333333L135.77777777777777,76L145.84848484848484,76L155.91919191919192,76L165.98989898989896,76L176.06060606060606,76L186.13131313131314,76L196.20202020202018,77.60000000000001L206.27272727272725,77.60000000000001L216.34343434343432,83.33333333333334L226.4141414141414,83.33333333333334L236.48484848484847,83.33333333333334L246.55555555555554,83.33333333333334L256.6262626262626,83.33333333333334L266.6969696969697,83.33333333333334L276.7676767676768,83.33333333333334L286.83838383838383,83.33333333333334L296.9090909090909,83.33333333333334L306.9797979797979,83.33333333333334L317.050505050505,83.33333333333334L327.1212121212121,83.33333333333334L337.19191919191917,83.33333333333334L347.26262626262627,70L357.3333333333333,70L367.40404040404036,70L377.47474747474746,78.53333333333333L387.54545454545456,63.466666666666654L397.6161616161616,59.333333333333336L407.68686868686865,59.333333333333336L417.7575757575757,58.53333333333334L427.8282828282828,69.33333333333334L437.8989898989899,67.33333333333333L447.96969696969694,67.33333333333333L458.04040404040404,67.33333333333333L468.1111111111111,67.33333333333333L478.18181818181813,56.666666666666664L488.25252525252523,48.00000000000001L498.3232323232323,54.4L508.3939393939394,40L518.4646464646464,54.53333333333333L528.5353535353536,36.8L538.6060606060606,36.8L548.6767676767677,50.800000000000004L558.7474747474748,50.800000000000004L568.8181818181818,50.800000000000004L578.8888888888889,50L588.959595959596,50L599.0303030303031,33.733333333333334L609.10101010101,33.733333333333334L619.1717171717171,19.466666666666672L629.2424242424242,19.466666666666672L639.3131313131313,19.466666666666672L649.3838383838383,19.466666666666672L659.4545454545455,43.06666666666666L669.5252525252525,30.666666666666664L679.5959595959596,59.06666666666666L689.6666666666666,59.06666666666666L699.7373737373738,51.33333333333333L709.8080808080807,51.33333333333333L719.878787878788,34.66666666666667L729.9494949494949,34.66666666666667L740.020202020202,34.66666666666667L750.0909090909091,43.333333333333336L760.1616161616162,43.333333333333336L770.2323232323232,43.333333333333336L780.3030303030303,43.333333333333336L790.3737373737373,43.333333333333336L800.4444444444445,43.333333333333336L810.5151515151514,43.333333333333336L820.5858585858587,43.333333333333336L830.6565656565656,63.333333333333336L840.7272727272727,55.73333333333334L850.7979797979798,55.73333333333334L860.8686868686868,38.266666666666666L870.9393939393939,38.266666666666666L881.010101010101,60L891.0808080808081,45.99999999999999L901.1515151515151,33.2L911.2222222222222,33.2L921.2929292929293,28.933333333333326L931.3636363636363,28.933333333333326L941.4343434343434,30L951.5050505050505,60.26666666666667L961.5757575757576,60.26666666666667L971.6464646464646,60.13333333333334L981.7171717171717,58.66666666666667L991.7878787878788,58.66666666666667L1001.8585858585858,58.66666666666667L1011.929292929293,59.60000000000001L1022,24.53333333333333 \ No newline at end of file diff --git a/MasterThesis/resources/lego-star-wars-ultimate-collector-series-at-at-set-75313-gray.txt b/MasterThesis/resources/lego-star-wars-ultimate-collector-series-at-at-set-75313-gray.txt new file mode 100644 index 0000000..788a337 --- /dev/null +++ b/MasterThesis/resources/lego-star-wars-ultimate-collector-series-at-at-set-75313-gray.txt @@ -0,0 +1 @@ +M25,33.85454545454545L35.07070707070707,40.25454545454546L45.141414141414145,39.96363636363636L55.21212121212121,42.14545454545455L65.28282828282829,47.38181818181818L75.35353535353535,49.12727272727272L85.42424242424242,62.8L95.49494949494948,65.7090909090909L105.56565656565657,59.60000000000001L115.63636363636363,52.76363636363636L125.7070707070707,49.709090909090904L135.77777777777777,48.83636363636363L145.84848484848484,51.6L155.91919191919192,44.61818181818181L165.98989898989896,39.236363636363635L176.06060606060606,56.98181818181817L186.13131313131314,49.12727272727272L196.20202020202018,44.763636363636365L206.27272727272725,46.94545454545455L216.34343434343432,50.14545454545454L226.4141414141414,49.12727272727272L236.48484848484847,52.909090909090914L246.55555555555554,67.3090909090909L256.6262626262626,66.72727272727272L266.6969696969697,66.72727272727272L276.7676767676768,70.94545454545454L286.83838383838383,72.25454545454545L296.9090909090909,72.83636363636364L306.9797979797979,76.47272727272727L317.050505050505,74.43636363636362L327.1212121212121,78.36363636363636L337.19191919191917,77.34545454545454L347.26262626262627,86.94545454545455L357.3333333333333,90.2909090909091L367.40404040404036,91.60000000000001L377.47474747474746,88.69090909090909L387.54545454545456,88.83636363636363L397.6161616161616,87.0909090909091L407.68686868686865,81.56363636363636L417.7575757575757,84.32727272727274L427.8282828282828,81.99999999999999L437.8989898989899,79.81818181818183L447.96969696969694,82.29090909090908L458.04040404040404,77.2L468.1111111111111,80.39999999999999L478.18181818181813,82.87272727272727L488.25252525252523,78.36363636363636L498.3232323232323,77.78181818181818L508.3939393939394,76.76363636363637L518.4646464646464,83.16363636363636L528.5353535353536,83.74545454545455L538.6060606060606,84.03636363636365L548.6767676767677,79.81818181818183L558.7474747474748,73.27272727272728L568.8181818181818,79.52727272727273L578.8888888888889,79.81818181818183L588.959595959596,77.63636363636363L599.0303030303031,75.16363636363636L609.10101010101,80.83636363636364L619.1717171717171,78.80000000000001L629.2424242424242,84.90909090909089L639.3131313131313,86.8L649.3838383838383,85.78181818181818L659.4545454545455,85.49090909090908L669.5252525252525,86.36363636363637L679.5959595959596,86.94545454545455L689.6666666666666,80.83636363636364L699.7373737373738,82.87272727272727L709.8080808080807,88.98181818181818L719.878787878788,84.90909090909089L729.9494949494949,82.87272727272727L740.020202020202,80.25454545454545L750.0909090909091,83.45454545454545L760.1616161616162,83.89090909090908L770.2323232323232,79.67272727272726L780.3030303030303,83.16363636363636L790.3737373737373,84.61818181818181L800.4444444444445,86.2181818181818L810.5151515151514,88.10909090909091L820.5858585858587,88.98181818181818L830.6565656565656,88.54545454545456L840.7272727272727,86.8L850.7979797979798,87.81818181818181L860.8686868686868,87.81818181818181L870.9393939393939,87.67272727272727L881.010101010101,87.81818181818181L891.0808080808081,89.56363636363638L901.1515151515151,92.61818181818182L911.2222222222222,90.43636363636362L921.2929292929293,88.98181818181818L931.3636363636363,91.60000000000001L941.4343434343434,86.2181818181818L951.5050505050505,85.92727272727271L961.5757575757576,89.56363636363638L971.6464646464646,89.27272727272728L981.7171717171717,89.27272727272728L991.7878787878788,89.12727272727273L1001.8585858585858,90.72727272727272L1011.929292929293,86.5090909090909L1022,90.43636363636362 \ No newline at end of file diff --git a/MasterThesis/zadanie10.py b/MasterThesis/zadanie10.py new file mode 100644 index 0000000..a1c0ef0 --- /dev/null +++ b/MasterThesis/zadanie10.py @@ -0,0 +1,135 @@ +class Node: + def __init__(self, value): + self.value = value + self.parent = None + self.right = None + self.left = None + + def min_tree(self): + return self.min_value(self) + + def successor(self): + node = self + if self.right is not None: + return self.min_value(self.right) + parent = self.parent + while parent is not None and node == parent.right: + node = parent + parent = parent.parent + return parent + + def min_value(self, node): + current = node + while current.left is not None: + current = current.left + return current + + def free(self): + self.right = None + self.left = None + self.parent = None + + def __str__(self): + return str(self.value) + + +class Bstree: + + def search_recursive(self, key): + return self.recursive_search(key, self.root) + + def recursive_search(self, key, node): + if node is None or node.value == key: + return node + if key < node.value: + return self.recursive_search(key, node.left) + return self.recursive_search(key, node.right) + + def search_iterative(self, key): + node = self.root + while node is not None and node.value != key: + if key < node.value: + node = node.left + else: + node = node.right + return node + + def __init__(self, root): + self.toPrint = [] + self.root = root + + def insert_after(self, node, parent): + if node.value < parent.value: + if parent.left is not None: + self.insert_after(node, parent.left) + else: + parent.left = node + node.parent = parent + + if node.value > parent.value: + if parent.right is not None: + self.insert_after(node, parent.right) + else: + parent.right = node + node.parent = parent + + def insert(self, node): + self.insert_after(node, self.root) + + def write(self): + self.print_node(self.root, 0) + + def print_node(self, node, level): + if node.right is not None: + self.print_node(node.right, level + 1) + print("\t" * level + str(node.value)) + if node.left is not None: + self.print_node(node.left, level + 1) + + def transplant(self, node1, node2): + node1.parent = node2.parent + if node2.parent.left == node2: + node2.parent.left = node1 + else: + node2.parent.right = node1 + node2.free() + + def delete(self, node): + if node.left is None and node.right is None: + if node.parent.left == node: + node.parent.left = None + else: + node.parent.right = None + + if node.left is None and node.right is not None: + self.transplant(node.right, node) + + if node.left is not None and node.right is None: + self.transplant(node.left, node) + + if node.left is not None and node.right is not None: + temp = node.min_value(node.right) + node.value = temp.value + if temp.left: + node = temp.left + else: + node = temp.right + if node: + node.parent = temp.parent + if temp.parent is None: + self.root = node + if temp == temp.parent.left: + temp.parent.left = node + else: + temp.parent.right = node + + +def main(): + for i in range(1, 20): + print(i % 2) + + return 0 + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/MasterThesis/zadanie3.py b/MasterThesis/zadanie3.py new file mode 100644 index 0000000..08b7140 --- /dev/null +++ b/MasterThesis/zadanie3.py @@ -0,0 +1,157 @@ +import numpy as np +from sklearn import datasets +import matplotlib.pyplot as plt + +from sklearn.metrics import accuracy_score + +from sklearn.datasets import load_iris +data = load_iris() +data.target[[10, 25, 50]] +list(data.target_names) + + +def generate_data(): + # Keep results deterministic + np.random.seed(1234) + X, y = datasets.make_moons(200, noise=0.25) + # X, y = datasets.make_classification(200, 2, 2, 0) + return X, y + + +def visualize(X, y, model=None): + x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 + y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 + h = 0.01 + xx, yy = np.meshgrid( + np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) + if model: + Z = predict(model, np.c_[xx.ravel(), yy.ravel()]) + Z = Z.reshape(xx.shape) + plt.contourf(xx, yy, Z, cmap=plt.cm.viridis) + plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.viridis) + plt.show() + + +def initialize_model(dim_in=2, dim_hid=3, dim_out=2): + # Keep results deterministic + np.random.seed(1234) + W1 = np.random.randn(dim_in, dim_hid) / np.sqrt(dim_in) + b1 = np.zeros((1, dim_hid)) + W2 = np.random.randn(dim_hid, dim_out) / np.sqrt(dim_hid) + b2 = np.zeros((1, dim_out)) + return W1, b1, W2, b2 + + +def softmax(X): + e = np.exp(X) + return e / np.sum(e, axis=1, keepdims=True) + + +def predict(model, X): + W1, b1, W2, b2 = model + z1 = X.dot(W1) + b1 + a1 = np.tanh(z1) + z2 = a1.dot(W2) + b2 + probs = softmax(z2) + return np.argmax(probs, axis=1) + + +def calculate_cost(model, X, y): + W1, b1, W2, b2 = model + z1 = X.dot(W1) + b1 + a1 = np.tanh(z1) + z2 = a1.dot(W2) + b2 + probs = softmax(z2) + preds = probs[:, 1] + return -1. / len(y) * np.sum( + np.multiply(y, np.log(preds)) + np.multiply(1 - y, np.log(1 - preds)), + axis=0) + + +# def accuracy(model, X, y): +# predicted = predict(model, X) +# return len([1 for x, y in predict(model, X) if x==y])/len(y) + + +def accuracy(model, X, y): + y_pred = predict(model, X) + return accuracy_score(y, y_pred) + + +# def accuracy1(x, y, model): +# y_pred = (model.predict(x)).type(torch.FloatTensor) +# y = y.unsqueeze(1) +# correct = (y_pred == y).type(torch.FloatTensor) +# return correct.mean() + + +def train(model, X, y, alpha=0.01, epochs=10000, debug=False): + W1, b1, W2, b2 = model + m = len(X) + + for i in range(epochs): + # Forward propagation + z1 = X.dot(W1) + b1 + a1 = np.tanh(z1) + z2 = a1.dot(W2) + b2 + probs = softmax(z2) + + # Backpropagation + delta3 = probs + delta3[range(m), y] -= 1 + dW2 = (a1.T).dot(delta3) + db2 = np.sum(delta3, axis=0, keepdims=True) + delta2 = delta3.dot(W2.T) * (1 - np.power(a1, 2)) + dW1 = np.dot(X.T, delta2) + db1 = np.sum(delta2, axis=0) + + # Parameter update + W1 -= alpha * dW1 + b1 -= alpha * db1 + W2 -= alpha * dW2 + b2 -= alpha * db2 + + # Print loss + if debug and i % 1000 == 0: + model = (W1, b1, W2, b2) + print("Cost after iteration {}: {:.4f}".format(i, calculate_cost( + model, X, y))) + print("Accuracy iteration {}: {:.4f}".format(i, accuracy(model, X, y))) + + return W1, b1, W2, b2 + + +if __name__ == '__main__': + X, y = generate_data() + visualize(X, y) + + model = train(initialize_model(dim_hid=5), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora:", accuracy(X, y, model)) + + model = train(initialize_model(dim_hid=1), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora dla wielkości warstwy równej 1:", accuracy(X, y, model)) + + model = train(initialize_model(dim_hid=2), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora dla wielkości warstwy równej 2:", accuracy(X, y, model)) + + model = train(initialize_model(dim_hid=5), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora dla wielkości warstwy równej 3:", accuracy(X, y, model)) + + model = train(initialize_model(dim_hid=10), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora dla wielkości warstwy równej 10:", accuracy(X, y, model)) + + model = train(initialize_model(dim_hid=15), X, y, debug=True) + visualize(X, y, model) + + print("Skuteczność klasyfikatora dla wielkości warstwy równej 15:", accuracy(X, y, model)) +