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
#run in python 2.7 | |
from hmmlearn.hmm import GaussianHMM | |
data=np.fromfile("np_input_file.txt").reshape([200001,6]) | |
#MODEL PARAMS | |
K=3 | |
iter_num=3000 | |
convergence_tolerance=0.001 | |
stat_vec_tol=0.999 | |
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 | |
from pomegranate import * | |
#IMPORT THE SAME DATA FROM 2 FILE FORMATS USING 2 METHODS | |
pd_data_df=pd.read_csv("pd_input_file.txt",engine="python", delimiter="\\t",names=['x1','x2','x3','x4','x5','x6']) | |
pd_data=pd_data_df.values.reshape([1,200001,6]) | |
np_data=np.fromfile("np_input_file.txt").reshape([1,200001,6]) | |
#IF ALL 3 OF THESE STATEMENTS ARE TRUE THEN THE DATA SHOULD BE TOTALLY INDISTINGUISHABLE FROM EACH OTHER: |
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 matplotlib.pyplot as plt | |
from matplotlib.offsetbox import OffsetImage, AnnotationBbox | |
from matplotlib.cbook import get_sample_data | |
def imscatter(x, y, image, ax=None, zoom=1,alpha=1): | |
if ax is None: | |
ax = plt.gca() | |
try: | |
image = plt.imread(image) |
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 xarray as xr | |
from scipy.interpolate import griddata | |
import napari | |
import matplotlib.pyplot as plt | |
from vispy.color import Colormap | |
import cmocean.cm as cm | |
# Make land colormap with transparent ocean: | |
cmap = plt.cm.gist_earth |