Skip to content

Instantly share code, notes, and snippets.

View bitnulleins's full-sized avatar

Finn Dohrn bitnulleins

View GitHub Profile
@bitnulleins
bitnulleins / OrdinalClassficiation.py
Created January 31, 2023 22:32
Ordinal Classification / Ordinal Regression class
from sklearn.base import BaseEstimator
import numpy as np
class OrdClass(BaseEstimator):
"""
Helper class that solves ordinal classification (classes that have an order to them eg cold,warm,hot)
Paper (2001): https://www.cs.waikato.ac.nz/~eibe/pubs/ordinal_tech_report.pdf
Fixed source from: https://github.com/garyongguanjie/Ordinal-Classifier
"""
def __init__(self,classifier=None,clf_args=None):
@bitnulleins
bitnulleins / ics_merge.php
Last active July 1, 2022 10:34
Merge iCal / ICS Files
<?php
function merge_ics($token, ...$ics_urls) {
/**
* Merge list of ICS files to one ICS file. Use ICS header from first ICS file.
* Download ICS file from remote server with *file_get_contents*
*/
$ical_list = "";
foreach($ics_urls as $key => $ics_file) {
@bitnulleins
bitnulleins / csv2parquet.py
Last active March 15, 2022 14:25
CSV to Parquet Converter (Python)
#!/usr/bin/python
import pandas as pd
import sys, getopt
def main(argv):
"""
Convert any csv file to parquet file with pandas library.
Requirments: