This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from statsmodels.tsa.holtwinters import SimpleExpSmoothing | |
from sklearn.metrics import mean_squared_error | |
# Assuming df_list[100]['y_lag'] is your time series data | |
# Ensure it's a pandas Series for compatibility with SimpleExpSmoothing | |
data = pd.Series(df_list[100]['y_lag']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vector2D: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def __str__(self): | |
return f"Vector2D({self.x}, {self.y})" | |
def __add__(self, other): | |
if isinstance(other, Vector2D): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
# Pobierz aktualną ścieżkę do bieżącego pliku | |
current_path = os.path.dirname(os.path.abspath(__file__)) | |
# Dodaj dwa poziomy wyżej do ścieżki | |
two_levels_up = os.path.abspath(os.path.join(current_path, "../../")) | |
# Dodaj nową ścieżkę do sys.path, aby Python mógł znaleźć moduł |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compare_algorithms2df(MLA, X_train, X_test, y_train, y_test, sorted_by_measure='accuracy'): | |
#show grid with compared results - accuracy, recall, ppv, f1-measure, mcc | |
MLA_columns = [] | |
MLA_compare = pd.DataFrame(columns = MLA_columns) | |
row_index = 0 | |
for alg in MLA: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyspark | |
#import udf | |
from pyspark.sql.functions import udf | |
from pyspark.sql.types import BooleanType | |
from shapely.geometry import Point, Polygon | |
# Create a SparkContext | |
sc = pyspark.SparkContext() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IP: | |
def __init__(self, ip_address, filename): | |
self.ip_address = ip_address | |
self.filename = filename | |
def random_ip_nonlocal(self): | |
lista_ip_non_local = [] | |
for i in range(self.ip_address): | |
ip = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p.generate_ips() | |
(['127.247.9.229'], ['124.72.36.132']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function p = predict(theta, X) | |
%PREDICT Predict whether the label is 0 or 1 using learned logistic | |
%regression parameters theta | |
% p = PREDICT(theta, X) computes the predictions for X using a | |
% threshold at 0.5 (i.e., if sigmoid(theta'*x) >= 0.5, predict 1) | |
m = size(X, 1); % Number of training examples | |
% You need to return the following variables correctly | |
p = zeros(m, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [J, grad] = costFunction(theta, X, y) | |
%COSTFUNCTION Compute cost and gradient for logistic regression | |
% J = COSTFUNCTION(theta, X, y) computes the cost of using theta as the | |
% parameter for logistic regression and the gradient of the cost | |
% w.r.t. to the parameters. | |
% Initialize some useful values | |
m = length(y); % number of training examples | |
% You need to return the following variables correctly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adam Małysz was born in Wisła, Poland, to Ewa and Jan Małysz. He has an older sister – Iwona (born 1975). | |
He graduated from a vocational high school in Ustroń, where he learned a profession (specialisation: tinsmith-roofer). | |
He speaks German very well. On 16 June 1997 he married Izabella Polok (born 4 December 1978). | |
The wedding took place at the Evangelical Church of St. Peter and Paul in the Wisła (Izabella is Catholic). | |
On 31 October 1997, Izabella gave birth to their daughter – Karolina. | |
His life motto is "Be good and that's it" and his idol is German former ski jumper Jens Weißflog. | |
His religion is Lutheranism | |
On 1 April 2007 Małysz opened a Trophy Gallery, which includes all the major medals and trophies he won during his career, | |
including the Crystal Globe trophies for victories in the World Cup. |
NewerOlder