Skip to content

Commit

Permalink
Reverted last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
prithagupta committed Jan 15, 2020
1 parent 9ee81da commit fe1d55c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions csrank/callbacks.py
Expand Up @@ -3,12 +3,11 @@
import warnings

import numpy as np
from csrank.tunable import Tunable
from csrank.util import print_dictionary
from keras import backend as K
from keras.callbacks import Callback

from csrank.tunable import Tunable
from csrank.util import print_dictionary
from keras.callbacks import EarlyStopping

class EarlyStoppingWithWeights(Callback, Tunable):

Expand Down
9 changes: 5 additions & 4 deletions csrank/dataset_reader/labelranking/survey_dataset_reader.py
Expand Up @@ -2,12 +2,13 @@

import numpy as np
import pandas as pd
from csrank.constants import LABEL_RANKING
from csrank.numpy_util import ranking_ordering_conversion
from sklearn.impute import SimpleImputer
from sklearn.model_selection import ShuffleSplit
from sklearn.preprocessing import Imputer, StandardScaler
from sklearn.preprocessing import StandardScaler
from sklearn.utils import check_random_state

from csrank.constants import LABEL_RANKING
from csrank.numpy_util import ranking_ordering_conversion
from ..dataset_reader import DatasetReader


Expand All @@ -28,7 +29,7 @@ def __load_dataset__(self):
context_feature = [float(i) if i != '.' else np.NAN for i in row[13:33]]
features.append(context_feature)
X = np.array(features)
X = Imputer().fit_transform(X)
X = SimpleImputer().fit_transform(X)
X = np.array([np.log(np.array(X[:, i]) + 1) for i in range(len(features[0]))])
X = np.array(X.T)
self.X = StandardScaler().fit_transform(X)
Expand Down
2 changes: 1 addition & 1 deletion scripts/create_testenv.sh
Expand Up @@ -22,7 +22,7 @@ then
fi


conda install --yes numpy scipy joblib pytest pytest-cov coverage scikit-learn=0.21.3 pandas h5py seaborn mkl-service
conda install --yes numpy scipy joblib pytest pytest-cov coverage scikit-learn pandas h5py seaborn mkl-service
pip install sphinx sphinx-autobuild nbsphinx pandoc ipykernel bottleneck sphinx_rtd_theme notebook sphinxcontrib-bibtex
pip install --no-cache-dir --ignore-installed -r requirements.txt

Expand Down

0 comments on commit fe1d55c

Please sign in to comment.