Skip to content

Instantly share code, notes, and snippets.

View ialexpovad's full-sized avatar
:electron:
I may be slow to respond.

nystagmus ialexpovad

:electron:
I may be slow to respond.
View GitHub Profile
#include "utest.h"
#include <string>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <vector>
#define length(array) ((sizeof(array)) / (sizeof(array[0])))
type yourArray[] = {your, values};
length(yourArray); // returns length of yourArray
#include <stdlib.h>
#include <stdio.h>
#define length(array) ((sizeof(array)) / (sizeof(array[0])))
int main()
@ialexpovad
ialexpovad / fcm.py
Created February 17, 2023 07:08
Implementation Fuzzy C-Means Algorithm
# %% [markdown]
# # Fuzzy C-Means Clustering
# %%
import re
import sys
import datetime
import os
import math
exceptions = (TypeError , SyntaxError, re.error, AttributeError , ValueError , NotImplementedError , Exception , RuntimeError , ImportError)
@ialexpovad
ialexpovad / ridgeclass.py
Created February 17, 2023 07:04
Ridge Classifier Python Example
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.linear_model import RidgeClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
#
# Load IRIS dataset
#
@ialexpovad
ialexpovad / sc.py
Last active February 17, 2023 06:21
Subtractive Clustering Algorithm according to "Learning of fuzzy rules by mountain clustering" by Ronald R. Yager and Dimitar P. Filev.
'''
Subtractive Clustering Algorithm according to "Learning of fuzzy rules by mountain clustering" by Ronald R. Yager and Dimitar P. Filev.
'''
__author__ = 'Alex Povod'
__version__ = '0.1.1'
import numpy
import numpy.typing as npt
import scipy as sp
@ialexpovad
ialexpovad / gaussian.py
Created February 9, 2023 07:46
Plotting a Gaussian normal curve with Python and Matplotlib
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
# define constants
mu = 998.8
sigma = 73.10
x1 = 900
x2 = 1100
# calculate the z-transform
@ialexpovad
ialexpovad / ifcm.go
Created January 11, 2023 06:20
Intuitionistic fuzzy C-means algorithm based on membership information transferring and similarity measurements (IFCM)
package ifcm
import (
"fmt"
"math"
"sort"
)
//Interval
type Interval struct {
std::vector<std::vector<float>> Read_Iris_Dataset(void)
{
std::ifstream myfile("iris.data");
std::string line;
std::vector<std::vector<float>> Iris_Dataset;
std::vector<float> temp_sepal_len;
std::vector<float> temp_sepal_wid;
std::vector<float> temp_petal_len;
std::vector<float> temp_petal_wid;
std::vector<float> temp_iris_class;
@ialexpovad
ialexpovad / calcSqrEucleanDistance.py
Last active December 27, 2022 07:29
Сalculate squared euclidean distance matrices in Python.
# Several ways to calculate squared Euclidean Distance (Frobenius norm) matrices in Python
# Import modules first:
## import numpy module
import numpy as np
## import numpy linear algebra module
import numpy.linalg as la
## import scipy spatial module
import scipy.spatial as spt
@ialexpovad
ialexpovad / notify.py
Created December 15, 2022 14:10
Notification class for library base on pre-build QApplication . Saved and accesible through a notify window, which opens by clicks on the notify button of any window.
# General Library Pre-Build QApplication
# Notify file
Author = "Alex Povod"
Version = "0.0.1"
Domain = "https://github.com/ialexpovod/GLP"
# Python Traceback
# https://www.geeksforgeeks.org/python-traceback/
import datetime