Podcast
Questions and Answers
Which country's expansion was a political cause of European exploration?
Which country's expansion was a political cause of European exploration?
- German
- Spanish (correct)
- Dutch
- French
What was a social cause of European exploration?
What was a social cause of European exploration?
- Spreading Christianity (correct)
- Mining
- Fur trade
- Establishing colonies
Which disease significantly impacted Native American populations after European contact?
Which disease significantly impacted Native American populations after European contact?
- Influenza
- Chickenpox
- Polio
- Smallpox (correct)
What economic activity was the Dutch West India Trading Company focused on?
What economic activity was the Dutch West India Trading Company focused on?
What was a primary motivation for more European countries to explore the Americas?
What was a primary motivation for more European countries to explore the Americas?
The Treaty of Tordesillas divided land between which two countries?
The Treaty of Tordesillas divided land between which two countries?
What did the Spanish implement, granting land and natives to individual Spaniards?
What did the Spanish implement, granting land and natives to individual Spaniards?
What was a significant exchange introduced to the Americas?
What was a significant exchange introduced to the Americas?
What type of goods did the French exchange with Native Americans?
What type of goods did the French exchange with Native Americans?
Which European power viewed Native Americans as potential military allies?
Which European power viewed Native Americans as potential military allies?
Flashcards
French viewed Native Americans as:
French viewed Native Americans as:
Belief that Native Americans could be potential allies, sought conversions.
Social Causes of Exploration:
Social Causes of Exploration:
Converting natives, cultural discrimination, and using them for labor.
Political Effects of Exploration:
Political Effects of Exploration:
Pushing natives inland and the spread of diseases.
Economic impact of gold/silver:
Economic impact of gold/silver:
Signup and view all the flashcards
Encomienda System:
Encomienda System:
Signup and view all the flashcards
New Laws of 1542
New Laws of 1542
Signup and view all the flashcards
Treaty of Tordesillas
Treaty of Tordesillas
Signup and view all the flashcards
Key Concept 1.1
Key Concept 1.1
Signup and view all the flashcards
Technology improvements 1491-1607
Technology improvements 1491-1607
Signup and view all the flashcards
Study Notes
Bernoulli's Principle
- States that fluid speed increases simultaneously with a decrease in pressure or potential energy.
- Formula: ( P + \frac{1}{2} \rho v^2 + \rho g h = constant )
Formula Components
- ( P ) is the static pressure of the fluid.
- ( \rho ) is the density of the fluid.
- ( v ) is the speed of the fluid.
- ( g ) is the acceleration due to gravity.
- ( h ) is the height of the fluid above a reference point.
- Dynamic Pressure: ( \frac{1}{2} \rho v^2 ) represents pressure from the fluid's kinetic energy; increases with speed.
- Hydrostatic Pressure: ( \rho g h ) represents pressure due to fluid weight at a certain height.
Implications
- As fluid speed ( v ) increases, static pressure ( P ) decreases if height ( h ) is constant.
- As fluid speed ( v ) decreases, static pressure ( P ) increases.
Applications
- Airplane Wings: Air flows faster over the top, creating lower pressure and upward lift.
- Venturi Meters: Measure fluid flow rate by measuring pressure differences in a pipe constriction.
- Carburetors: Use the principle to mix air and fuel in internal combustion engines.
- Chimneys: Taller chimneys enhance pressure differences for smoke and gas removal.
Example
- In a narrowing pipe, fluid speed ( v ) increases, and static pressure ( P ) decreases.
Algèbre Linéaire
Espaces Vectoriels (Vector Spaces)
Definition
- Vector space 'E' is a set equipped with vector addition and scalar multiplication operations.
- Vector addition: (u, v) ∈ E × E → u + v ∈ E
- Scalar multiplication: (λ, u) ∈ 𝕂 × E → λ.u ∈ E, where 𝕂 is a field (usually ℝ or ℂ).
Axioms
- Associativity of addition: ∀ u, v, w ∈ E, (u + v) + w = u + (v + w)
- Commutativity of addition: ∀ u, v ∈ E, u + v = v + u
- Existence of additive identity: ∃ 0_E ∈ E, ∀ u ∈ E, u + 0_E = u
- Existence of additive inverse: ∀ u ∈ E, ∃ -u ∈ E, u + (-u) = 0_E
- Compatibility of scalar multiplication: ∀ λ, μ ∈ 𝕂, ∀ u ∈ E, λ. (μ. u) = (λ μ). u
- Identity element for scalar multiplication: ∀ u ∈ E, 1_𝕂. u = u
- Distributivity of scalar multiplication over vector addition: ∀ λ ∈ 𝕂, ∀ u, v ∈ E, λ. (u + v) = λ. u + λ. v
- Distributivity of scalar multiplication over field addition: ∀ λ, μ ∈ 𝕂, ∀ u ∈ E, (λ + μ). u = λ. u + μ. u
Examples
- ℝ^n: n-tuples of real numbers.
- ℂ^n: n-tuples of complex numbers.
- ℳ_{n,m}(ℝ): n × m matrices with real coefficients.
- ℝ[X]: Polynomials with real coefficients.
- 𝓕(X, ℝ): Functions from X to ℝ.
Sous-espaces vectoriels (Vector Subspaces)
Requirements
- A subset F of a vector space E is a subspace if:
- F is non-empty.
- ∀ u, v ∈ F, u + v ∈ F (stable under addition).
- ∀ λ ∈ 𝕂, ∀ u ∈ F, λ.u ∈ F (stable under scalar multiplication).
- $F$ is a subspace of $E$ if and only if $F \neq \varnothing$ and $\forall u, v \in F, \forall \lambda \in \mathbb{K}, \lambda u + v \in F$
Combinaison linéaire (Linear Combination)
- Vectors u_1,..., u_n in E, a linear combination is a vector of the form:
- λ_1 u_1 +...+ λ_n u_n, where λ_1,..., λ_n ∈ 𝕂.
Sous-espace vectoriel engendré (Subspace Spanned)
- The subspace spanned by vectors u_1,..., u_n is the set of all their linear combinations:
- Vect(u_1,..., u_n) = {λ_1 u_1 +...+ λ_n u_n | λ_1,..., λ_n ∈ 𝕂}.
- This is the smallest subspace containing u_1,..., u_n.
Famille génératrice (Generating Set)
- Vectors (u_1,..., u_n) generate E if Vect(u_1,..., u_n) = E.
- Every vector in E can be written as a linear combination of u_1,..., u_n.
Famille libre (Linearly Independent Set)
- Vectors (u_1,..., u_n) are linearly independent if:
- λ_1 u_1 +...+ λ_n u_n = 0_E ⇒ λ_1 =... = λ_n = 0.
- No vector can be written as a linear combination of the others.
Base (Basis)
- A basis of E is a set that is both linearly independent and generating.
Dimension (Dimension)
- If E has a finite basis, any bases of E have the same number of elements. This is the dimension of E, denoted dim(E). If E does not have a finite basis, E is of infinite dimension.
Théorèmes importants (Important Theorems)
- Théorème de la base incomplète: Any linearly independent set can be extended to a basis.
Dans un espace de dimension finie n / In a space of dimension n
- A linearly independent set of n vectors is a basis.
- A generating set of n vectors is a basis.
Somme de sous-espaces vectoriels (Sum of Subspaces)
- For subspaces F and G of E, the sum is:
- $F + G = {u + v \mid u \in F, v \in G}$.
- F + G is a subspace of E.
Somme directe (Direct Sum)
- The sum F + G is direct if F ∩ G = {0_E}. This is written F ⊕ G.
- In this case, every vector of F + G can be uniquely written as a sum of a vector from F and a vector from G.
Espaces supplémentaires (Complementary Subspaces)
- Subspaces F and G are complementary in E if $E = F \oplus G$.
- Every vector of E can be uniquely written as a sum of a vector from F and a vector from G.
Formule de Grassmann (Grassmann's Formula)
- If E is finite-dimensional and F, G are subspaces of E, then:
- $dim(F + G) = dim(F) + dim(G) - dim(F \cap G)$.
- In particular, if F and G are complementary, $dim(E) = dim(F) + dim(G)$.
Applications Linéaires (Linear Transformations)
Définition (Definition)
- Given vector spaces E and F over the same field 𝕂, a map f : E → F is linear if:
- $\forall u, v \in E, f(u + v) = f(u) + f(v)$ -$\forall \lambda \in \mathbb{K}, \forall u \in E, f(\lambda u) = \lambda f(u)$
- Equivalently: f is linear if and only if $\forall u, v \in E, \forall \lambda \in \mathbb{K}, f(\lambda u + v) = \lambda f(u) + f(v)$.
Exemples (Examples)
- The zero map: $f(u) = 0_F, \forall u \in E$
- The identity: $f(u) = u, \forall u \in E$
- Differentiation: $f(P) = P'$, where P is a polynomial.
- Integration: $f(g)(x) = \int_a^x g(t) dt$, where g is a continuous function.
- Multiplication by a matrix: $f(x) = Ax$, where A is a matrix.
Noyau et Image (Kernel and Image)
- Let $f : E \rightarrow F$ be a linear map.
- Noyau (Kernel): $Ker(f) = {u \in E \mid f(u) = 0_F}$. $Ker(f)$ is a subspace of $E$.
- Image (Image): $Im(f) = {f(u) \mid u \in E}$. $Im(f)$ is a subspace of $F$.
Injectivité, Surjectivité, Bijectivité (Injectivity, Surjectivity, Bijectivity)
- $f$ is injective if $Ker(f) = {0_E}$.
- $f$ is surjective if $Im(f) = F$.
- $f$ is bijective if it is injective and surjective. In this case, the inverse $f^{-1}$ is also linear.
Théorème du rang (Rank-Nullity Theorem)
- If E is finite-dimensional and $f : E \rightarrow F$ is a linear map, then:
- $dim(E) = dim(Ker(f)) + dim(Im(f))$.
- $dim(Im(f))$ is called the rank of f, denoted $rg(f)$.
Isomorphisme (Isomorphism)
- An isomorphism is a bijective linear map. If $f : E \rightarrow F$ is an isomorphism, E and F are isomorphic.
Lab 4: Binary Classification, Model Selection
Introduction
- Explores binary classification using logistic regression.
- Focuses on model selection, specifically regularization (L1 and L2) with cross-validation.
- Dataset relates brain activity and visual stimulus.
Data
stimuli.csv
: Visual stimulus labels (0 or 1).fmri.csv
: fMRI data, each row is a time point, each column a voxel.
Packages
- Includes NumPy, Pandas, Matplotlib, Seaborn, and scikit-learn modules.
- Utilizes
LogisticRegression
,cross_validate
,KFold
,roc_auc_score
,roc_curve
, andStandardScaler
from scikit-learn.
Data Preparation
Load Data
- Loads
stimuli.csv
andfmri.csv
into Pandas DataFrames. - Verifies the shapes of the DataFrames.
Preprocessing
- Drops the first 4 rows from both DataFrames
- Standardizes fMRI data using
StandardScaler
.
Logistic Regression and Cross-Validation
Basic Logistic Regression
- Initializes a Logistic Regression model without regularization (
penalty=None
). - Performs 5-fold cross-validation using
cross_validate
. - Uses 'roc_auc' as the scoring metric.
- Examines cross-validation AUC scores and their mean.
L2 Regularization (Ridge)
- Defines a range of L2 regularization parameters using
np.logspace
. - Iterates through the regularization parameters, training and evaluating a Logistic Regression model with L2 penalty for each.
- Stores the mean and standard deviation of the AUC scores for each penalty.
L1 Regularization (Lasso)
- Defines a range of L1 regularization parameters using
np.logspace
. - Iterates through the regularization parameters, training and evaluating a Logistic Regression model with L1 penalty for each.
- Requires the 'liblinear' solver for L1 regularization.
- Stores the mean and standard deviation of the AUC scores for each penalty.
Visualization
Plotting
- Defines a function
plot_regularization_path
to plot the mean AUC scores and their standard deviations against the regularization parameters. - Plots the L2 regularization path.
- Plots the L1 regularization path.
Best Model Selection
- Manual Selection (L2)
- Manually selects the best L2 penalty based on the plot of the regularization path.
- K-Fold Cross-Validation (Nested CV for Robustness)
- Defines a function
nested_cross_validation
to perform nested cross-validation for robust model selection. - Performs K-fold cross validation to find the best auc scores
- Defines a function
Model Evaluation and Visualization
- ROC Curve (Best L2 Model)
- Refits the best L2 model on the entire dataset.
- Predicts probabilities for the test set.
- Calculates and plots the ROC curve.
- ROC Curve (Best model)
- Refits the best model on the entire dataset
- Predict probabilities for the test set
- Calculates and plots the ROC curve
Coefficient Analysis
Visualization
- Gets the coefficients from the best L2 model.
- Creates a bar plot of the coefficients.
Top Coefficients
- Finds the top N coefficients with the largest absolute values.
- Prints the indices and values of the top coefficients.
UNIDAD 5: INTEGRALES (INTEGRALS)
5.1. LA INTEGRAL INDEFINIDA (INDEFINITE INTEGRAL)
DEFINICIÓN (DEFINITION)
- A primitive (antiderivative) of a function (f(x)) is another function (F(x)) such that (F'(x) = f(x)).
- [ \int f(x) dx = F(x) + C \Leftrightarrow F'(x) = f(x) ]
- The indefinite integral of a function is the set of all its primitives represented by ( \int f(x) dx ).
- (f(x)) is the integrand.
- (dx) is the variable of integration.
- (C) is the constant of integration.
- (F(x)) is an antiderivative of (f(x)).
PROPIEDADES (PROPERTIES)
- ( \int [f(x) + g(x)] dx = \int f(x) dx + \int g(x) dx )
- ( \int k \cdot f(x) dx = k \cdot \int f(x) dx )
INTEGRALES INMEDIATAS (IMMEDIATE INTEGRALS)
Integrals defined in a table format
- Table provides immediate integrals for various functions including constants, powers of x, reciprocals, exponential and trigonometric functions, along with their respective antiderivatives
EJEMPLOS (EXAMPLES)
- Integrals are explicitly computed for polynomial, rational, exponential, trigonometric, and square root functions, demonstrating direct application of immediate integral formulas.
- (\int (5x^3 - 3x^2 + x - 7) dx = \frac{5}{4} x^4 - x^3 + \frac{1}{2} x^2 - 7x + C)
- (\int (\frac{5}{x} + 3e^x) dx = 5 \ln|x| + 3e^x + C)
- (\int \frac{x^2 - x + 5}{x} dx = \frac{x^2}{2} - x + 5 \ln|x| + C)
- (\int (x - 5)^2 dx = \frac{x^3}{3} - 5x^2 + 25x + C)
- (\int \sqrt[3]{x^2} dx = \frac{3}{5} \sqrt[3]{x^5} + C)
- (\int \frac{3}{x^5} dx = \frac{-3}{4x^4} + C)
- (\int \frac{5}{x^2 + 1} dx = 5 \arctan x + C)
- (\int \frac{5}{\sqrt{1 - x^2}} dx = 5 \arcsin x + C)
- (\int 5 \cdot \sin x dx = -5 \cos x + C)
- (\int 3 \cdot \cos x dx = 3 \sin x + C)
- (\int 5 \cdot 2^x dx = 5 \frac{2^x}{\ln 2} + C)
- (\int \frac{7}{\cos^2 x} dx = 7 \tan x + C)
5.2. MÉTODOS DE INTEGRACIÓN (INTEGRATION METHODS)
5.2.1. MÉTODO DE SUSTITUCIÓN (SUBSTITUTION METHOD)
- Substitution method involves changing variables to simplify an integral.
[\int f(x) dx = \begin{cases} x = g(t) \ dx = g'(t) dt \end{cases} = \int f[g(t)] \cdot g'(t) dt = F(t) + C = F[g^{-1}(x)] + C]
EJEMPLOS (EXAMPLES)
- Examples provided show using substitution to solve more complex integrals by simplifying the integrand.
- (\int (x^2 + 5)^3 \cdot 2x dx = \frac{(x^2 + 5)^4}{4} + C)
- (\int \frac{2x}{x^2 + 1} dx = \ln|x^2 + 1| + C)
- (\int e^{x^2 + 1} \cdot x dx = \frac{1}{2} e^{x^2 + 1} + C)
- (\int \frac{1}{x \cdot \ln x} dx = \ln|\ln x| + C)
- (\int \tan x dx = -\ln|\cos x| + C)
5.2.2. INTEGRACIÓN POR PARTES (INTEGRATION BY PARTS)
- Integration by parts is used when the integrand is a product of two functions.
[ \int u dv = u \cdot v - \int v du ]
- Proper selection of (u) and (dv) simplifies the integral.
- "alpes" mnemonic helps choose (u):
- (A \rightarrow \arcsin, \arccos, \arctan)
- (L \rightarrow logarithmic)
- (P \rightarrow polynomial)
- (E \rightarrow exponential)
- (S \rightarrow sine, cosine)
EJEMPLOS (EXAMPLES)
- Examples demonstrate using integration by parts to effectively solve integrals by breaking them into manageable parts.
- (\int x \cdot e^x dx = e^x (x - 1) + C)
- (\int x \cdot \sin x dx = -x \cos x + \sin x + C)
- (\int \ln x dx = x(\ln x - 1) + C)
- (\int \arctan x dx = x \arctan x - \frac{1}{2} \ln|1 + x^2| + C)
5.2.3. INTEGRALES RACIONALES (RATIONAL INTEGRALS)
- Integrals that involve integrating rational functions, where the integrand is a ratio of two polynomials ( \int \frac{P(x)}{Q(x)} dx ).
- If ( \text{degree}(P(x)) \ge \text{degree}(Q(x)) ), divide (P(x)) by (Q(x)):
[ \frac{P(x)}{Q(x)} = C(x) + \frac{R(x)}{Q(x)} ]
- If ( \text{degree}(P(x)) < \text{degree}(Q(x)) ), factorize (Q(x)) and decompose the fraction into simpler fractions.
CASOS (CASES)
CASO 1: RAÍCES REALES SIMPLES (SIMPLE REAL ROOTS)
[ \text{If } Q(x) = (x - a_1)(x - a_2) \cdots (x - a_n), \text{ then: } ]
[ \frac{P(x)}{Q(x)} = \frac{A_1}{x - a_1} + \frac{A_2}{x - a_2} + \cdots + \frac{A_n}{x - a_n} ]
CASO 2: RAÍCES REALES MÚLTIPLES (MULTIPLE REAL ROOTS)
If ( Q(x) = (x - a)^n ), then:
[ \frac{P(x)}{Q(x)} = \frac{A_1}{x - a} + \frac{A_2}{(x - a)^2} + \cdots + \frac{A_n}{(x - a)^n} ]
CASO 3: RAÍCES COMPLEJAS SIMPLES (SIMPLE COMPLEX ROOTS)
If ( Q(x) = (x^2 + bx + c) ), where ( x^2 + bx + c = 0 ) has no real roots, then:
[ \frac{P(x)}{Q(x)} = \frac{Ax + B}{x^2 + bx + c} ]
CASO 4: RAÍCES COMPLEJAS MÚLTIPLES (MULTIPLE COMPLEX ROOTS)
If ( Q(x) = (x^2 + bx + c)^n ), where ( x^2 + bx + c = 0 ) has no real roots, then:
[ \frac{P(x)}{Q(x)} = \frac{A_1 x + B_1}{x^2 + bx + c} + \frac{A_2 x + B_2}{(x^2 + bx + c)^2} + \cdots + \frac{A_n x + B_n}{(x^2 + bx + c)^n} ]
EJEMPLOS (EXAMPLES)
Illustrates the method of partial fractions to solve rational integrals
- (\int \frac{x + 1}{x^2 + 5x + 6} dx = -\ln|x + 2| + 2 \ln|x + 3| + C)
- (\int \frac{x^2 + 1}{x^2 - 1} dx = x + \ln|x - 1| - \ln|x + 1| + C)
5.3. LA INTEGRAL DEFINIDA (DEFINITE INTEGRAL)
DEFINICIÓN (DEFINITION)
- If (f(x)) is continuous on ( [a, b] ), the definite integral of (f(x)) from (a) to (b) is:
- [\int_{a}^{b} f(x) dx = [F(x)]_{a}^{b} = F(b) - F(a)]
- (F(x)) is any antiderivative of (f(x)), where (F'(x) = f(x)).
- (a) is the lower limit of integration.
- (b) is the upper limit of integration
PROPIEDADES (PROPERTIES)
- (\int_{a}^{a} f(x) dx = 0)
- (\int_{a}^{b} f(x) dx = - \int_{b}^{a} f(x) dx)
- (\int_{a}^{b} k \cdot f(x) dx = k \cdot \int_{a}^{b} f(x) dx)
- (\int_{a}^{b} [f(x) + g(x)] dx = \int_{a}^{b} f(x) dx + \int_{a}^{b} g(x) dx)
- (\int_{a}^{b} f(x) dx = \int_{a}^{c} f(x) dx + \int_{c}^{b} f(x) dx), where ( a < c < b )
TEOREMA FUNDAMENTAL DEL CÁLCULO INTEGRAL (FUNDAMENTAL THEOREM OF CALCULUS)
- If (f(x)) is continuous on ( [a, b] ) and (F(x) = \int_{a}^{x} f(t) dt), then (F'(x) = f(x)).
REGLA DE BARROW (BARROW'S RULE)
If (f(x)) is continuous on ( [a, b] ) and (F(x)) is an antiderivative of (f(x)), then:
[ \int_{a}^{b} f(x) dx = F(b) - F(a) ]
EJEMPLOS (EXAMPLES)
Calculates definite integrals using the evaluated antiderivative at the integration limits.
- (\int_{1}^{2} x^2 dx = \frac{7}{3})
- (\int_{0}^{\pi} \sin x dx = 2)
- (\int_{1}^{e} \frac{1}{x} dx = 1)
- (\int_{0}^{1} e^x dx = e - 1)
5.4. APLICACIONES DE LA INTEGRAL DEFINIDA (APPLICATIONS OF THE DEFINITE INTEGRAL)
5.4.1. CÁLCULO DE ÁREAS (AREA CALCULATION)
Calculates areas using definite integrals
ÁREA BAJO UNA CURVA (AREA UNDER A CURVE)
- The area bounded by the curve ( y = f(x) ), the x-axis, and the lines ( x = a ) and ( x = b ) is:
[ A = \int_{a}^{b} |f(x)| dx ]
- If ( f(x) \ge 0 ) on ( [a, b] ), then ( A = \int_{a}^{b} f(x) dx )
- If ( f(x) \le 0 ) on ( [a, b] ), then ( A = - \int_{a}^{b} f(x) dx )
ÁREA ENTRE DOS CURVAS (AREA BETWEEN TWO CURVES)
- The area bounded by the curves ( y = f(x) ) and ( y = g(x) ) and the lines ( x = a ) and ( x = b ) is:
[ A = \int_{a}^{b} |f(x) - g(x)| dx ]
- To calculate the area:
- Find the intersections between the curves ( f(x) ) and ( g(x) )
- Divide the interval ( [a, b] ) into subintervals where ( f(x) \ge g(x) ) or ( f(x) \le g(x) )
- Calculate the definite integral in each subinterval and sum the absolute values of the integrals
EJEMPLOS (EXAMPLES)
Illustrates how to compute areas under curves and between curves using definite integration
- Calculate the area bounded by the curve ( y = x^2 ), the x-axis, and the lines ( x = 1 ) and ( x = 3 )
- ( A = \frac{26}{3} )
- Calculate the area bounded by curves ( y = x^2 ) and ( y = x )
- ( A = \frac{1}{6} )
5.4.2. CÁLCULO DE VOLÚMENES (VOLUME CALCULATION)
Calculates volumes using definite integrals
VOLUMEN DE UN CUERPO DE REVOLUCIÓN (VOLUME OF A SOLID OF REVOLUTION)
- Revolving a function ( f(x) ) around the x-axis from ( x = a ) to ( x = b ) results in a solid of revolution with volume:
[ V = \pi \int_{a}^{b} [f(x)]^2 dx ]
EJEMPLOS (EXAMPLES)
- Calculates the volume of a solid formed by rotating a function around the x-axis
- Calculate the volume of the solid of revolution obtained by rotating the function ( y = \sqrt{x} ) around the x-axis between ( x = 0 ) and ( x = 1 )
- ( V = \frac{\pi}{2} )
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.