Skip to content

Instantly share code, notes, and snippets.

View fuwiak's full-sized avatar
💭
I may be slow to respond.

Pawel fuwiak

💭
I may be slow to respond.
View GitHub Profile
@fuwiak
fuwiak / forecast.py
Last active February 5, 2024 21:00
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'])
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):
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ł
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:
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()
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 = ""
p.generate_ips()
(['127.247.9.229'], ['124.72.36.132'])
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);
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
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.