""", formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('-n', "--NRN", help="NEURON TYPE", default='LIF') parser.add_argument('-a', "--amp",help="Amplitude of the current in pA",\ type=float, default=200.) parser.add_argument('-d', "--duration",help="Duration of the current step in ms",\ type=float, default=400.) parser.add_argument('-as', "--amplitudes", help="ARRAY of Amplitude of different steps in pA",\ type=float, default=[], nargs='*') parser.add_argument('-ds', "--durations", help="ARRAY of durations of different steps in ms",\ type=float, default=[], nargs='*') parser.add_argument('-dl', "--delay",help="Duration of the current step in ms",\ type=float, default=150.) parser.add_argument('-p', "--post",help="After-Pulse duration of the step (ms)",\ type=float, default=400.) parser.add_argument("-c", "--color", help="color of the plot", default='k') parser.add_argument("--save", default='', help="save the figures with a given string") parser.add_argument("-v", "--verbose", help="", action="store_true") args = parser.parse_args() from neural_network_dynamics.cells.pulse_protocols import current_pulse_sim from graphs.my_graph import graphs mg = graphs() mg.response_to_current_pulse(*current_pulse_sim(vars(args))) mg.show()
import numpy as np from sklearn.model_selection import train_test_split from sklearn.datasets import make_moons from sklearn.ensemble import BaggingClassifier from sklearn.tree import DecisionTreeClassifier if __name__ == '__main__': import sys, os # visualization module sys.path.append('../..') from graphs.my_graph import graphs mg = graphs('screen') X, y = make_moons(n_samples=400, noise=0.30, random_state=42) X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42) # Single Decision Tree Classifier tree = DecisionTreeClassifier() tree.fit(X_train, y_train) # Bagging Classifier bag_clf = BaggingClassifier(\ DecisionTreeClassifier(), n_estimators=500, max_samples=0.5, bootstrap=True) bag_clf.fit(X_train, y_train) fig, AX = mg.figure(axes=(1, 2)) for ax in AX: